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

Assignment 3

The document outlines 6 programming assignments for a Programming Fundamentals course, including creating programs to calculate medical bills, mobile phone prices, profit on bank deposits, eligibility for college admission, BMI calculations, and blood pressure categories. It provides details of the input and output required for each program. Students are asked to complete the assignments using different programming approaches like if/else statements and switch cases.

Uploaded by

Saqlain Sandhu
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views

Assignment 3

The document outlines 6 programming assignments for a Programming Fundamentals course, including creating programs to calculate medical bills, mobile phone prices, profit on bank deposits, eligibility for college admission, BMI calculations, and blood pressure categories. It provides details of the input and output required for each program. Students are asked to complete the assignments using different programming approaches like if/else statements and switch cases.

Uploaded by

Saqlain Sandhu
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Course: Programming Fundamental (CS-323) Teacher: AZHAR JAMIL

Semester: 1 Assignment Number 3


Spring 2019 Total Marks: 120
(6*20)

Name _______________________________

Reg # _______________________________

Discipline _______________________________

Section _______________________________

Submission Date _______________________________


Program 1:
Following is a list of tablets detail in a Medical store.
Name Dosage (mg) Price (RS) Quantity
Panadol 10 2 50
Panadol 20 3 100
Panadol 30 5 250
Disprin 10 2 350
Disprin 20 3 600
Disprin 30 5 450
Calpol 50 3 520
Calpol 100 6 112
Augmenton 250 30 256
Augmenton 500 50 556
Brofin 250 5 546
Brofin 500 5 523

Display following menu given below.


Press p for Panadol
Press d for Disprin
Press c for Calpol
Press a for Augmenton
Press b for Brofin
After a valid input from above menu (Note that above input is not case sensitive user can either
input in uppercase or lowercase from above menu). After that input dosage from user if dosage is
invalid display message “Dosage not available”, if dosage is valid ask for quantity, quantity must
be greater than 0 and less than or equal to quantity available in medical store. If quantity is less
than 0 display message “Invalid input”, if quantity is greater than available quantity display
message “Out of stock”. After that display bill to be paidMake two version for above scenario.
1. In version 1 use if statement only.
2. In version 2 use switch statement. If can be used only when switch fails to solve
problem.
Program 2:
A mobile shop deals in selling mobiles of various companies following table explains mobile
details.
Company Series Model Price
Samsung S 1 20000
Samsung S 2 25000
Samsung S 3 35000
Samsung S 4 40000
Samsung J 1 15000
Samsung J 2 20000
Samsung J 3 25000
Huawei P 10 25000
Huawei P 20 30000
Huawei M 5 35000
You are supposed to declare following menu
Press S to sale Samsung
Press H to sale Samsung
If user Press uppercase S or lower case s, you have to display following sub menu
Press S to sale s-series
Press J to sale j-series
If user Press uppercase H or lower case h, you have to display following sub menu
Press H to sale h-series
Press M to sale M-series
After a valid input (might be in upper case or lower case) ask model to be sale if model is valid
print its price.
You are supposed to make two version of above program.
1. Version 1 includes switch and if
2. Version 2 includes switch only.
Program 3:
Profit on Fix Deposit in Bank; A bank offers following profit policy on fix deposit.
 No profit if amount is less than 200,000 or amount is deposited for less than 6 months.
 Profit is 5% if amount is greater than equal to 200,000 and less than 400,000 and
deposited for more than equal to six months and less than equal to 12 months.
 Profit is 7% if amount is greater than equal to 200,000 and less than 400,000 and
deposited for more than to 12 months and less than equal to 24 months.
 Profit is 10% if amount is greater than equal to 400,000 and less than 600,000 and
deposited for more than equal to 6 months and less than equal to 12 months.
 Profit is 12% if amount is greater than equal to 400,000 and less than 600,000 and
deposited for more than to 12 months and less than equal to 24 months.
 Otherwise profit is 14%
You have to write a code that will read amount and number of months from user and calculate &
show the profit. Also you have to display total amount after profit.
Program 4:
The admission criteria in BSCS and BSIT at BIIT is 45 percent marks in the intermediate with at
least one subject (Physics , math, statistic, Computer Science).The maximum age limit is 24.
Develop a program which take input age, percentage as well as verification about subject
studied. (Input for percentage is Float, for Age is integer and for Subject study is Character i.e.
‘Y’ for yes and ‘N’ for No).
If student satisfies admission criteria display message “You are eligible” otherwise display
message you are not eligible.

Program 5:BMI is used to broadly define different weight groups in adults 20 years old or
older. The same groups apply to both men and women. The formula is BMI = kg/m2 where kg is
a person’s weight in kilograms and m2 is their height in meters squared. You have to take input
of height and weight, calculate BMI and Display Message Underweight, normal weight, over
weight and obese using following. Underweight: BMI is less than 18.5
BMI Value Description
18.5 – 24.9 Normal weight
25 – 29.9 Over weight
>= 30 Obese

Program 6:Blood pressure readings have two numbers, for example 140/90mmHg.
The top number is your systolic blood pressure. The bottom one is your diastolic blood pressure.
Take the systolic and diastolic blood pressure as input and display High blood pressure, Pre-high
blood pressure, Ideal blood pressure and Low blood pressure.

You might also like