-
Notifications
You must be signed in to change notification settings - Fork 18
/
Day1Assignemnt.txt
33 lines (21 loc) · 1.17 KB
/
Day1Assignemnt.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
1. Exercise Objective(s): Conditional statements, Loops
Exercise: A shopkeeper sells three products whose retail prices are as follows:
Product 1 - 22.50
Product 2 - 44.50
Product 3 - 9.98
Write an application that reads a series of pairs of numbers as follows:
a) Product number
b) Quantity sold
The application should use a switch statement to determine the retail price for each product. It
should calculate and display the total retail value of all products sold.
Recommended duration: 20Mins
Solution Guidance (if applicable): NA
2.Lab Exercise No:39
Exercise Objective(s):Polymorphism
Exercise:Create a class called Worker. Write classes DailyWorker and SalariedWorker that inherit from
Worker.Every worker has a name and a salaryrate. Write method Pay (int hours) to compute
the week pay of every worker. A Daily worker is paid on the basis of the number of days
she/he works.The salaried worker gets paid the wage for 40 hours a week no matter what the
actual hours are. Test this program to calculate the pay of workers.
Recommended duration: 20 Mins
Solution Guidance (if applicable): NA