using System;
namespace Vehicle
{
public class Car
{
string color;
string engine;
int housePower;
string fuel;
int fuelLever;
string manufacturedYear;
public static int levelNumber=0;
public addFuel()
{
levelNumber=levelNumber+1;
}
}
public class Driver
{
int age;
string name;
string licenseNumber;
public static int totalCount=0;
public getName()
{
cin >> name;
}
public displayName()
{
count<<"Name of the Driver:"<<name;
}
public Display()
{
for( int i=0; i<5; i++ )
{
cout << "Driver " << i
+ 1 << endl;
dr[i].displayName();
}
}
public changeSize()
{
Driver dr[10];
}
public Driver()
{
totalCount=totalCount+1;
count<<" Total Count"<< totalCount;
}
}
int main
{
Driver driver1,driver2;
Car car1;
cr1.addFuel();
Driver::Driver();
Driver::changeSize();
Driver:display();
Driver dr[5];
for( int i=0; i<5; i++ )
{
cout<< "Driver " << i +
1 << endl;
cout<< "Enter name" <<
endl;
dr[i].getName();
}
for( int i=0; i<5; i++ )
{
cout << "Driver " << i
+ 1 << endl;
dr[i].displayName();
}
}
delete[] dr;
}
c++ driver and car are independed classes 1. Create a class Car, which has a color, engine, horsepower, fuel, FuelLevel, year of manufacturing and driver which can be defined by name, age, licen...
About Classes and OOP in C++ Part 1 Task 1: Create a class called Person, which has private data members for name, age, gender, and height. You MUST use this pointer when any of the member functions are using the member variables. Implement a constructor that initializes the strings with an empty string, characters with a null character and the numbers with zero. Create getters and setters for each member variable. Ensure that you identify correctly which member functions should...
please Code in c++ Create a new Library class. You will need both a header file and a source file for this class. The class will contain two data members: an array of Book objects the current number of books in the array Since the book array is moving from the main.cc file, you will also move the constant array size definition (MAX_ARR_SIZE) into the Library header file. Write the following functions for the Library class: a constructor that initializes...
using C++
Requirements: . Classes you must create o Monster must be an abstract class Each monster has . an attack) o randomly generate a number between 0 and strength for each attack (Strength 10 would generate 0-10) add up all the damage done return total damage o o e a number of attacks . a number for strength used during attacking . a string representing the type » accessor for type o Goblin inherits from Monster type is "Goblin"...
Help C++ Write a string class. To avoid conflicts with other similarly named classes, we will call our version MyString. This object is designed to make working with sequences of characters a little more convenient and less error-prone than handling raw c-strings, (although it will be implemented as a c-string behind the scenes). The MyString class will handle constructing strings, reading/printing, and accessing characters. In addition, the MyString object will have the ability to make a full deep-copy of itself...