Cs101 Assignment02

You might also like

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

Student Id: BC220206030

Computer Science 101 Assignment 02:

Code:

------------------------------------------------------------------------------------------------------------------------------------------

#include <iostream>

#include <string>

/* run this program using the console pause 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 argec , char** argv)

car obj;

cout<<"Enter Car Name:";

cin>>obj.Car_Name;

cout<<"Enter Car Model:";

cin>>obj.Model;

cout<<"Enter Vendor Name:";

cin>>obj.Vendor;

cout<<"Enter Car Horse Power:";


cin>>obj.Horse_Power;

cout<<"Enter Car Price:";

cin>>obj.Price;

cout<<"Enter car's owner Id:";

cin>>obj.Owner_Id;

cout<<"Values are stored in Car variable"<<endl;

cout<<"The Stored Vehicle Information is:"<<endl;

cout<<"Name:"<<obj.Car_Name<<endl;

cout<<"Model"<<obj.Model<<endl;

cout<<"Vendor"<<obj.Vendor<<endl;

cout<<"Horse_Power"<<obj.Horse_Power<<endl;

cout<<"Price"<<obj.Price<<endl;

cout<<"Owner_Id"<<obj.Owner_Id<<endl;

return 0;

Code Working Screenshot :

You might also like