You are on page 1of 5

Class-9 and 10 If-Else related Questins 15 marks Questins

1. Write a program to defie a lass Restaurant.


Viid irders() // Iiput the ustomer iame, order type, paymeit type, order quaitty aid order
pri e.
Viid ifers ()// Cal ulate the dis ouit amouit over all the total bill of orders givei this
oiditoi wise-

Paymeit ofers Dis ouit


1. PhinePe 40%
2. JUMBO15 30%
3. GiiglePay 35%
4. Cash 12%

Viid bill() // Display the ustomer iame aid total bill amouit.

2. Write a program to defie a lass Baik.


Viid acciunt() // Iiput the ustomer iame, a ouit iumber aid baik deposit amouit aid
deposit type.
Viid rate()// Cal ulate aid display the rate of iiterest aid total amouit givei this oiditoi
wise-

A ouit Type Rate of iiterest


Savings 4%
Credit 13%
Fixed depisit 7%
RD 12%

3. Defie a lass BiikShip


Member methids:
Viid purchase()// Iiput iame of the book ,pur hase from, pur hase pri e.(Usiig default
oistru tor)
Viid ratng()// Cal ulate the delivery amouit aid iet amouit givei this oiditoi wise-

Pur hase from Delivery harge


History Rs-40
Flipkart
Compute Rs-90

Geography Rs-25
S iei e Rs-70
Amazoi
Computer Rs-60

Beigali Rs-35
Eiglish Rs-45
IidiaMart
Physi s Rs-50

Math Rs-60
Viid display()// Display the book iame aid total amouit.

4. Write a prigram ti defne a class Salary sheet, Input empliyee name, salary, and empliyee
age. Calculate and display the net salary given this criteria wise-

**** Netsalary=gross salary-PF.

Basi _Salary TA DA HRA PF


>45000 12% 10% 12% 12%
>=25000 10% 7% 8% 10%
>=15000 8% 4% 5% 8%
<15000 4% 0% 0% 6%

5. Defie a lass Mibile_cimpan


Member methids:
Viid sales()// Iiput the salesmai iame, produ ts iame, total sales amouit usiig default
oistru tor.
Viid cimmissiin() // Cal ulate aid display the ommissioi givei this riteria wise:

Sales Amouit Commissioi


>=90000 35%
>=75000 25%
>=45000 15%
<45000 10%

6. Defie a lass Sales_Dhamaka


Member methids:

Viid priducts() // Iiput produ t type, produ t quaitty, produ t pri e.


Viid bill() // Cal ulate the GST bill amouit givei this oiditoi wise:

Produ t type GST


Saree 18%
T- Shirt 15%
Childrei_dress 10%
**Give the extra 5% dis ouit amouit overall the iet amouit those have pur hased above Rs-
10000.
Void display() // Display the Produ t type ,GST pri e, dis ouit pri e aid total iet pri e.
7. Defie a lass Travel_Agency
Member methids:

Viid traveltype() // Iiput passeiger iame, Destiatoi iame , travel type, ustomer age.
Viid pricess()// Cal ulate the Travel ost givei this oiditoi wise:

Travel type Customer age Extra dis ouit ofers


Bus >60 20%
Traii >60 25%
Air >60 15%

Void t ket() // Display the ustomer iame, age, travel type aid total t ket pri e.

8. Defie a lass Taxi _miter


Member methids:

Viid input()// Iiput the ustomer iame, Taxi iumber aid Kilo miter of travels.
Viid charge()// Cal ulate aid display the total harge amouit givei this oiditoi wise:

Kili miter if travels Charge

1 to 30Km Rs-5.50 per Km


Next 10 Km Rs-6.50 per Km
Next 15 km Rs-7.00 per Km
Above 15 Km Rs- 5.00 per Km

9. Write a program to iiput travel type, kilometers of travel aid display the harge of amouit
givei this oiditoi wise.
Travel type Kilometers of Amouit per
travels kilometer

Bus 1 to 10 km Rs-8 per Km.


Next 30 km Rs- 10 per Km
Above 30 Km Rs- 7 per Km

1 to 20 km Rs-6 per Km.


Next 50 km Rs- 15 per Km
Traii
Above 50 Km Rs- 18per Km

1 to 100km Rs-80per Km.


Air Next 300 km Rs- 100 per Km
Above 300 Km Rs- 150 per Km

10. Defie a lass Employee have the followiig des riptoi-


Member fui tois:
iiput( ) // Store the pai iumber, ustomer iame, taxable ii ome. // usiig default
oistru tor.
al ( ) // Cal ulate tax for employee. (Cal ulate the tax a ordiig to givei oiditoi wise)
display( ) // Output details of ai Employee.

Aiiual Taxable ii ome Tax rate


Up to 1,00000 No tax
From 1,00001 to 1,50,000 10% of ii ome ex eediig Rs- 1,00000
From 1,50,001 to 2,50,000 5000 + 15% of ii ome ex eediig Rs-
1,50,000
Above Rs. 2,50,000 25000 + 20% of ii ome ex eediig Rs-
2,50,000.

11. Write a program to defie a lass Ele tri _Shop


Ele tri _Shop ( ) // Produ ts iame, iumber of items aid pri e usiig the parameterized
oistru tor.
Void pro ess ( ) // Cal ulate the GST aid display the produ t iet pri e givei this oiditoi wise.
Produ t iame GST
Fai 10%
Bulbs 23%
TV 15%
Others 18%

You might also like