I am in a java class and i am completly lost. This is the assignment that i have.
Write class Computer with attributes brand, type, price. The type attribute is an enumerated type variable with values DESKTOP, LAPTOP, and TABLET. Adhere to our Java coding standards. Computer has an additional method, calculateCharge, that accepts the quantity sold and returns the total charge.
1. Write program, ComputerTest1, that declares an array, computerArray, with 5 slots. It also has additional methods of createInstance and printInstance. createInstance reads the information from the command prompt (keyboard) to create instances of Computer. It will ask for the brand, the type, and the price. The instance will be stored in an array, computerArray. printInstance will ask for the quantity, calculate the total charge, and print the information as follows to a JOptionPane box.
Brand Type TotalCharge
Sample output might be
Sony LAPTOP $1200.00
2. Write program, ComputerTest2, that will modify createInstance to let the user enter how many times he/she wants to create a Computer then lets the user enter the computer information. All instances are stored in computerArray. Modify printInstance to print the entire computerArray in a JOptionPane box. You will have to ask for the quantity for each instance in the array.
3. Write program, ComputerTest3, that defines the computerArray inside the main method and passes the computerArray to createInstance and to printInstance. The functionality is the same.
Can someone help guide me in the right direction.