Do the following program BOTH in pseudocode and submit that as pseudocode.txt , AND regular Java code
Fantastic news! We've Found the answer you've been seeking!
Question:
Do the following program BOTH in pseudocode and submit that as pseudocode.txt AND regular Java code that can run. Use methods when appropriate!!
The program first asks the user for the password. If the password is not correct, it gives an error message and asks to try again. If user gets it wrong twice they are warned they only get one more chance. On the third failure, it gives and error message. Then it says, "Press Enter to Continue" then closes the program. You can use a constant variable hard coded in the program to store the password to compare against. You would NEVER do that in the real world.
If user enters the correct password then a menu appears with following options: Generate License Plate, Calculate Registration Fee, Calculate Ticket Fees, Quit. User can select any option by entering the number and then the program does that task, then it automatically returns to Main Menu to offer the user another choice. If user chooses Quit, the program says "Goodbye!" then closes.
The Generate License Plate task generates a random license plate, containing capital letters followed by numbers and puts it on the screen.
The Calculate Registration Fee asks for the year of the car and the year of birth of the driver registered to the car. Obviously data is validated. Then the total registration cost is output to user.
The base registration fee is $ If the car is less than years old, a $ discount exists. If more than years old, a $ extra fee exists, if more than years, a $ extra fee exists.
If the driver is more than years old, a $ extra fee exists. For every years after and extra $ fee applies. So for example an year old person is charged the $ fee plus another $ in fees.
In order to figure out their age just subtract the year of birth from current year dont worry about being a few months off, etc.
How do you know the current year? There's a way in Java to get it from the system clock but let's make it simple and for this project you can hardcode the current year.
The Calculate Ticket Fees asks user how many tickets they are entering. Then for each ticket it asks how many dollars was the ticket for, and what year the ticket was issued. Then the total amount owed is output to user.
Any ticket more than years old gets a penalty, more than years old gets a penalty, and more than years old gets a penalty. So for example a ticket of $ that is years old would total $
Again you may hardcode the current year to do the math, but in the real world you wouldn't.
Related Book For
Principles Of Information Security
ISBN: 9780357506431
7th Edition
Authors: Michael E. Whitman, Herbert J. Mattord
Posted Date: