Carrental | Computer Science homework help

Category: Computer Science

AP Computer Science Weekly Project
 
Weekly Project 2
CarRental
Background:
When you rent a car from an agency, the key ring has several pieces of information: license plate, make
and year of car, and usually a special code. This code could be used for some data processing within the
company’s computers. This lab will practice determining that special car rental code from the license
plate.
Assignment:
1. The following sequence of steps will be used to convert a sample license plate into a car rental code.
a. A license plate consists of 3 letters followed by a space, followed by a 3-digit integer. For
example, CPR 607.
b. Add up the ASCII values of the 3 letters, 67 + 80 + 82 = 229.
c. Add the sum of the letters to the 3-digit integer. For example, 229 + 607 = 836.
d. Take this sum (836) and determine the integer remainder after dividing by 26:
836 % 26 = 4.
e. Determine the 4th letter in the alphabet after the letter ‘A’: 4th letter after ‘A’ = ‘E’
f. Combine the letter and the sum. Thus, we have CPR 607 = E836.
2. You may assume that all sample data will be in the format of 3 alphabet characters, then a space,
followed by a 3-digit integer.
Instructions:
1. Use either Scanner or GUI to get input.
2. Prompt and retrieve the make, model, and license plate of the car.
3. Print the run output in this format.
Make = Chevrolet
Model = Suburban
CPR 607 = E836
4. Test the following sample inputs and have it print the corresponding output:
Make = Ford, Model = Explorer, Plate = RJK 492
Make = Aston Martin, Model = Coupe, Plate = SPT 309
Considerations:
What instance variables, methods, and imports do you need for this class? What String methods will
be helpful? What ASCII values do you need to know? How do mixed data types interact?
HOW TO SUBMIT: SUBMIT YOUR JAVA CODE ONLINE TO SCHOOLOGY. BE SURE
TO INCLUDE YOUR NAME IN COMMENTS. YOU CAN TALK ABOUT IDEAS WITH
OTHERS BUT THE CODE MUST BE SOLELY YOURS.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
Pay Someone To Write Essay