You are on page 1of 2

JOHN CARLO L.

PAYOT BS ENE
ASSIGNMENT: CCC101

1. Calculating Mileage Reimbursement in USD($)

a) Problem Input and Output

Input:

 Beginning Odometer reading (x)


 Final Odometer reading (y)
 Mileage rate per mile (constant)

Output:

 Total Miles Traveled


 Mileage Reimbursement amount

b) Relevant Formulas

(T) Miles Traveled = Final odometer reading – beginning odometer reading (y-x)

Mileage Reimbursement Amount = T * mileage rate per mile

c) Constant:

Mileage rate per mile = $0.35

d) Write an Algorithm

1. Print a header: “MILEAGE REIMBURSMENT CALCULATOR”

2. Enter the beginning odometer and final odometer.

3. Calculate the Total Distance traveled in miles.

 miles_traveled = input_ending_odometer – input_beginning_odometer

4. Set the mileage rate per mile as a constant

 mileage_rate_per_mile = 0.35

5. Calculate the Mileage Reimbursement amount

 . Mileage_reimbursement_amount = miles_traveled * mileage_rate_per_mile

6. Print the miles traveled and mileage reimbursement amount.


2. Temperature Conversion (Fahrenheit to Kelvin)

a) Problem Input and Output

Input:

 Temperature in degrees Fahrenheit

Output:

 Temperature in Kelvin

b) List the relevant formulas

Kelvin (K) = (F-32)*5/9 + 273.15

Where: F is the temperature in degrees Fahrenheit, K is kelvin.

c) Constants

None

d) Write an Algorithm

1. Enter the temperature in degrees fahrenheit

 Input_temperature_fahrenheit

2. Use the formula in converting temperature to kelvin

 temperature_kelvin = (input_temperature_fahrenheit – 32) * 5/9 + 273.15

3. Display Degrees Kelvin

You might also like