subject

Design a class named Car that has the following fields:
year Model: an int instance variable that holds the car’s year model.
make: a string instance variable that holds the make of the car.
speed: an int instance variable that holds the car’s current speed.
In addition, the class should have the following methods.
Constructor 1: no-arg constructor set the yearModel, make and speed to 2000, Nissan and 4, respectively.
Constructor 2: this is an overloaded constructor. This constructor should accept the car’s year model, speed, and make as arguments. These values should be assigned to the object’s yearModel, speed and make fields.
Accessor (getters): appropriate accessor methods to get the values stored in an object’s yearModel, make, and speed fields.
Mutator (setters): appropriate mutator methods to store values in an object’s yearModel, make, and speed fields.
toString: returns a string describing the object’s yearModel, make and speed.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:00
Check my work the microprocessor is a(n) circuit, which is designed to process data based on a set of instructions. most desktop and laptop devices contain a microprocessor based on the standard. most tablets and smartphones contain processors based on technology. a microprocessor's circuitry is designed to perform a limited number of tasks contained in its set. during processing, an instruction is loaded into the processor's unit. data is loaded into registers in the processor's where arithmetic and logic operations are performed. microprocessor performance can be measured by its speed. other factors affecting overall processing performance include word size, cache size, and instruction set complexity. most digital devices contain only one microprocessor chip, but today's multi- processors contain circuitry that supports parallel processing. computers contain various kinds of memory. random memory is a special holding area for data, program instructions, and the system. it stores data on a temporary basis until the processor makes a data request. ram is different from disk storage because it is , which means that it can hold data only when the computer power is turned on. computers also contain read- memory, which is a type of non-volatile memory that provides a set of "hard-wired" instructions, called the loader, that a computer uses to boot up.
Answers: 3
question
Computers and Technology, 23.06.2019 13:00
Which one of the following voltages should never be measured directly with a vom? a. 1200 v b. 500 v c. 800 v d. 100v
Answers: 2
question
Computers and Technology, 23.06.2019 20:30
If an appliance consumes 500 w of power and is left on for 5 hours, how much energy is used over this time period? a. 2.5 kwh b. 25 kwh c. 250 kwh d. 2500 kwh
Answers: 1
question
Computers and Technology, 25.06.2019 03:00
Match the categories in the first column with examples in the second column. 1. good for watching movies 2. maximum power with small size 3. older style mobile devices that may or may not have internet connectivity tablet computer a.)pda b.)smart phone c.)tablet computer
Answers: 1
You know the right answer?
Design a class named Car that has the following fields:
year Model: an int instance variable t...
Questions
question
Mathematics, 22.09.2020 14:01
question
Mathematics, 22.09.2020 14:01
Questions on the website: 13722361