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
Get step-by-step solutions from verified subject matter experts
