Its an idea Solution
plz share Assignment,
1 – There are two (2) structures in a program named as Vehicle and Owner.
2 – Variables in Vehicle structure are;
Structure of Vehicle
Attribute Name Data Type Example
vehicle-type char 2 wheel, 3 Wheel, 4 wheel etc.
maker char Honda, Toyota, Suzuki etc.
year-of-manufacture int 2012 etc
engine-no char BR-29536 etc.
registration-no char LEV-0012 etc.
vehicle-price unsigned int 48000 etc.
3 – Variables in Owner structure are;
Structure of Owner
Attribute Name Data Type
owner-name char
father-name char
address char
date-of-purchase int
month-of-purchase int
year-of-purchase int
transferred-from char
4 – Make enumerator named as vehicle-class which has the value set given below. No vehicle is beyond these values.
• Motor Cycle
• Car
• Van
• Sports Car
• Pickup
• Truck
5 – vehicle-class enumerator should be in structure Vehicle.
6 – Instance / variable / object of Vehicle structure is passed in Owner structure.
7 – Initialize the variables in structures. (You may initialize them in structure / main function).
8 – When your program starts, the following lines are appeared on screen.
9 – There are three functions named as:
View
Transfer
Register
10 - These three functions take a single input parameter that is pointer to structure Owner. Functions have return type as void
11 – Handle the choice entered by user by Switch statement.
• If user enters 1 then function View is triggered.
• For option as 2, Transfer function is triggered.
• Option 3 trigger function Register.
• Any other input cause to terminate program.
12 – If user input is from 1 – 3 then your program, performs the required task shows result and then Clear the screen (clrscr () function is used to clear DOS screen. Function is in 'conio' header file) and then screen appears as in point 8, until unless users exit the program.
13 – Some Functions implementation details (functions in point 9)
Function View:
- It displays all information stored in Owner Structure. (Vehicle information is also included in Owner Structure)
Function Transfer:
- Sample Display Screen is provided below;
- You have to swap Owner Name and Transferred from then take input from user for the fields as in figure above.
- After that Clear the Screen and call View function to view all information in the structure as shown in Function View description in addition of displaying Transferred from name at the end.
Function Register:
- You have to take input of all variables in structure except Transferred from. (Registration is used for newly buy vehicle)
--
You received this message because you are subscribed to the Google Groups "Virtual University of Pakistan 2009" group.
To post to this group, send email to virtual-university-of-pakistan-2009@googlegroups.com.
To unsubscribe from this group, send email to virtual-university-of-pakistan-2009+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/virtual-university-of-pakistan-2009?hl=en.
No comments:
Post a Comment