Task 01: Write A C++ Program That Input A Number From User and Find Whether The Entered Number Is An Integer or Float
Task 01: Write A C++ Program That Input A Number From User and Find Whether The Entered Number Is An Integer or Float
The magnitude of a real number without regard to its sign is called its Absolute Value.
For Example, absolute value of -965 is 965, absolute value of 986 is 986.
You are required to write a code which will take input a Real Number from user and
will output its absolute value.
Whenever taking input from user or showing an output to user, try to use meaningful
prompts.
Task 02
Write a C++ program that input a number from user and find whether the entered
number is an integer or float.
Input Input Input
295 1.6 0.99
Output Output Output
The Number is an Integer. The Number is Float. The Number is Float.
Task 03
Write a code which will input two numbers from user and output the largest
number.
Input Input Input
2,9 19 , 3 -9 , -11
Output Output Output
The Largest Number is 9. The Largest Number is 19. The Largest Number is -9.
Task 04
Input two integers from user and output which number is greater than other.
Input Input Input
2,9 19 , 3 -9 , -11
Output Output Output
9 is Greater than 2. 19 is Greater than 3 -9 is Greater than -11
Task 05
Modify the program written in previous question to handle the equal integers also.
Input Input Input
99 , -1 27 , 27 -97 , -97
Output Output Output
99 is Greater than 1. Both Numbers are Equal. Both Numbers are Equal.
Task 06
Chief Minister Punjab Wanted to complete the Orange Line Project as early as possible.
To make this dream come true, workers need to be work day and night. So CM
announced an overtime package for the labor, the labor will be paid double the wage
amount if it worked more than 8 hours. Can you help the accountant to make salaries of
the labor by each day end?
You are required to write a program which will input per hour wage, number of
hours worked and will output its salary for that day.
Task 07
Pakistan Railway is planning to automate its fare calculation for tickets. There are
following facilities given in Fare based on age.
There is no Fare for travel for the Children of age below 3.
There is 50% Fare Concession for the Children of age between 3 to 10.
There is Half fare for the senior citizen for the age of 65 or above.
Write a C++ program that input age of passenger and Fare and outputs the discounted
fare based on the criteria explained above.
Task 08
Here is the Scholarship Criteria in UCP
You are required to ask student’s GPA and tell him that how much Scholarship he/she
will get.
Task 09
Based on the criteria of scholarship in previous question. Now ask for the Tuition Fee
and GPA and tell about the Tuition fee he needs to submit.
Input Input
GPA : 3.91 GPA : 3.69
Tution Fee : 150000 Tution Fee : 125000
Output Output
You Need to Pay Rs.37500 Only. You Need to Pay Rs.93750 Only.