Please carefully read the
following instructions before attempting assignment.
RULES FOR MARKING It should be
clear that your assignment would not get any credit if: § The assignment is submitted after the due date. § The submitted assignment does not open or
file is corrupt. § Strict action will
be taken if submitted solution is copied from
any other student or from the internet.
You should
consult the recommended books to clarify your concepts as handouts are not
sufficient.
You are supposed to submit
your assignment in .doc or docx format. Any other
formats like scan images, PDF, zip, rar, ppt and bmp etc will not be
accepted.
Objectives: ·
To understand the concepts of computer programming. ·
To learn the use of basic instructions in C/C++
for input and output. ·
To learn the use of user defined data structures
in C/C++. |
NOTE
No assignment will be accepted after the due date
via email in any case (whether
it is the case of load shedding or internet malfunctioning etc.). Hence
refrain from uploading assignment in the last hour of deadline. It is
recommended to upload solution file at least two days before its closing
date.
If you find any mistake or confusion in assignment (Question
statement), please consult with your instructor before the deadline. After the deadline no queries will be entertained in this regard.
For any query, feel free to email at: cs101@vu.edu.pk |
Assume you own a
car garage and want to maintain the log of the cars that are available in your
garage. A car can be distinguished from other cars by the following attributes:
i.
Car-Name
ii.
Model
iii.
Vendor
iv.
Horse-Power
v.
Price
vi.
Owner-ID (Use your Student VUID here
in the program)
Your goal is
to develop a C++ program that implements a data structure named “Car” (user- defined data type) for the
given scenario. Your program must have the following:
1.
Define data structure named “Car” with all the above mentioned attributes.
2.
Define appropriate variables
within the data structure to store the above mentioned attributes.
3.
Take input from user for all
attributes for a single car as given in the diagram below and store them in a
“car” variable.
4.
Display the Car information on screen as
shown in the output diagram below.
Write your code in a compiler
application and run it to generate the output. After that copy your code and paste it into a
Microsoft Word document (your solution file). Also, take a screenshot of your
program’s output and paste it into the solution file along with the code.
Note:
·
Your solution file must be a Microsoft Word document
(in .doc or .docx file extension).
·
You can use any online or
offline C++ compiler like DevC++, C Free, Visual Studio for writing your code for the assignment solution. Few links for the online compilers
are given below:
https://www.onlinegdb.com/online_c++_compiler https://www.w3schools.com/cpp/cpp_compiler.asp
·
Solution file must contain
both code and
the output screenshot of your code. No marks will be awarded if any
of these is found missing in your solution file.
·
You must use your VUID as
input for the Owner-ID attribute in this program. It is mandatory to use Student VUID in the program and No marks will be
awarded if you use any other
information or general information for the Owner ID.
Solution:
For Paid Assignment. Ready in MS Word Click below
http://api.whatsapp.com/send?phone=+923175751690
Code:
#include <iostream>
#include <cstdlib>
using namespace std;
int main(){
char
Car_Name[50], Car_Vendor[50], Car_Owner_ID[50];
int
Car_Model, Car_Horse_Power, Car_Price;
cout<<"Enter
the car Name: ";
cin>>Car_Name;
cout<<"Enter
the car Model: ";
cin>>Car_Model;
cout<<"Enter
the car Vendor: ";
cin>>Car_Vendor;
cout<<"Enter
the car Horse Power: ";
cin>>Car_Horse_Power;
cout<<"Enter
the car price: ";
cin>>Car_Price;
cout<<"Enter
the car Owner ID: ";
cin>>Car_Owner_ID;
cout<<"Values
are stored in car variable: ";
cout<<"\n\n";
cout<<"THe
store Vehicle information is: "<<endl;
cout<<"Name:
"<<Car_Name<<endl;
cout<<"Model:
"<<Car_Model<<endl;
cout<<"Vendor:
"<<Car_Vendor<<endl;
cout<<"Engin
Power: "<<Car_Horse_Power<<endl;
cout<<"Price:
"<<Car_Price<<endl;
cout<<"Owner
ID: "<<Car_Owner_ID<<endl;
}
Output Screenshot:
Download Question File and Solution
Get Paid Services (Word Ready File)
Want more info, please press the below button
`
0 Comments
Please write us. Please write in detail that how may we help you