Question: write a java method using array of object to calculate average price of sold cars. Array defined as (ncars = 4). 1 Create the Car

write a java method using array of object to calculate average price of sold cars. Array defined as (ncars = 4). 1 Create the Car class: - Instance variable: int carno, String model, double price - Constructor/getter/setter 2 Create the carPrice class: - write a method popCarArray() to populate Array of car object. Don't use Java scan - Write a method AvgCarSold() to calculate avg price of cars, throw an exception, if No cars sold.

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!