PSCP LAB Assignment-1
PSCP LAB Assignment-1
1. Enter 4 digit numbers through keyboard. Write a program to obtain the sum of 1st
and last digits of this number.
2. Paper of size A0 has dimensions 1189 mm × 841 mm. Each subsequent size A(n) is
defined as A(n-1) cut in half parallel to its shorter sides. Thus paper of size A1 would
have dimensions 841 mm × 594 mm. Write a program to calculate and print paper
sizes A0, A1 …A8.
3. Write a program that takes get the branding expenses, travel expenses, food
expenses and logistics expenses as input from the user and calculate the total
expenses for an event and the percentage rate of each of these expenses.
Sample Input:
Enter branding expenses: 20000
Enter travel expenses: 40000
Enter food expenses: 15000
Enter logistics expenses: 25000
Output:
Total expenses: Rs.100000
Branding expenses percentage: 20%
Travel expenses percentage: 40%
Food expenses percentage: 15%
Logistics expenses percentage: 25%
4. Write a C++ program to input in centimetre and convert it into meter and kilometre.
5. Write a C++ program to take principle, time and rate (P, T, R) as input from user and
calculate Simple Interest.
6. If the marks obtained by a student in six different subjects are input through the
keyboard, find out the aggregate marks and percentage marks obtained by the
student. Assume that the maximum marks that can be obtained by a student in each
subject are 100.
7. Write a program in C++ to print the code (ASCII code) of a given character.
8. Consider a currency system in which there are notes of seven denominations,
namely, Rs. 1, Rs. 2, Rs. 5, Rs. 10, Rs. 50, Rs. 100. If the change given to Pranav
Rs. N is input, write a program to compute smallest number of notes that will
combine to give Rs. N.
For Example: If input is 1200 then output is 12
If input is 242 then output is 7
9. Write a program which accepts days as integer and display total number of years,
months and days in it.
For example: If input is 856 days the output should be 2 years 4 months 6 days
10. Write a program to evaluate the fuel consumption of a car. The reading at the start
and end of the journey should be read, and also the fuel level in the tank at the start
and end of the journey. Calculate fuel used, kilometers travelled, and hence the
overall fuel consumption in kilometers travelled per liter of fuel (i.e. mileage).
11. Write a C++ program to demonstrate on Shift operators.
12. Write a C++ program to demonstrate on Bit-Wise operators.
13. Write a program in C++ to swap two numbers using third variable.
14. Write a program in C++ to swap two numbers without using third variable.
15. Number of people who attended the event on the first day was x. But as days
progressed, the event gained good response and the number of people who
attended the event on the second day was twice the number of people who attended
on the first day. Unfortunately due to heavy rains on the third day, the number of
people who attended the event was exactly half the number of people who attended
on the first day. Given the total number of people who have attended the event in
the first 3 days, write a program to find the number of people who have attended
the event on day 1, day 2 and day 3.