rendered paste body#include <iostream>
#include <iomanip>
using namespace std;
//istream& operator>> (istream& in, Vehicle& v)
//{
// cout<< "AUTOMOBILE:";
// cout<< "Enter the number of wheels and the engine horsepower >>> ";
// in >> v.wheels >> v.horsepower;
// cout<< "Enter the gross vehicle weight and vehicle fuel capacity >>> ";
// in >>v.weight >> v.fuel_tank_capacity;
// return in;
//}
class Automobile:public Vehicle
{
private:
double trunk_capacity;
public:
void settrunk_capacity(double tc){trunk_capacity=tc;)
double gettrunk_capacity()const{return trunk_capacity;}
friend ostream& operator<< (ostream cout, const Automobile&);
friend istream& operator<< (istream input, Automobile&);
};
istream& operator>> (istream& input, Automobile& A)
{
cout << "Automobile:" << endl;
cout << "Enter the number of wheels and the engine horsepower >>> ";
input >> A.wheels >> A.horsepower;
cout<< "Enter the gross vehicle weight and vehicle fuel capacity >>> ";
input >> A.weight >> A.fuel_tank_capacity;
input << static_cast<Vehicle> (A);
return input;
}
// istream& operator<< (istream& in, Automobile& A)
//{
// cout << "AUTOMOBILE:" << endl;
// in << static_cast<Vehicle> (A);
// //Vehical V;
// //in >> P;
// cout<< "Enter trunk capacity >>> ";
// in >>A.trunk_capacity;
// return in;
//}
//
//ostream& operator<< (ostream& out, const Automobile& A)
//{
//
// out << "AUTOMOBILE:" << endl;
// out << static_cast<Vehicle> (A);
// out<< "Enter trunk capacity >>> " >>A.trunk_capacity;
// return out;
//)
class Pickup_Truck:public Vehicle
{
private:
double trunk_capacity;
public:
void settrunk_capacity(double tc){trunk_capacity=tc;)
double gettrunk_capacity()const{return trunk_capacity;}
friend ostream& operator<< (ostream cout, const Pickup_Truck&);
friend istream& operator<< (istream imp, Pickup_Truck&);
};
istream& operator>> (istream& inp, Pickup_Truck& B)
{
cout << "Pickup Truck:" << endl;
cout << "Enter the number of wheels and the engine horsepower >>> ";
inp >> B.wheels >> B.horsepower;
cout<< "Enter the gross vehicle weight and vehicle fuel capacity >>> ";
inp >> B.weight >> B.fuel_tank_capacity;
inp << static_cast<Vehicle> (B);
return inp;
}
class Bus:public Vehicle
{
private:
double trunk_capacity;
public:
void settrunk_capacity(double tc){trunk_capacity=tc;)
double gettrunk_capacity()const{return trunk_capacity;}
friend ostream& operator<< (ostream cout, const Bus&);
friend istream& operator<< (istream in, Bus&);
};
istream& operator>> (istream& in, Bus& C)
{
cout << "BUS:" << endl;
cout << "Enter the number of wheels and the engine horsepower >>> ";
in >> C.wheels >> C.horsepower;
cout<< "Enter the gross vehicle weight and vehicle fuel capacity >>> ";
in >> C.weight >> C.fuel_tank_capacity;
in << static_cast<Vehicle> (C);
return in;
}