ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 12 Weeks Ago, 5 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 22 May 2017 My Price 8.00

public class TestDealerShip

I need help with this assignment, specifically the printReport, String printAllCarsOfColor and printAllCarsWithSellingPriceBelow

 

public class TestDealerShip{public static void main (String[] args){CarDealerShip dealer = new CarDealerShip ();dealer.addNewCar ("GM Buick Century", 2004, 20000, "Silver");dealer.addUsedCar ("Toyota Corolla", 1999, 9000, true);dealer.addNewCar ("Honda Civic", 2004, 15000, "Green");dealer.addNewCar ("BMW 320i", 2004, 35000, "Black");dealer.addUsedCar ("Toyota Sienna", 2000, 11000, false);System.out.println (dealer.printReport ());System.out.println ("");System.out.println (dealer.printAllCarsWithSellingPriceBelow (10000));System.out.println ("");System.out.println (dealer.printAllCarsOfColor ("Green"));}}class CarDealerShip{private String m;private int y;private int p;private String c;int listSize;Car[] cars;boolean r;public CarDealerShip (){cars = new Car [80];listSize = 0;}public void addNewCar (String model, int year, int price, String color){m = model;y = year;p = price;c = color;cars [listSize] = new NewCar (m, y, p, c);listSize++;}public void addUsedCar (String model, int year, int price, boolean rusty){m = model;y = year;p = price;r = rusty;cars [listSize] = new UsedCar (m, y, p, r);listSize++;}public String printReport (){String list = "";for (int i = 0 ; i <= listSize ; i++)list += cars [i].toString () + "\n";return list;

Answers

(11)
Status NEW Posted 22 May 2017 03:05 AM My Price 8.00

-----------

Not Rated(0)