Write your question here.
I cannot get the else if part to work correctly. with being over the 100 miles.
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)
#include <iostream>
using namespace std;
int main ()
{
int miles;
int totalmiles;
cout << "Enter the number of miles driven" << endl;
cin >> miles;
if (miles <= 100)
{
totalmiles = miles * .35;
cout << "You are owe " << totalmiles <<endl;
}
else if (miles > 100)
{
totalmiles = miles * .35 + miles* .15;