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

Assignment 3

The document outlines the guidelines and requirements for Assignment #3 for the Computer Science Department at Air University, due on 01-12-2025. It includes instructions on submission, necessary screenshots, and a series of programming tasks related to temperature control, speed conversion, membership fee increase, salary calculation, and average rainfall computation. Additionally, it emphasizes the importance of originality and timely submission to receive credit for the assignment.

Uploaded by

abdur.rehman
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)
3 views2 pages

Assignment 3

The document outlines the guidelines and requirements for Assignment #3 for the Computer Science Department at Air University, due on 01-12-2025. It includes instructions on submission, necessary screenshots, and a series of programming tasks related to temperature control, speed conversion, membership fee increase, salary calculation, and average rainfall computation. Additionally, it emphasizes the importance of originality and timely submission to receive credit for the assignment.

Uploaded by

abdur.rehman
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

Air University

Department of Computer Science

Assignment # 3
Date of Submission 01-12-2025
Please read the following instructions carefully before submitting assignment.
It should be clear that your assignment will not get any credit if:
 The assignment is submitted after due date.
 The submitted assignment does not open or file is corrupt.
 Assignment is copied (partial or full) from any source (websites, forums, students, etc)

Guidelines:
 After successful execution, students must take clear screenshots showing: The complete source code in the
compiler window. The program output after execution.
 Both screenshots must be inserted into a Word file along with the student’s name, roll number, and assignment
title. Submit the file on the GCR.
 Random viva sessions will be conducted individually or in small groups.

1. A project currently underway at Chemical Labs, Inc. requires that a substance be continually heated in a
vat. A technician must check the substance’s temperature every 15 minutes. If the substance’s
temperature does not exceed 102.5 degrees Celsius, then the technician does nothing. However, if the
temperature is greater than 102.5 degrees Celsius, the technician must turn down the vat’s thermostat,
wait 5 minutes, and check the temperature again. The technician repeats these steps until the temperature
does not exceed 102.5 degrees Celsius. The director of engineering has asked you to write a program
that guides the technician through this process.
Here is the algorithm:
1. Prompt the user to enter the substance’s temperature.
2. Repeat the following steps as long as the temperature is greater than 102.5 degrees Celsius:
a. Tell the technician to turn down the thermostat, wait 5 minutes, and check the temperature
again.
b. Prompt the user to enter the substance’s temperature.
3. After the loop finishes, tell the technician that the temperature is acceptable and to check it again in
15 minutes.
2. Your friend Amanda just inherited a European sports car from her uncle. Amanda lives in the United
States, and she is afraid she will get a speeding ticket because the car’s speedometer indicates kilometers
per hour. She has asked you to write a program that displays a table of speeds in kilometers per hour
with their values converted to miles per hour. The formula for converting kilometers per hour to miles
per hour is:
MPH KPH * 0.6214
In the formula, MPH is the speed in miles per hour and KPH is the speed in kilometers per hour.
The table that your program displays should show speeds from 60 kilometers per hour through 130
kilometers per hour, in increments of 10, along with their values converted to miles per hour. The table
should look something like this:
Air University
Department of Computer Science

3. Membership Fees Increase


A country club, which currently charges $2,500 per year for membership, has announced it will increase
its membership fee by 4% each year for the next six years. Write a program that uses a loop to display
the projected rates for the next six years.
4. Pennies for Pay
Write a program that calculates how much a person would earn over a period of time if his or her salary
is one penny the first day and two pennies the second day, and con tinues to double each day. The
program should ask the user for the number of days. Display a table showing how much the salary was
for each day, and then show the total pay at the end of the period. The output should be displayed in a
dollar amount, not the number of pennies.
Input Validation: Do not accept a number less than 1 for the number of days worked.
5. Average Rainfall
Write a program that uses nested loops to collect data and calculate the average rainfall over a period of
years. The program should first ask for the number of years. The outer loop will iterate once for each
year. The inner loop will iterate twelve times, once for each month. Each iteration of the inner loop will
ask the user for the inches of rainfall for that month.
After all iterations, the program should display the number of months, the total inches of rainfall, and the
average rainfall per month for the entire period.
Input Validation: Do not accept a number less than 1 for the number of years. Do not accept negative
numbers for the monthly rainfall.

You might also like