0% found this document useful (0 votes)
7 views2 pages

Assignment 01

The document outlines five C++ programming assignments, each requiring specific functionality. The tasks include calculating performance-based bonuses based on salary and years of service, finding the largest of three numbers, assigning grades based on marks, checking if a number is positive, negative, or zero, and determining if a year is a leap year. Each assignment emphasizes the use of if-else statements and user input.

Uploaded by

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

Assignment 01

The document outlines five C++ programming assignments, each requiring specific functionality. The tasks include calculating performance-based bonuses based on salary and years of service, finding the largest of three numbers, assigning grades based on marks, checking if a number is positive, negative, or zero, and determining if a year is a leap year. Each assignment emphasizes the use of if-else statements and user input.

Uploaded by

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

Assignment # 01

Date: 12 – 03 - 2025

Q1: Write a C++ program that takes user input for salary and years of service. The program
should calculate the performance-based bonus amount according to the following rules:
 If the salary is greater than or equal to $50,000 and the years of service are more than 5
years, the employee receives a 10% bonus.
 If the salary is between $30,000 and $49,999 and the years of service are more than 3
years, the employee receives a 7% bonus.
 If the salary is below $30,000, the employee receives a 5% bonus, regardless of years of
service.
 Otherwise, the employee receives no bonus.
The program should display the calculated bonus amount. (CLO # 2)

Q2: Largest of Three Numbers


Question: Write a C++ program to input three numbers and determine the largest among them
using if-else statements. (CLO # 2)

Q3: Grade Calculation Based on Marks


Question: Write a C++ program to input student’s subject (5 subjects) marks and assign grades
based on the following conditions: (CLO # 2)

Obtained Marks Grade


90% – 100% A
80% – 90% B
70% – 79% C
60% – 69% D
< 60% F

Q4: Positive, Negative, or Zero Check


Question: Write a C++ program to check whether a given number is positive, negative, or zero
using an if-else statement. (CLO # 2)
Q5: Leap Year Checker
Question: Write a C++ program that takes a year as input and checks whether it is a leap year or
not using if-else statements. (CLO # 2)
(A leap year is divisible by 4 but not by 100, except when also divisible by 400.)

You might also like