Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

- This time, I would be expecting that you will have programs in *.cpp files and optional *.h files in your zipped folders (not *.txt or *.docx). Below are what are needed for the Assignment 2c:- two...

1 answer below »
- This time, I would be expecting that you will have programs in *.cpp files and optional *.h files in your zipped folders (not *.txt or *.docx).

Below are what are needed for the Assignment 2c:- two programs in C++ files (saved as *.cpp or *.h) for Module 4.1 activities
- two programs in C++ files (saved as *.cpp and/or *.h) for Module 4.2 activities

Please send in the "Assessment 2c - Submission" and attach it as a zip file. Please use the naming convention MIS501_T2_ Asessement_2c.zip like MIS501_T2_Infante_William_Asessement_2c.zip

activities 4,1 4.2 need to be done attached below
Answered Same Day Aug 23, 2021

Solution

Subhajit answered on Aug 27 2021
156 Votes
Assessment 2c - Submission/a.exe
Assessment 2c - Submission/A4.1Q1.cpp
#include #include using namespace std;
class Car {
private:
string strColour;
string strBrand;
float fltFuelTankCapacity;
int intOdometerReading;
int speed;
public:
void start();
void accelerate();
void
ake();
void stop();
void setColour(string);
void setBrand (string);
void setFuelTankCapacity(float);
void setOdometerReading(int);
string getColour();
string getBrand();
float getFuelTankCapacity();
int getOdometerReading();
int getSpeed();
Accesso
void setSpeed(int);
mutato
};
void Car::start() {
setSpeed(0);
return;
}
void Car::accelerate( ) {
int accelerateCarBy;
cout
"Accelerate the car by"
endl;
cin
accelerateCarBy;
setSpeed(accelerateCarBy);
return;
}
void Car::
ake() {
int decelerateCarBy;
cout
"decelrate the car by"
endl;
cin
decelerateCarBy;
setSpeed(-decelerateCarBy);
return;
}
void Car::stop() {
eturn;
}
void Car::setColour(string strTempColour) {
strColour = strTempColour;
eturn;
}
void Car::setBrand(string strTempBrand) {
strBrand = strTempBrand;
eturn;
}
void Car::setFuelTankCapacity(float fltTempCapacity) {
fltFuelTankCapacity = fltTempCapacity;
eturn;
}
void Car:: setOdometerReading(int intTempOdometerReading) {
intOdometerReading = intTempOdometerReading;
eturn;
}
string Car::getColour() {
eturn strColour;
}
string Car::getBrand() {
eturn strBrand;
}
float Car::getFuelTankCapacity() {
eturn fltFuelTankCapacity;
}
int Car::getOdometerReading() {
eturn intOdometerReading;
}
int Car:: getSpeed()
{
return speed;
}
void Car::setSpeed(int givenSpeed)
{
speed+=givenSpeed;
if(speed<0)
speed=0;
}
int main() {
Car myCar;
myCar.setColour("Red");
myCar.setBrand("Fe
ari");
myCar.setFuelTankCapacity(70.0);
myCar.setOdometerReading(47876);
myCar.start();
myCar.accelerate();
myCar.
ake();
myCar.stop();
cout
"Colour:"
myCar.getColour()
endl;
cout
"Brand: "
myCar.getBrand()
endl;
cout
"Tank: "
myCar.getFuelTankCapacity()
endl;
cout
"Odometer: "
myCar.getOdometerReading()
endl;
cout
"Cu
ent...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here