1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Mnenie [13.5K]
3 years ago
5

You are tasked with creating a mileage calculator 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.
Computers and Technology
1 answer:
Vlada [557]3 years ago
3 0

Answer:

Desired C++ Program with proper comment is given below

Explanation:

#include<iostream>

using namespace std;

//main function

int main()

{

  int totalMiles = 0;

  int remainingMiles = 0;

  double amt = 0;

 

  //taking input from user regarind total miles

  cout<<"Enter the total miles: "<<endl;

  cin>>totalMiles;

  //if-else condition to do the calculation

  if(totalMiles<=100)

  {

      amt = totalMiles*.25;

  }

  else

  {

      remainingMiles = totalMiles - 100;

      amt = 100*.25 + remainingMiles*.15;      

  }

 

  cout<<"The total amount is: "<<amt<<endl;

}

You might be interested in
How to change the indent of the list item "regular" on slide 2 to .5 inches in powerpoint?
galina1969 [7]
<span>You can change the identation of text in Powerpoint by right clicking on the list item and selecting, "Format Text". On the paragraph tab, you can adjust the indentation before text as given in inches.</span>
4 0
3 years ago
Why is the central limit theorem so important to the study of sampling distributions?
givi [52]

Answer:

in the paragraph

Explanation:

The central limit theorem is known to be important to the study of sampling distributions because it enables us to disregard the shape of the population when the value of n is relatively large. Was this answer helpful?

7 0
2 years ago
Who are the key players in the internet
Anna007 [38]
Gamers my dude, dank memes are also the internet's finest minds
4 0
3 years ago
Choose the term that completes the sentence.
klio [65]

Answer: BUBBLE SORT

I hope I've been helpful to you.

6 0
3 years ago
Read 2 more answers
QUESTION 5
lesya692 [45]
I’m pretty sure D but it should be like $B2
8 0
2 years ago
Other questions:
  • HELP ASAP!!!!!!!!! ITS A UNIT TEST: WILL MARK AS BRAINLIEST&gt;
    13·1 answer
  • How do forensic pathologist determine time of death
    13·1 answer
  • Which of the following methods is the easiest way to set up a VPN client on a computer for a user who is not technical?
    12·1 answer
  • Dillard’s wants to learn about its consumers' attitudes toward online purchases. There are numerous studies that are available a
    9·1 answer
  • If an author is creating a reference list and wants the second and succeeding lines indented for a reference, they should select
    13·2 answers
  • Business cards are generally designed so that this item stands out the most.
    8·1 answer
  • Walt has selected data in a worksheet and inserted a chart. However, the chart is inserted right on top of the data set, and he
    14·2 answers
  • A program with a graphical user inter-face for displaying HTML files, used to navigate the World Wide Web.
    8·1 answer
  • The term embedded system refers to any device that includes a computer chip, but that is not a general-purpose workstation, desk
    5·1 answer
  • What modifier should you use on the members of a class so that they are not accessible to another class in a different package,
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!