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
What is the best definition of the 7x7 rule for maximizing audience comprehension
olganol [36]

The 7x7 Rule states that a PowerPoint slide should have no more than seven lines of text and no more than seven words in each of those lines.

7 0
3 years ago
Five features of any window​
Vesna [10]

Answer:

The features of any windows are

1. Start menu

2. Notification area or task bar

3. Window snipping tools

4. Using Local Area Networks

5. Windows explorer libraries

Explanation:

8 0
3 years ago
Which column and row references are updated when you copy the formula f$3/15
Tasya [4]

Answer: Column F

Explanation: In Microsoft excel, for the sake of robustness and to aid the effectiveness of updating formulas across cells. The reference of cells are treated as relative which means that when formulas are copied across columns or within rows, they get updated automatically. However, some numbers may be treated as constants such that we do not want them to change or be updated as we move acisss cells. Thus, such numbers are treated Given absolute references, which is made possible by adding a '$' prefix before the colum alphabet or row number or both. in the scenario given above, the row has the $ prefix, hence, it is absolute and will not change but the column alphabet does not and hence, treated as relative.

3 0
3 years ago
Any application that wants to be displayed on the web must use the HTTP protocol <br> True<br> False
never [62]

Answer:

true

Explanation:

7 0
3 years ago
What is the last step in planning your budget
jenyasd209 [6]
Review and Revisions
8 0
3 years ago
Other questions:
  • You realize your computer has been infected with malware. The program has been copying itself repeatedly, using up resources. Wh
    10·1 answer
  • For Official Use Only (FOUO) and Controlled Unclassified Information (CUI) may include all of the following except: (circle one)
    13·1 answer
  • A technician is troubleshooting a printer connected to a computer via USB. The printer will print using the controls at the prin
    9·1 answer
  • What is a software? 2 sentences please, I'll mark u as brailiest
    12·1 answer
  • Write short notes about monitor printer and speaker​
    14·2 answers
  • Core to resource management system is the _________that coordinates the server hardware.
    8·1 answer
  • Which important aspect of the Roman Empire did the barbarians destroy?
    14·2 answers
  • What are three ways a person may use a computer without realizing it?
    9·1 answer
  • Being technologically literate requires being able to ______. a. use advanced graphics manipulation tools (adobe photoshop) b. u
    6·1 answer
  • a client device on your network is trying to authenticate via radius proxy, but is failing. you check the relevant policy on the
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!