Assignment No 2 CS101

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Assignment No: 2

Student ID: 200401796


Subject: CS101

Code :

#include <iostream>
#include <string>

/* run this program using the console pauser or add your own getch,
system( "pause" ) or input loop */
using namespace std;
struct car
{ string Car_Name;
int Model;
string Vendor;
int Horse_Power;
double Price;
string Owner_ID;

};
int main(int argc, char** argv)

{
car obj;
cout<<" Enter Car Name: ";
cin>>obj.Car_Name;
cout<<" Enter Car Model: ";
cin>>obj.Model;
cout<<" Enter Car Vendor :";
cin>>obj.Vendor;
cout<<" Enter Car Horse Power :";
cin>>obj.Horse_Power;
cout<<" Enter Car Price :";
cin>>obj.Price;
cout<< "Enter Car Ownder_ID :";
cin>>obj.Owner_ID;
cout<<"Values are stored in Car Variable. "<<endl;
cout<< "\nThe stored Vehicle Information is: "<<endl;
cout<<"Name: "<<obj.Car_Name<<endl;
cout<<"Model: "<<obj.Model<<endl;
cout<<"Vendor: "<<obj.Vendor<<endl;
cout<<"Price: "<<obj.Price<<endl;
cout<<"Engine Power:"<<obj.Horse_Power<<endl;
cout<<"Owner ID: "<<obj.Owner_ID;

return 0;
}

You might also like