0% found this document useful (0 votes)
49 views

Lab-6 Exercises:: Course Title: Lab-6 Programming Fundamentals Nested If Else & Switch Case Statements

This document provides instructions for 5 programming exercises involving nested if/else and switch case statements. The exercises include: 1) calculating total bill and discount for customer purchases over Rs. 5,000, 2) determining profit or loss based on cost and selling price of an item, 3) calculating employee gross salary based on salary tiers that determine allowances, 4) calculating library late fees based on number of late days, and 5) determining insurance eligibility for software developers based on marital status, gender and age.

Uploaded by

Fawadajmal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

Lab-6 Exercises:: Course Title: Lab-6 Programming Fundamentals Nested If Else & Switch Case Statements

This document provides instructions for 5 programming exercises involving nested if/else and switch case statements. The exercises include: 1) calculating total bill and discount for customer purchases over Rs. 5,000, 2) determining profit or loss based on cost and selling price of an item, 3) calculating employee gross salary based on salary tiers that determine allowances, 4) calculating library late fees based on number of late days, and 5) determining insurance eligibility for software developers based on marital status, gender and age.

Uploaded by

Fawadajmal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

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.

Gross Salary = Basic Salary + Rental Allowance + Dining Allowance

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:

If the software developer is married.


If the software developer is unmarried, male & above 28 years of age.
If the software developer is unmarried, female & above 22 years of age.

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.

College of Computing & Information Sciences 44

You might also like