Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

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.

Java, Programming

  • Category:- Java
  • Reference No.:- M92408110
  • Price:- $10

Priced at Now at $10, Verified Solution

Have any Question?


Related Questions in Java

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Can someone kindly help me to consider whether java

Can someone kindly help me to consider whether Java provides the facility of operator overloading? If it does, may you kindly describe how overloading operators can be accomplished? If not, may you kindly describe why yo ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Object-oriented software development1 introduction 11

OBJECT-ORIENTED SOFTWARE DEVELOPMENT 1. Introduction 1.1 Assignment Requirement 1.2 Deliverables and Structure (what to submit) 1.3 Software Restrictions 1.4 How to score high... 1.5 Assumptions 2. System Requirements 2. ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Assessment instructionsin this assessment you will design

Assessment Instructions In this assessment, you will design and code a simple Java application that defines a class, instantiate the class into a number of objects, and prints out the attributes of these objects in a spe ...

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

Simple order processing systemquestion given the classes

Simple Order Processing System Question: Given the classes Ship (with getter and setter), Speedboat, and SpeedboatTest. Answer the following questions: Refine the whole application (all classes) and create Abstract class ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As