Skip to main content

cs304 Assimgt 2 2016




animatedLOGO
Assignment No. 02
Semester: Spring  2016
Object Oriented Programming – CS304

Total Marks: 20

Due Date: July 21, 2016

Objectives:
To get a hands on experience of using existing class as base class and implement inheritance.
Instructions:
Please read the following instructions carefully before submitting assignment:
It should be clear that your assignment will not get any credit if:

§  The assignment is submitted after due date.
§  The assignment is submitted via email.
§  The assignment is copied from Internet or from any other student.
§  The submitted assignment does not open or file is corrupt.
§  It is in some format other than .cpp (Code File).

Note: All types of plagiarism are strictly prohibited.

For any query about the assignment, contact at CS304@vu.edu.pk



Case Study
With the technological innovation, the world has become a global village which enables us to contact people living far away from us. Distances have shrunk and people use many courier services on daily basis to send and receive gifts/letters/parcels. One of the popular courier services in Pakistan is XYZ which delivers your parcels nationally and internationally. Every parcel that is mailed by XYZ has some cost and weight associated with it. Parcels can be divided into two sub-classes based on their priority as urgentParcel and normalParcel. XYZ uses its own packaging to ship every parcel depending on the type i.e. urgentParcels, normalParcels. Parcel with urgentParcels type has some additional cost associated with it.

In this second iteration you are required to modify existing application (developed in assignment 1) so that it should be able to handle two different types of parcels called normal and urgent parcels. Now normal parcel has one specialized attribute i.e. Per-gram charges for overweight (this value will be entered by user)
All other attributes will be inherited from “Parcel” class.
The formula to calculate total charges will be:

Total-charges = Basic Charges

However, if weight is greater than 900g, then:

Total charges = Basic Charges + (Per-gram charges for overweight * overweight)

Note: overweight = Total weight – 900. for weight greater than 900 (as 900 grams is the minimum limit)




Similarly urgent parcel has two specialized attributes i.e. Per-gram charges for overweight (this value will be entered by user) and Urgent service charges per gram for overweight (this value will be entered by user)

The formula to calculate total charges will be:

Total charges =  (Basic Charges + (50% of basic charges for urgent service))

However, if weight exceeds the minimum limit of 900grams, then total charges will be calculated as follows:

Total charges =  (Basic Charges + (50% of basic charges for urgent service)) + ((Per-gram charges for overweight + Urgent service charges per gram)* overweight)

Description of attributes:

Basic Charges: Minimum charges for parcel if weight does not increase from our limit. In parcel class it is used as “fee data member.
Per-gram charges: It is for both normal and urgent parcels. It is represented by “feePerGram data member in NormalParcel and UrgentParcel classes (as given in code description below). These charges will apply when weight will exceed from 900 grams.
Per-gram urgent service charges: It is for urgent parcel only. It is represented by “additionalFeePerGram data member in UrgentParcel class (as given in code description below). These charges will apply in case of urgent service when weight exceed from 900 grams limit.
50% of basic charges for urgent service: These charges will apply in case of urgent service in all cases (i.e. either weight exceeds 900grams or not)
Note that in case of urgent service, if weight limit exceeds, both “Per-gram charges” and “Per gram urgent service charges” will be applicable whereas in case of normal service only “Per-gram charges” is applied.

Problem Statement:
Develop an application in C++ that should allow the user of application to enter the receipt number, sender name, sender address, receiver name, receiver address, parcel weight, shipment basic charges, fee per gram and additional fee per gram of parcel (in case of urgent). Default weight limit without extra charges is 900 grams. After getting required information generate a shipment receipt and display on console screen.
To develop the application you need to create classes with data member and member function as given below.


1. Class NormalParcel:
Attributes or Data Members:
Id:int
senderName:string
senderAddress:string
receiverName:string
receiverAddress:string
weight:int
fee:int
feePerGram:int
Methods/Operations/Getters/Setters:
Getter and setter functions of all data members
Constructor and Destructor
2. Class UrgentParcel:
Attributes or Data Members:
Id:int
senderName:string
senderAddress:string
receiverName:string
receiverAddress:string
weight:int
fee:int
feePerGram:int
additionalFeePerGram:int
Methods/Operations/Getters/Setters:
Getter and setter functions of all data members
Constructor and Destructor


