need help

i need help with this assignment how do i do this? please help me sorry im still learning

Mileage Calculator
You are tasked with creating a mileage caclulator to calculate the amount of money that should be paid to employees. The mileage is computed as follows

An amount of .25 for each mile up to 100 miles

An amount of .15 for every mile above 100.

So 115 miles would be

(.25 * 100) + (.15 * 15)

This can all be coded using a mathematical solution but I want you to use an if / else statement. Here is how you are to implement it:

If the total miles input is less than or equal to 100 then simply calculate the miles * .25 and output the amount

otherwise compute the total amount for all miles mathematically.

Input: Total number of miles
Process: dollar amount owed for miles driven
Output: Amount of money due
* Please note that you should simply do calculations within the if and else statements. This mean no cin or cout within if or else. Do it afterward.




Hello tyler,

This is not a we-do-your-homework-for-you site. You have a fairly simple assignment. Please show us what you've tried so far, and show us where you're having trouble.

We are more than glad to help, but you have to show effort first.
If you don't know basic syntax and if-statements, please check out the site's tutorials.

http://www.cplusplus.com/doc/tutorial/
http://www.cplusplus.com/doc/tutorial/program_structure/
http://www.cplusplus.com/doc/tutorial/control/ <-- if-statement tutorial
Last edited on
Topic archived. No new replies allowed.