Is it possible to simple this to where a first year ap student can understand?
Hi guys me and my teacher for computer science came up with this code together, to introduce how to make car models, and lisence plates. But unfortunantly our students does not understand how it is, and we tried to make it as simple as we could.
If its possible, do you guys think you can dumb this down a little? Because we have a bunch of 1st years in Computer Science AP, and we tried the best we can do but it isnt working.
whatever you guys can do to try and shrink it, but still make it able to recieve the programming that works.
Looking forward to ur replies ^_^
Code:
import java.util.*;
public class CarRental
{
public static void main(String[] args)
{
String mf;
String model;
String[] Manufacturer = {"Honda", "Toyota", "Volvo", "Lexus", "Hyundai","Mazda", "Ford", "Volkswagen", "Audi",
"Mitsubishi", "Land Rover", "Suzuki", "Nissan", "Subaru", "BMW", "KIA", "GM"};
Scanner input = new Scanner(System.in);
System.out.println("Welcome to Ryans Honestly Used Car Lot!");
System.out.println("Please enter your Car Manafacturer to see if we have it :");
mf=input.nextLine();
System.out.println("Wise choice there. Now please enter your Car Model:");
model=input.nextLine();
System.out.println("Model = " + model);
String LPC;
String RID = null;
String LicensePlateCharacters = ("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
String[] LicensePlateNumbers = {"1234567890"};
System.out.println("Please enter your desired liscence plate, an example would be CPR 607:");
LPC =input.nextLine();
char[] License = LPC.toCharArray();
int number = 0;
int sum = 0;
for(int x =0; x<3;x++)
{
number+=(int)License[x];
System.out.print(number + " ");
}
sum = number;
int si = sum+Integer.valueOf(LPC.substring(4));
int x = si % 26;
char alphaCode = (char)((int)'a'+x);
alphaCode=String.valueOf(alphaCode).toUpperCase().charAt(0);
System.out.println(number);
System.out.println("Your License Plate Should Be: " + LPC + " = " + alphaCode + si);
System.out.println("Your rental ID From Us Is: " + alphaCode + si);
System.out.println("");
System.out.println("Test Values:");
System.out.println(License);
System.out.println(si);
System.out.println(alphaCode);
System.out.println("");
System.out.println("");
System.out.println("Heres Your Receipt:");
System.out.println("");
System.out.println("The Make = " + mf);
System.out.println("Your Model = " + model);
System.out.println("Your License Plate is: " + LPC + " = " + alphaCode + si);
System.out.println("Your rental ID From Us Is: " + alphaCode + si);
System.out.println("Thank you for using Ryans Honestly Used Car Lot, Remember! If it aint Ryans, It aint nothing!");
}
}
Re: Is it possible to simple this to where a first year ap student can understand?
I don't see whats so complicated about it, as long as you explain/comment on it well enough.
Re: Is it possible to simple this to where a first year ap student can understand?
Re: Is it possible to simple this to where a first year ap student can understand?
Please do not multipost the same question in the forum. This is not being fair to us. Locking this thread.