Hint: Use your exiting parcel class which can reduce the code of our new classes. Lots of implementation is already given in parcel class. While inheriting NormalParcel and UrgentParcel classes from Parcel class use only public inheritance.
Note: It is compulsory to inherit from exiting parcel class which you made in first assignment. Parcel class code which we made in first assignment is attached with this assignment. You can use our provided Parcel class or you can also use your created Parcel class.
Any student who will not implement new requirement without inheritance or will not use Parcel class from assignment no. 1 will get zero marks.
You will have to handle only feePerGram data member for NormalParcel class and feePerGram & additionalFeePerGram for UrgentParcel class. Other data members are already implemented in Parcel class of assignment no. 1. You can use this class to implement solution of current assignment.
Cheating cases will be treated strictly. No laim excuses will be accepted.
Sample Output:
For sample output watch “sample output demo.gif” video attached with assignment.

BEST OF LUCK




                   Click To download

Comments

Post a Comment

Popular posts from this blog

cs302 Solved Quiz

estion # 1 of 10 ( Start time: 03:03:55 PM )  Total Marks: 1    Divide-by-32 counter can be acheived by using   Select correct option:   Flip-Flop and DIV 10  Flip-Flop and DIV 16   Flip-Flop and DIV 32  DIV 16 and DIV 32 Question # 2 of 10 ( Start time: 03:05:20 PM )  Total Marks: 1   The counter states or the range of numbers of a counter is determined by the formula. (“n” represents the total number of flip-flops)   Select correct option:   (n raise to power 2)  (n raise to power 2 and then minus 1)  (2 raise to power n) (2 raise to power n and then minus 1) Question # 3 of 10 ( Start time: 03:06:36 PM )  Total Marks: 1   A 4- bit UP/DOWN counter is in DOWN mode and in the 1010 state. on the next clock pulse, to what state does the counter go?   Select correct option:   1001  1011  0011  1100 Question # 4 of 10 ( Start time: 03:07:37 PM )  Total Marks: 1   A 4-bit binary UP/DOWN counter is in the binary state zero. the next state in the DOWN mode is

Mth621 Final term paper sept 2020

  Mth 621 paper Practise queation ma sa 80% aya : 3nu quizes ma sa sary mcqs ay Objective bi 30 aur subjective bi 30 k tha total 60 marks k paper tha Subjective total chap3 aur chap 4 ma say tha Subjective almost practise question ma sa tha Mcqs 80% quizes ma sa thay G therorem bi aik 2 to zehn ma ni a rhy 621 theorem on bounded set theorem on reman integral mean value theirem limit chain rule integaration 621 k saare mcq old quizes m se aye #Mth621 Mcqs were based on concepts and 6,7 was from mcqs file of quizz. 1-Define Removeavle continuity? 2 marks 2-Deifine chain rule for composition of functions? 2 marks 3-Define Second mean theorem of Integration? 4- Find uniform continuity of 2x? 5- A theorem was from Monotonic Function? 5 marks 6-evaluate lim->0 ln sinx/ln x?? 7- and Rest two was from the last 5th chp of about integration on closed interval. Mcqs zyada quiz mai sy thy evaluate lim->0 ln sinx/ln x?? Find uniform continuity of 2x? generalized mean value the

UniVERSITY VIRTUAL CAMPUSES & Contact #

UniVERSITY VIRTUAL CAMPUSES VU OWN CAMPUSES Sr # Province City Code Details 1    BALOCHISTAN PISHIN VPSN01 Virtual University Campus, Pishin Killi Malik Abdul Razzaq, Pishin Phone:   0826-442275 Fax:   - Email:   vpsn01@vu.edu.pk ,   vpsn01@vu.edu.pk   2    CAPITAL ISLAMABAD VIBD01 Virtual University Campus, Islamabad 9-E, Rizwan Plaza, Blue Area, Islamabad. Phone:   051-9213476 Fax:   NA Email:   vibd01@vu.edu.pk ,   vibd01@vu.edu.pk   3    KHYBER-PAKHTUNKHWA PESHAWAR VPSW01 Virtual University Campus, Peshawar 8-Jamrud Road, P.O. Tehkal Bala, Adjacent Toyota Froniter Motors, Peshawar. Phone:   091-5701071, 5705994 Fax:   091-5711381 Email:   vpsw01@vu.edu.pk ,   vpsw01@vu.edu.pk   4    PUNJAB D.G. KHAN VDGK01 Virtual University Campus, D.G. khan Sakhi Sarwar Road, Old D.D.A. Building, Near Pul Dat, D.G. Khan. Phone:   064-2000919, 2472813 Fax:   - Email:   vdgk01@vu.edu.pk ,   vdgk01@vu.edu.pk