The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 304 Weeks Ago, 1 Day Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
Hello,
I have troubles with my homework. Could you help me with it? Th
1050 – Programming Logic
Lab 11
24 points total
Please paste your code into this word document and upload the word document. Please do not submit screenshots or a .zip file. If using OpenOffice, please save it as .doc or .docx before submitting to Blackboard.
1. Create a Vehicle class.
2. Add the following encapsulated fields/properties: (4 points)
string make, string model, string color, inttopSpeed, intcurrentSpeed, int direction, boolisMoving, string typeOfVehicle
3. Add three constructor methods: (6 points)
1) accept a parameter for typeOfVehicle. Set isMoving to false. Set make and model both to “Unknown”
2) accept parameters for make, model, color, typeOfVehicle. Set isMoving to false
3) accept parameters for make, model, color, typeOfVehicle, topSpeed. Set isMoving to false
4. Create 5 instances of Vehicle. Each should be a different type of vehicle (indicated by the string value for typeOfVehicle). You must use all of the constructor methods that you’ve created. (6 points)
5. Add a method called speedUp() and slowDown() that increase or decreases the speed by one respectively. (2 points)
6. Call speedUp() and slowDown() using loops for 1 of the objects in your test program to demonstrate the functionality. (4 points)
7. Create a method called ToString() that outputs all of the values – in sentence form – for your vehicle. Example: The [vehicleType] is a [color] [make] [model] and is currently going [currentSpeed] in the following direction: [direction]. It has a top speed of [topSpeed]. (2 points)
anks
Attachments:
----------- ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly