Programming task: Write a program, BaseConverterIO, that coverts ordinary base 10 numbers from an input file into another base, creating an output file in the process.

The program displays a menu which asks the user to select one of three conversion types:

1 – Binary (base 2)
2 – Octal (base 8)
3 – Hexadecimal (base 16)

The input file is SPY.csv, which can be found on D2L in Materials / Content / Data / SPY.csv. This input file has 7 data columns and your program should only process 3 of its columns: the leftmost (date) column and the two rightmost numeric columns.

Programming assignment

1. User menu allows for selecting the new number base. The methods must be members of separate classes Binary, Octal, Hexadecimal that descend from your abstract class called Base.

2. Within your code, demonstrate the use of these method concepts (Please make sure your comments indicate each one.):

overloading some class method (not a constructor)
accessor (getter)
mutator (setter)
constructor overloading

3. Create and implement interface NumTraits that contains a method convertNum that is overridden as needed. Make sure that your interface has bearing on your program check by removing implements NumTraits from any implementing classes to see if the program still runs as expected.

4. According to the user's base selection, your program generates output files SPYbase2.txt, SPYbase8.txt and SPYbase16.txt, each consisting of the date and the converted two rightmost numeric columns.

5. Within your code comments, discuss the logic of your code design in consideration of overriding convertNum in the abstract super class versus the sub classes.

6. Within your code comments, discuss where your interface is integral to the concepts of composition and polymorphism. Is it one or both? Explain why.

7. your program, including its distinct classes, is contained in a single file, BaseConverterIO.java, that compiles and runs as expected. The program deals with floating point numbers correctly and each of the three base output files have three columns.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.