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

Lab 4

This document provides programming assignments for students. It includes 10 programs of varying complexity that involve inputting and evaluating numbers, characters, salaries, grades and more. The programs are meant to teach students fundamental programming concepts like using if/else statements, performing calculations, and comparing values. The last program is designated as an assignment to write a program that determines if an input character is uppercase or lowercase using nested if-else statements.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Lab 4

This document provides programming assignments for students. It includes 10 programs of varying complexity that involve inputting and evaluating numbers, characters, salaries, grades and more. The programs are meant to teach students fundamental programming concepts like using if/else statements, performing calculations, and comparing values. The last program is designated as an assignment to write a program that determines if an input character is uppercase or lowercase using nested if-else statements.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

PROGRAMMING

FUNDAMENTALS
Lab-04

For Students:

Roll No.
027 SU73-ADCSM-F22-033
Name.
Lal khan M.Usman
Class.
Adp cs
ADP (CS)

Instructor

_____________________________________________________________________________4
3
Programming Fundamentals - Lab [COSC-1201]
_________________________
Mr.Zeeshan ahmeed

_____________________________________________________________________________4
4
Programming Fundamentals - Lab [COSC-1201]
4.2.1.
4.2.2. Program No 2
Write a program that input three numbers, evaluate their average. If the average is greater than
80, print “You are above average”.

_____________________________________________________________________________4
5
Programming Fundamentals - Lab [COSC-1201]
4.2.3. Program No 3
Write a program that finds largest of three inputted numbers.

_____________________________________________________________________________4
6
Programming Fundamentals - Lab [COSC-1201]
4.2.4. Program No 4
Write a program that inputs a number, and finds whether it’s even or odd.

_____________________________________________________________________________4
7
Programming Fundamentals - Lab [COSC-1201]
4.2.5. Program No 5
Write a program that inputs salary and grade. It adds 50% bonus if grade is greater than 15. It
adds 25% bonus if grade is 15 or less, and then displays the total salary.

_____________________________________________________________________________4
8
Programming Fundamentals - Lab [COSC-1201]
4.2.6. Program No 6

Write a program that inputs test marks of a student and displays his grade on the following

_____________________________________________________________________________4
9
Programming Fundamentals - Lab [COSC-1201]
criteria:
Marks Grade
>=90 A
80 – 89 B
70 – 79 C
60 – 69 D
Below 60 F

4.2.7. Program No 7
Write a program that inputs two numbers, and a character operator (+,-,*, /), and perform the
_____________________________________________________________________________5
0
Programming Fundamentals - Lab [COSC-1201]
specified operation on numbers.

_____________________________________________________________________________5
1
Programming Fundamentals - Lab [COSC-1201]
_____________________________________________________________________________5
2
Programming Fundamentals - Lab [COSC-1201]
4.2.8. Program No 8
Write a program that inputs 3 numbers and displays the smallest number using nested if
statement.

_____________________________________________________________________________5
3
Programming Fundamentals - Lab [COSC-1201]
4.2.9. Program No 9
Write a program that inputs three numbers, and check whether they are equal or not.

_____________________________________________________________________________5
4
Programming Fundamentals - Lab [COSC-1201]
4.8.10. Program No 10 (ASSIGNMENT)
Write a program in C++ that takes a character from the user and tells whether it is a ‘SMALL
CASE’ or ‘CAPITAL CASE’ letter using nested if-else statement only.

_____________________________________________________________________________5
5
Programming Fundamentals - Lab [COSC-1201]
_____________________________________________________________________________5
6
Programming Fundamentals - Lab [COSC-1201]

You might also like