|
| 1 | +Q1.Employee payroll system |
| 2 | +Employee name. |
| 3 | +Employee ID |
| 4 | +Basic pay |
| 5 | +HRA |
| 6 | +TA |
| 7 | +DA |
| 8 | +Grade pay |
| 9 | +Deduction 5% from Basic pay |
| 10 | +Find the Gross pay, Net pay (Grade pay + deductions) and print all the details given |
| 11 | +above, using class and object of get () method and cal( )method. |
| 12 | + |
| 13 | +Q2.Student management system |
| 14 | +Student name |
| 15 | +Student id as inputs with marks for 5 Subjects, calculate and round of the subject |
| 16 | +marks to 10 and then find CGPA, Grade using object and class concept of oops |
| 17 | +Solve the above by creating a base class and derived class use inheritance to solve it. |
| 18 | + |
| 19 | +Q3. Instantiate the X class using self and then using self in the get () method and to |
| 20 | +achieve composition you can instantiate other objects in the class and then use those |
| 21 | +instances that Generate output of the total code which has both inheritance and composition. |
| 22 | + |
| 23 | +Q4.An Internet service provider has three different subscription packages for its |
| 24 | +customers: Package A: for $9.95/month, 10 hours of access are provided. Additional hours |
| 25 | +are $2.00/hour. Package B: for $14.95/month, 20 hours of access are provided. Additional |
| 26 | +hours are $1.00/hour. Package C: for $19.95/month, unlimited access is provided. |
| 27 | +Write a program using objects and classes that calculates a customer’s monthly bill. |
| 28 | +It should ask which package the customer has purchased and how many hours were |
| 29 | +used. It |
| 30 | +should then display the total amount due. |
| 31 | +Input validation: be sure the user only selects package A, B, or C. Also, the number |
| 32 | +of |
| 33 | +hours used in a month cannot exceed 744. |
| 34 | + |
| 35 | +Q5.Write a program using object-oriented concepts that calculates and displays a person’s |
| 36 | +body mass index (BMI). The |
| 37 | +BMI is often used to determine whether a person with sedentary lifestyle is |
| 38 | +overweight or underweight for his or her height. A person’s BMI is calculated with |
| 39 | +the following formula: |
| 40 | +BMI = weight * 703/height^2 |
| 41 | +where weight is measured in pounds and height is measured in inches. The program |
| 42 | +should display a message indicating whether the person has optimal weight, is |
| 43 | +underweight, or is overweight. A sedentary person’s weight is considered to be |
| 44 | +optimal if his or her BMI is between 18.5 and 25. If the BMI is less than 18.5, the |
| 45 | +person is considered to be underweight. If the BMI value is greater than 25, the |
| 46 | +person is considered to be overweight. |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
0 commit comments