subject

Write a program for the Department of Motor Vehicles that allows new drivers to obtain a license and existing drivers
to renew their licenses or pay violations,
New licenses are randomly generated numbers >= 3000 and
less than 4000. The fee for a new license is the last digit of
the generated license Id in dollars.
If an existing driver with a license Id >= 2000 and less than
3000 attempts to renew his or her license, the program responds that
his or her license is suspended. The fee for other drivers to
renew their license is either the license Id divided by
one hundred or 10 dollars, whichever is greater.
The fee for an existing driver to pay his or her violations is
the number of violations times the license Id divided by one hundred.
The result is rounded up to the next whole dollar amount.
*
求 * IMPORTANT IMPORTANT IMPORTANT *
Your program must duplicate the sample runs exactly.
DO NOT USE arrays, loops, or any Java constructs not taught yet
in class. Also do not use any Java API classes except
Scanner, System, String, and Math.
* IMPORTANT IMPORTANT IMPORTANT *
SAMPLE RUNS:
Are you a new driver(Type Y or N)?Y
Your license ID is 3759
Please pay new license fee of $9.0
Are you a new driver(Type Y or N)?N
Enter your licenseId: 2501
Select a service
- Renew License
1 - Pay Violation(s):0
Your license is suspended and cannot be renewed
Are you a new driver(Type Y or N)?N
Enter your licenseId: 1234
Select a service
- Renew License
1 - Pay Violationen


Write a program for the Department of Motor Vehicles that

allows new drivers to obtain a license

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 21:30
How do you take a green screen out of the video while editing?
Answers: 2
question
Computers and Technology, 23.06.2019 17:00
The more powerful, 60 volt cables and the main power shut off on an hev are both colored orange
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
File account.java (see previous exercise) contains a definition for a simple bank account class with methods to withdraw, deposit, get the balance and account number, and return a string representation. note that the constructor for this class creates a random account number. save this class to your directory and study it to see how it works. then write the following additional code: 1. suppose the bank wants to keep track of how many accounts exist. a. declare a private static integer variable numaccounts to hold this value. like all instance and static variables, it will be initialized (to 0, since it’s an int) automatically. b. add code to the constructor to increment this variable every time an account is created. c. add a static method getnumaccounts that returns the total number of accounts. think about why this method should be static - its information is not related to any particular account. d. file testaccounts1.java contains a simple program that creates the specified number of bank accounts then uses the getnumaccounts method to find how many accounts were created. save it to your directory, then use it to test your modified account class.
Answers: 3
question
Computers and Technology, 23.06.2019 19:40
Use a physical stopwatch to record the length of time it takes to run the program. calculate the difference obtained by calls to the method system.currenttimemillis() just before the start of the algorithm and just after the end of the algorithm. calculate the difference obtained by calls to the method system.currenttimemillis() at the start of the program and at the end of the program so that the elapsed time includes the display of the result. use the value returned by the method system.currenttimemillis() just after the end of the algorithm as the elapsed time.
Answers: 3
You know the right answer?
Write a program for the Department of Motor Vehicles that allows new drivers to obtain a license an...
Questions
question
Mathematics, 20.04.2020 05:51
question
Computers and Technology, 20.04.2020 05:51
question
Mathematics, 20.04.2020 05:51
question
Chemistry, 20.04.2020 05:51
question
English, 20.04.2020 05:51
question
English, 20.04.2020 05:51
Questions on the website: 13722362