Exercise Questions

  1. Write a Program that converts a user inputted temperature in Celsius to Fahrenheit.

Fahrenheit=(Celsiusāˆ—9/5)+32Fahrenheit = (Celsius * 9/5) + 32
  1. Write a Program that calculates the cost of the tip and the total cost (meal + tip) of a meal.

Notes:
- The total cost will be inputted as a real number
- the tip percentage will be inputted as a whole number.
  1. Write a Program that calculates and outputs the midpoint of two points on a Cartesian Plane.

You should have 4 inputs.
- x1
- y1
- x2
- y2
  1. Write a Program that outputs the number of paint cans needed, the number of paint cans leftover, and the total cost of the project.

Instructions:
- There are 3 inputs. One for each section of the fence.
- Each fence plank denoted by a "F" requires a single paint can
- The paint can only comes in a box of 12. 
- A single box cost $14.95

Sample Input 1:
FF
FFFF
FFFFFF

Sample Output 1:
12.0
0.0
14.95

Explanation:
- From the three sections inputted, the project requires 12 paint cans 
  (one for each fence plank)
- There were 0 leftovers since a single box contains 12 paint cans
- The cost was 14.95 since a single box sells for 14.95

Sample Input 2:
FFFFF
FFFF
FFFFF

Sample Output 1:
14.0
10.0
29.9

Explanation:
- There were 14 paint cans needed in total
- To paint 14 planks, 2 boxes were purchased
- There were 10 paint cans leftover from having 24 cans.
- Two boxes cost $29.9

Last updated