Description
Problem 1
Write a set of statements in the main function that displays to the monitor a large letter ‘V’ made
up of the character ‘V’. Here is a sample output of how it should look when the program runs.
Make sure to follow this output to receive full points.
Any differences will cause points to be
deducted. You do not need to use loops for this problem. Use the text file output to assist with
the number white spaces.
Figure 1: Output for question 1. The output must match exactly to receive credit. This includes
white space and new lines.
Problem 2
Write some code that calculates mileage reimbursement for an employee a rate of $2.61 per
mile. This code needs to interact with the user. Hint: Use scanf statements. Make sure to
follow this output to receive full points.
Any differences will cause points to be deducted. Think
about the type of data we are working with. Make sure you display up to two decimal places
when displaying dollar amount and one decimal place when displaying distance traveled. Make
all variables of type double. You do not need to worry about negative values. We have not
discussed conditions yet.
Figure 2: Output for question 2. The output must match exactly to receive credit. This includes
white space and new lines.
Small Program 1 Page 4
Problem 3
Write some code that calculates the body mass index (BMI). The BMI can be calculated as
follows using the formula
BMI =
weightInP ounds × 703
heightInInches × heightInInches
You are going to ask the user for some input. You will ask for weightInP ounds and heightInInches.
Both variables are float type. Make sure to follow this output to receive full points. Any differences will cause points to be deducted. Your output result should only display up to three
decimal places.
Note: Assume the total height is input. Example, 5 feet and 6 inches would
result in 66 inches as the input. You do not need to worry about the denominator being 0 or
negative values. We have not discussed conditions.
Figure 3: Output for question 3. The output must match exactly to receive credit. This includes
white space and new lines.
Problem 4
Write some code inside the main function that calculates the volume of a cone. The formula for
calculating the volume of a cone is as follows
V =
1
3
× π × r
2 × h
The value of π = 3.14159. Make sure to declare pi as a constant variable or else points will be
deducted. The graders will be checking for this and not the script! You should have the following
exact output in your code for the script to give you credit.
Display the result up to four decimal
places. Be very careful with this problem. Some students may run into small errors do to loss
of information. Make sure 1/3 is 0.3 repeating and not just 0. All variables are type double. You
do not need to worry about negative values.
We have not discussed conditions yet.
Figure 4: Output for question 4. The output must match exactly to receive credit. This includes
white space and new lines.
Small Program 1 Page 5



