Lab-6 Exercises:: Course Title: Lab-6 Programming Fundamentals Nested If Else & Switch Case Statements
Lab-6 Exercises:: Course Title: Lab-6 Programming Fundamentals Nested If Else & Switch Case Statements
Lab-6 Exercises:
1. At IMTIAZ SUPER STORE, while purchasing certain items, customer gets a discount of 10% only if
the quantity of all purchased items is more than Rs. 5,000. If Quantity and price per item are
input through the keyboard, write a program to calculate the total bill.
2. If Cost Price and Selling Price if an item is input through the keyboard, write a program
to that tells seller is at profit or loss? Further, it should ask user to enter ‘c’ if s/he wants
to know how much profit or loss seller incurred.
3. In a company an employee is paid as: If Basic Salary of employee is less than Rs. 15,000,
then Rental Allowance = 10% of Basic Salary and Dining Allowance = 90% of Basic Salary.
If his salary is either equal to or above Rs. 15,000 but less than Rs. 20,000 then Rental
Allowance = Rs. 500 and Dining Allowance = 98% of Basic Salary. Write a program such
that, if the employee’s salary is input through the keyboard write a program to find his
Gross Salary.
4. A library charges a fine for every book returned late. For first 5 days the fine is 50 Rs, for
6-10 days fine is 100 rupee and above 10 days fine is 150 rupees. If you return the book
after 30 days your membership will be cancelled. Write a program to accept the number
of days the member is late to return the book and display the fine or the appropriate
message.
5. Team nascent innovations is a software house that insures its software developers in
the following cases:
In all other cases, the software developer is not insured. If marital Status, gender and
age of the software developer are user-defined, write a program to determine whether
the software developer is to be insured or not.