Question: Question 1: Class car String make: int price public Car (String m, int p)f price P double calculateDiscountPrice (double rate) f double disPrice price -(price

 Question 1: Class car String make: int price public Car (String

Question 1: Class car String make: int price public Car (String m, int p)f price P double calculateDiscountPrice (double rate) f double disPrice price -(price rate) return diaPzice public String sastxina0 String detailsmake+ price"KD" return detaiis Give the above class Car, write a main class to do the following: 1. Create an empty array list of cars 2. Write a loop to allow the user to add exactly five different cars in the array list. B. Write java statement to print out the make of the first car in the array list. 4. Write java statement to print out the price of the last car in the array list. 5. Write java statement to print out the details of the third object in the array list 6, write java statement to calculate the price of the fourth car after a discount of 20%. 7. Write a loop to print out the details of each car in the array list along with its price after a discount 10%. 8. Write a loop to print out the total price for all cars in the array ist 9. Write a loop to check and print out if the array ist has BMW car or not 10 Write a loop to print out the make of the cars that are les than 10,000KD 11 Write a loop to find the most expensive ear in the array list, and pint out its detas

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!