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]
2 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]2 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 should work be allocated to the team in a Scrum project?
Mkey [24]

Answer:

In a Scrum project, the work or the tasks are not allotted specifically. The Scrum Master is not allowed to assign tasks to the team members under any circumstance. Once the client provides the details regarding their requirements in detail, the tasks are distributed based on the expertise and skills of the employee.

Explanation:

4 0
3 years ago
I need help!! I decided to go back to college this year and am taking Intro to Logic and Programming. I have an assignment due t
Artist 52 [7]

Answer:

Monday Video: 5.4.20 Section 18.5

Work due: 18.5 Worksheet

CW

Tuesday Video: 5.5.20 Section 18.6

Work due: 18.6 Worksheet

HW

Wednesday Video: 5.6.20 Section 18.7

Work due: 18.7 Classwork

CW

Thursday Video: 5.7.20 Section 18.7

Work due: 18.7 Homework

HW

Friday Video: 5.8.20 Section 18.5-18.7

Work due: Textbook page 615 #5-19 (not #13)

HWaccuracy

Explanation:

7 0
2 years ago
For a new version of processor, suppose the capacitive load remains, how much more energy will the processor consume if we incre
erastovalidia [21]

Answer:

The answer is below

Explanation:

The amount of power dissipated by a processor is given by the formula:

P = fCV²

Where f = clock rate, C = capacitance and V = Voltage

For the old version of processor with a clock rate of f, capacitance C and voltage of V, the power dissipated is:

P(old) = fCV²

For the new version of processor with a clock rate of 20% increase = (100% + 20%)f = 1.2f, capacitance is the same = C and voltage of 20% increase = 1.2V, the power dissipated is:

P(new) = 1.2f × C × (1.2V)² = 1.2f × C × 1.44V² =1.728fCV² = 1.728 × Power dissipated by old processor

Hence, the new processor is 1.728 times (72.8% more) the power of the old processor

4 0
2 years ago
It is okay to perform experiments without your teacher's permission. This shows creativity.
katrin2010 [14]
It would be False, because if you were to mess up it can result in something going bad.
5 0
3 years ago
What is a logical reason why you should be able to delete your own posts on social media?
Furkat [3]

People live in the moment and post whatever they want and they just might regret it later on.

3 0
3 years ago
Read 2 more answers
Other questions:
  • There are several vehicles in a parking lot. Some of them are motorcycles
    8·2 answers
  • Which is the correct process for attaching a file?
    12·1 answer
  • Refer to the following code segment. You may assume that array arr1 contains elements arr1[0],arr[1],...,arr[N-1], where N = arr
    8·1 answer
  • What can be the maximum possible length of an identifier 3163 79 can be of any length​
    5·1 answer
  • Help me plzzzz ASAP T-T and it's Cyber Security but my last day of school is tomorrow and I'll graduate in June 24 so plzzzzz I
    12·1 answer
  • All the network nodes are connected to each other
    8·1 answer
  • What is the minimum ethernet frame size that will not be discarded by the receiver as a runt frame?.
    8·1 answer
  • Similarities between master file and reference file
    12·1 answer
  • You have recently compiled a custom Linux kernel. You notice some performance issues with and need to use the kernel log files t
    15·1 answer
  • a 2x4 line decoder with enable is implemented using nand gate only. how many nand gate is needed to construct this line decoder?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!