Quote:

The amount of happiness that you have depends on the amount of freedom you have in your heart

Saturday 14 April 2012

CS410 Assignment 1 Spring 2012



Assignment No.  01
Semester: SPRING 2012
CS410 – VISUAL PROGRAMMING

Total Marks: 30

Due Date:
16 / 04 / 2012

Instructions
Please read the following instructions carefully before submitting assignment:
Feel free to ask your questions related to assignment 1 via e-mail at cs410@vu.edu.pk. No MDB related to assignment is answered and blocked.

It should be clear that your assignment will not get any credit if:

o        Assignment is submitted after due date.
o        Submitted assignment does not open or file is corrupt.
o        Submitted assignment file is not in required format.
o        Assignment is copied (From internet/ to from students).

Objective
To understand and revise basics of C / C++ Language.

Software (s) Used to develop Assignment
Dev C++

Assignment Submission Instructions
Ø  Assignment should be submitted in “VU-RollNo.cpp” format.
            e.g. MC123456789.cpp
Ø  You are not allowed to change given Variables Names, Types and Function Names.

Assignment

We are going to write a program of Vehicle Registration System. Follow the instructions / problem set below for 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)
-          Sample Display Screen is provided below;



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)
-          Sample Display Screen is provided below;



Deadline:
Your assignment must be uploaded on or before 16 / 04 / 2012.



No comments:

Post a Comment

“You can't change the past, but you can ruin the present by worrying about the future”