Unit 1 Assignment Should Complete On or Before 7.2.2024

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

UNIT -1 – week 2 programs should completed date on 7.2.

2024

1. Develop a C++ program that allows the user to enter a time in seconds. The output must show
how far an object in freefall for that length of time. There is no friction or resistance in air. The
acceleration of 32 feet / second and this is to be defined as a constant variable. Equation to be
used is distance = 0.5 * acceleration * time2

2. Ananya bought a model globe for a project work and that was medium sized. She found the
radius of the globe. But she would like to know the volume of that globe. Can you help her in
finding the Volume of the globe using the formula: (4.0/3.0) * π* r^3, where π = 3.14 is a
constant value.

3. ABC Corporation decides to give 11.5% for its workers as a compensation pay for a period of
six months. Develop a program to read employee’s previous annual salary. Output the new
annual salary, new monthly salary and old monthly salary. Also specify the exact amount
received as compensation pay. Use a variable declaration with the modifier const to express the
pay increase.

4. Ganesh aims to become a police officer and so applies for the job of Inspector. When he
appeared for physical test, he failed in the test due to overweight. Now Ganesh decides to do
intense training to reduce weight. The trainer asks his BMI for deciding the level of training
required. Help him to calculate the BMI using the formula: BMI = weight / height 2

5. Demonstrates dynamic memory allocation using new to create an array of integers. It assigns
values to the dynamically allocated array, prints them, and deallocates the memory using
delete[].

6. A shop will give discount of 10% if the cost of purchased quantity is more than 1000. Ask
user for quantity Suppose, one unit will cost 100. Judge and print total cost for user.

7. A school has following rules for grading system:

a. Below 25 – F

b. 25 to 45 – E

c. 45 to 50 – D

d. 50 to 60 - C

e. 60 to 80 - B

f. Above 80 - A

Ask user to enter marks and print the corresponding grade.


8. As activity directory at Ocean Breeze Resort, it is your job to suggest appropriate activities to
guests based on the weather:

temp>= 80: swimming

60 <= temp < 80:tennis

40 <= temp < 60:golf

temp < 40: skiing

9. Write the program to determine the raise and new salary for an employee to compute the raise.
The input to the program includes the current annual salary for the employee and a number
indicating the performance rating (1=excellent, 2=good, and 3=poor). An employee with a rating
of 1 will receive a 6% raise, an employee with a rating of 2 will receive a 4% raise, and one with
a rating of 3 will receive a 1.5% raise.

10. Write a C++ program that will display if a students is pass or not in his exam. (50% or more
is pass). If the student is Pass than your program should display which letter the student has
obtained.

85% or more E for excellent

75% or more but less than 85% O for Outstanding

65% or more but less than 75% G for good

Less than 65% S for satisfactory

If however the student is Fail (below 50% marks) your program should display 1

whether the student should Resit or Redo depending on the following criteria.

33% or more Resit in exam

Less than 33% Redo course

You might also like