Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CS 314 Programming Assignment 1: Conversions (cont.) Operation . This application begins by displaying a main menu with four items. If the user chooses the
CS 314 Programming Assignment 1: Conversions (cont.) Operation . This application begins by displaying a main menu with four items. If the user chooses the first main menu item, the application displays a menu of possible conversions. After the user selects a conversion, the application prompts the user to enter a unit of measurement, calculates the conversion displays the result, and displays the main menu again. If the user chooses the second main menu item, the application prompts the user to enter the values for a new conversion, saves this new conversion to a file, and displays a message to the user o If the user chooses the third main menu item, the application displays a menu of possible conversions. After the user selects the conversion, the application deletes that conversion from the file, displays a message to the user, and displays the main menu again. If the user chooses the fourth main menu item, the application displays a goodbye message and exits. Specifications Create a class named Conversion that can store information about a conversion, including the from unit, from value, to unit, to value, and conversion ratio. This class should also contain the methods that perform the conversion calculations and return the results as a formatted string. .Create a class named ConversioniO that contains two methods: one that reads an array list of Conversion objects from a file and another that writes an array list of Conversion objects to a file. For example: public atatic ArrayListeconversions getconversions () public static void saveConversions (Arraylisteconversion> conversiona) Store the list of conversions in a text file named conversion_types.txt in the same directory as the ConversionlO class. If the conversion_types.txt file doesn't exist, the ConversioniO class should create it. This class should use buffered l/O streams, and it should close all I/O streams when they're no longer needed Create a class named ConversionsApp that displays the menus and responds to the user's choices. Use the Console class shown in chapter 8 or a variation of it to get the user's entries. Comment an the code
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started