Vous êtes sur la page 1sur 4

# Assessment Brief

## Course Title: HND Computing

Unit Name: Object Oriented Programming

## Assessment Title: Use basic object oriented programming concepts

Assessment Method: Report + Implementation
Assessing in: Group of 2
Number of words: Maximum 35 pages
Outcome covered: 1

## Issue Date: April 23, 2009

Due Date: May 10, 2009

## College No Learner Name Learner Signature

Learner’s Declaration: I confirm that the work submitted for this assignment is my own.

Date:

2. Outcome Covered

Outcome Description
1 Use basic object oriented programming concepts

3. Purpose and Aim
The aim of this assignment is to provide a learner an opportunity to apply
the knowledge and skills gained in class to analyze and design a real world
object oriented solution to the problems.

4. Scenarios
Apply Object Oriented concepts and solve all the given problems.

## Imagine a tollbooth at a motorway. Cars, trucks, coasters, wagons, containers and

oil tankers are passed from this booth. When cars, wagons and coasters are passed
they pay Rs100/- and when trucks, containers and oil tankers are passed they pay
Rs 200/-. Keep the record that how many cars, wagons, coasters, containers,
trucks and oil tankers are passed and how much total money is collected for one
day.
Model this tollbooth with a class. Design the data members that hold the total no
of cars, wagons, coasters, trucks, containers and oil tankers are passed and a data
member that hold the total amount of money. Finally design the member functions
that will perform the function of counting and totaling of money.
Cars, coasters, wagons =100
Containers, trucks, oil tankers =200
in one day total number of cars
…………………………... coasters
…………………………… wagons
…………………………… containers
…………………………… trucks
…………………………… oil tankers
Total amount of cars
……………..coasters
……………..wagons
……………..containers
…………….. trucks
………………oil tankers

## 4.2 Problem No.2

Design a class that holds the data member to record the input in the form of 7/9
from the user and output is also in the same form. Design the member functions
that will add the two fractions and also subtract the two fractions.
Write a main program that allows the use to input the two fractions repeatedly and
then display their sum and difference.

Hints:
a / b + c / d = (a*d + b*c) / (b*d)
a / b - c / d = (a*d – b*c) / (b*d)
Calculate the fowling
7/9 + 6/5 =

3/5 + 7/2 =

Objects
1st object as function
2nd object as argument
3rd object as result
Or
2 object as argument And one for storage of result

## 4.3 Problem No.3

class employee
{
private:
char name[30];
long num;
public:
void get()
{
cin>>name;
cout<<”\n Enter employee number:”;
cin>>num;
}
void show()
{
cout<<”\n Name is: “<<name;
cout<<”\n Employee number is: “<<num;
}
};
Derive a class employee2 from the employee class. This new class adds an item that
holds the pay or compensation and indicates the period like hourly, weekly or monthly.
Now derive the classes manager, scientist, foreman, personal assistant and dispatcher
from employee and empoyee2. Set the derived classes to read particular data about
particular employee. Write the main function that read data about employees and show all
Employee 2
Pay
Hourly, weekly
Manager, scientist, foreman, PA, dispature.
• Create a class for each of the given problem.
• Identify the data members and member function clearly.
• In problem no.3 apply the inheritance.

## P Identify the various elements M Use UML for

# in object based program for # identification of
1 any two problems 1 various elements.

## P Develop the client side M Use standard coding

# program by using object # notations
2 oriented programming 2
concepts

General Instructions:

• The copy of this assignment brief should attach with report as annexure.
• The group meetings minutes should attach with this report.
• The call of meeting and agenda of meeting should be attached with report.
• Books, online resources and lecture material can be used for writing the report.
• Proper reference should be given in the Harvard Style.
• The college has strict penalty for plagiarism and the assignment will be cancelled
if the assignment is observed for this.