subject

Write a class named car that has the following fields: yearmodel. the yearmodel field is an int that holds the car's year model make. the make field references a string object that holds the make of the car speed. the speed field is an int that holds the car's current speed in addition, the class should have the following constructor and other methods: constructor. the constructor should accept the car's year model and make as arguments. these values should be assigned to the object's yearmodel and make fields. the constructor should also assign 0 to the speed field. accessors. appropriate accessor methods should get the values stored in an object's yearmodel, make, and speed field. accelerate. the accelerate method should add 5 to the speed field each time it is called brake. the brake method should subtract 5 from the sped field each time it is called. demonstrate the class in a program that creates a car object, and then calls the accelerate method five times. after each call to the accelerate method, get the current speed of the car and display it. then call the brake method five times. after each call to the brake method, get the current speed of the car and display it.*/

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 09:30
You have been supporting csm tech publishing's windows server 2016 server network for over a year. the office has two windows server 2016 servers running active directory and a number of other roles. management has informed you that a small sales office is opening in the same building three floors up. the sales manager wants to install a sales application on a server located in the sales office. this server will have limited physical security because there's no special room dedicated for it, which means it will be accessible to non-it personnel and visitors. you're considering installing windows server 2016 server core on the new server because accessing its console regularly probably won't be necessary, and this server will be managed from one of the other csm tech publishing servers. what are the benefits and drawbacks of using server core for this branch office? what are some things you should do to set up this server management environment?
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
When writing a business letter, how many times can you use the same merge field in a document? once once, unless using the address block feature unlimited it will depend on the type of document you choose
Answers: 1
question
Computers and Technology, 25.06.2019 05:10
Write a program that asks for 'name' from the user and then asks for a number and stores the two in a dictionary (called 'the_dict') as key-value pair. the program then asks if the user wants to enter more data (more data (y/n)? ) and depending on user choice, either asks for another name-number pair or exits and stores the dictionary key, values in a list of tuples and prints the list. note: ignore the case where the name is already in the dictionary. example: name: pranshu number: 517-244-2426 more data (y/n)? y name: rich number: 517-842-5425 more data (y/n)? y name: alireza number: 517-432-5224 more data (y/n)? n [('alireza', '517-432-5224'), ('pranshu', '517-244-2426'), ('rich', '517-842-5425')]
Answers: 3
question
Computers and Technology, 25.06.2019 12:30
Why is outfitting a workspace with video games in technology development company considered a strategic use of money
Answers: 2
You know the right answer?
Write a class named car that has the following fields: yearmodel. the yearmodel field is an int tha...
Questions
question
Mathematics, 16.04.2020 01:05
question
Mathematics, 16.04.2020 01:06
Questions on the website: 13722361