Assessment Brief 1. Unit and Assessment Details: College No Learner Name Learner Signature
Assessment Brief 1. Unit and Assessment Details: 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
4. Scenarios
Apply Object Oriented concepts and solve all the given problems.
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:
For Addition:
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
class employee
{
private:
char name[30];
long num;
public:
void get()
{
cout<<”\n Enter your name: “;
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
record about the employees.
Employee 2
Pay
Hourly, weekly
Manager, scientist, foreman, PA, dispature.
5. Tasks
• Create a class for each of the given problem.
• Identify the data members and member function clearly.
• In problem no.3 apply the inheritance.
6. Grading Criteria
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.