Currency Exchange Code Project The file shows the description and example
follow every steps on description
follow every steps on description
follow every steps on description Write a program TimeConverter.java in a package named a01) that takes as input a 4 digit number that represents a
time on the 24 hour time clock (0200, 2315, 0730).
The program should convert the time to a time on the 12 hour clock and display it in the usual format 2:00 am, 11:15
pm, 7:00 am) then pause before ending.
The program should verify that the input is valid (4 characters that are digits and represent a valid time). If the input is
not valid the program should display an error message and pause before ending the program should NOT crash!!!).
Note: the method Character.isDigit() returns true or false based on if a character is a digit. You can use this with
stringName.charAt(someIndex) to determine if a character at some index of a string is a
digit. Character.isDigit(stringName.charAt(somelndex)). For more details see the code added to the bottom of the basics2
file.
Note: 0000 and 2400 both refer to the same time, we will consider 0000 to be the ONLY valid representation for that
time.
Your program should display the standard information header (part 1 of lab01) and the code should meet all the code
style requirements including the required comments, self assessment, and test cases as discussed in lecture. You will
submit a single .java file for grading, the .class file is not required.
The following is an example of what a valid run of the program should look like:
Assignment##
Lastname, Firstname
A########
Description of the program
Enter a 4 digit 24h time: 0005
0005 is 12:05 am
Press enter to end…
And for something invalid:
Assignment##
Lastname, Firstname
A########
Description of the program
Enter a 4 digit 24h time: 3:05
Error: invalid input 3:05
Press enter to end…
Example with no command line parameters
Assignment
Lastname, Firstname
A#*****
Description of the program
Including instructions for use
Press enter to end.
2) If one or more command line argument(s) is provided the program will not display the information header and will output the
converted amounts one per line. If any of the inputs are invalid then the corresponding line will display an error message but the
program will continue with converting the next argument until all have been converted. The program should then pause before
ending
Example with command line arguments: 12.50EUR 125.00USD 13EUR 15.67USD 50000.00JPY 1.00JPY
€12.50 EUR is $19.00 CAD
$125.00 USD is $161.25 CAD.
Error: invalid input 13EUR.
$15.67 USD is $20.21 CAD.
¥50000.00 JPY is $550.00 CAD.
¥1.00 JPY is $0.01 CAD.
Press enter to end..
Notice the format of the output, both the input amount and the converted amount are displayed with the correct currency symbol
and exactly 2 places after the decimal point. Also the values are rounded correctly to those 2 digits after the decimal point (printf will
do this rounding for you!).
The program should use the following exchange rates:
1 EUR is 1.52 CAD
1 USD is 1.29 CAD
1 JPY is 0.011 CAD
For this assignment you should use several methods (with Javadoc comments) rather than have all the code in the main method. For
example a method that checks if a parameter is valid, a method that converts the currency, a method that outputs the results in the
correct format, etc.
Purchase answer to see full
attachment
Economic Debate- Progressive Income Tax For this Economic Debate, we are going to discuss the…
TOPIC: Going Global Discussion Thread 1 (initial post due Wednesday for full credit) Please note:…
Assignment Topic This week will culminate in the creation of a narrated PowerPoint to create…
The Assignment must be submitted on Blackboard (WORD format only) via allocated folder. Assignments submitted…
you need to post your 2-page information flier to share with your Final Project Group.…
discussion: Discuss the methods used at your company to measure and ensure quality products and…