0% found this document useful (0 votes)
220 views

Lab Exercise 4

This document outlines 4 lab exercises for creating C# programs: 1. A program to calculate average exam scores based on inputting 3 exam scores. 2. A program to calculate tip, tax, and total for a restaurant meal based on the food charge. 3. A program to calculate distance traveled at different times based on inputting a car's speed. 4. A program to convert between Celsius and Fahrenheit temperatures based on inputting a temperature and selecting a conversion button.

Uploaded by

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

Lab Exercise 4

This document outlines 4 lab exercises for creating C# programs: 1. A program to calculate average exam scores based on inputting 3 exam scores. 2. A program to calculate tip, tax, and total for a restaurant meal based on the food charge. 3. A program to calculate distance traveled at different times based on inputting a car's speed. 4. A program to convert between Celsius and Fahrenheit temperatures based on inputting a temperature and selecting a conversion button.

Uploaded by

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

Lab Exercise 4

1. Suppose your instructor gives three exams during the semester and you want to
write a program that calculates your average exam score. Answer the following:
a. What items of input must the user enter?
b. Once the input has been entered, how will the program determine the average?
c. What output will the program display?
Design a C#.Net program for the above scenario.
2. Tip, Tax and Total
Create an application that lets the user enter the food charge for a meal at a
restaurant. When a button is clicked, the application should calculate and display
the amount of a 15 percent tip, 7 percent sales tax and the total of all three
amounts.
3. Distance Traveled
Assuming there are no accidents or delays, the distance that a car travels down an
interstate highway can be calculated with the following formula:
Distance = Speed X Time
Create an application that allows the user to enter a cars speed in miles per hour.
The application should have buttons that display the following:

The distance the car travel in 5 hours

The distance the car travel in 8 hours

The distance the car travel in 12 hours

4. Celsius and Fahrenheit Temperature Converter


Assuming that C is a Celsius temperature, the following formula converts the
temperature to Fahrenheit:
F = 9/5 C + 32
Assuming that F is a Fahrenheit temperature, the following formula converts the
temperature to Celsius:
C = 5/9(F-32)
Create an application that allows the user to enter a temperature. The application
should have Button controls described as follows:

A button that reads Convert to Fahrenheit. If the user clicks this button, the
application should treat the temperature that is entered as a Celsius
temperature and convert it to Fahrenheit.

A button that reads Convert to Celsius. If the user clicks this button, the
application should treat the temperature that is entered as a Fahrenheit
temperature, and convert it to Celsius.

You might also like