Write a java console project - create a class called car

Assignment Help JAVA Programming
Reference no: EM131599397

Write a java console project, call it GameCar.

Create a class called car.

A. This class should have the following four public attributes: integer carId, String carName, integer racePosition, and String carModel.
B. This class should have a constructor which will take 3 parameters: integer carId, String carName, and String carModel. (Except racePosition, which will be generated in car game)
C. This class should have a Display method, to display the following information in a new row: "carName" is ranked "racePosition", Model is "carModel"

4.2 Create an Interface called gameInterface, in this interface, create an abstract method called "gameStart(int numberOfRounds)"

4.3 Create a class call carGame
A. This class should have one private member call "carList", which is an array of car objects.
B. This class should have one constructor, which will initialize "carList" for all 5 car objects. When you do initialization, each car in the carList, must have a unique carId (0-4), unique carName (For example John's Mustang), and unique carModel picked from the following 5 models ("Mustang", "Nissian_370Z", "BMW_M3", "Audi_R8", "Porsche_911")
C. This carGame should have a method called Display(), inside this method, you should use a for-loop to call each car's Display() method. Since car.Display() will display one row for this car, carGame.Display() will display all 5 cars' information in 5 rows.
D. Your carGame class must implement the gameInterface, you should implement the gameStart(int numberOfRounds) method. This method takes one parameter: integer numberOfRounds to decide how many rounds this game will run. Inside this method, you should have nested for-loops. The outside for-loop runs numberOfRounds, the inside for-loop assigns a random number between 1-5 to each car's racePosition. In the outside for-loop, for each round, you should call carGame.Display, to display the current round's car positions.

4.4 In your main function, you should create a new carGame object. Then call it's gameStart method, and pass in the parameters in the following way: carGame.gameStart(5). This will make the carGame run 5 rounds.

Reference no: EM131599397

Questions Cloud

Prepare the september cash budget for pto manufacturing co : Use the following information to prepare the September cash budget for PTO Manufacturing Co. Budgeted cash receipts from sales in September, $263,000
Describe false memory and false memory experiments : Describe false memory and false memory experiments. Use the CogLab experiment to illustrate false memory experiments, special distracters, and normal distracter
Configuration of the atoms : State the electron configuration of the atoms of the following elements: sodium, magnesium, chlorine and neon.
Elements belongs-sodium-magnesium : State the group to which each of the following elements belongs: sodium, magnesium, chlorine and neon.
Write a java console project - create a class called car : Write a java console project - Create a class called car - Create an Interface called gameInterface
What methods of knowing are appropriate for christians : What methods of knowing are appropriate for Christians and why (this will actually help you classify your approach);
Sample of water was observed to have peculiar taste : A sample of water was observed to have peculiar taste. The taste may be caused by chloride ions or sulphate ions.
Exchange column containing a cation exchange resin : In this lab exercise a solution containing K+ is passed down an ion exchange column containing a cation exchange resin in the acid form.
Why did the authors use multiple regression : Why did the authors use multiple regression? Do you think it is the most appropriate choice? Why or why not?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd