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
Who<br> invented the term “debugging”?
Black_prince [1.1K]

Grace Murray Hopper invented it

8 0
3 years ago
Read 2 more answers
What is the most significant issue that needs to be addressed when ensuring the proper functioning of a computer?
ycow [4]

Answer:

The most significant issue addressed while ensuring the proper functionality of computer is the working of Operating System.

Explanation:

There are many issues faced while making the computer properly functional. Such as, Memory size, processor speed, software installation etc. while operating system not working properly can cause a significant problem. If operating system is not working properly, the user is unable to use the computer.

So, to make sure the functioning of computer, the significant issue that should be needed to address is Operating System Installation.

7 0
2 years ago
An algorithm requires numbers.<br> O True<br> O<br> False
Naya [18.7K]
True hope this helps
6 0
2 years ago
Read 2 more answers
After clicking the Start button on your computer screen desktop, what option would you then select to examine system components
Sveta_85 [38]
You can find the components that you wanted to modify in : C. control panel

You can adjust your computer's setting through control panel, whether it's your system and security, hardware, net work setting, etc

hope this helps
4 0
3 years ago
Read 2 more answers
When trying to remember a list of words, a person may choose a word to which they "hang" their memories on. This type of mnemoni
nika2105 [10]

Answer:

Peg

Explanation:

This is known as the "peg technique." The name comes from the fact that we usually employ pegs to hang clothes to dry. In this memory aid, the person who wants to memorize something creates mental associations between two concrete objects. This is done in a one-to-one fashion that links all the words together.

6 0
3 years ago
Other questions:
  • You use a(n) ____ variation when a use case is less specific than others, and you want to be able to substitute the more specifi
    8·1 answer
  • Spreadshet formula to add totals​
    12·1 answer
  • Who is the owner of microsoft company​
    12·1 answer
  • Which of the statements below are true about Digital Signatures?
    15·1 answer
  • Write the definition of a function isSenior, that receives an integer parameter and returns true if the parameter's value is gre
    13·1 answer
  • Salvado has a flash dish of is GB
    6·1 answer
  • Five technology tools and their uses​
    5·1 answer
  • TOT al<br>Name TWO examples of these settings and utilities. (2)​
    12·1 answer
  • Memory containing hardwired instructions that the computer uses when it boots up, before the system loads. In PCs the instructio
    9·2 answers
  • Which of the following is not harmful to the computer?<br> a) Trojan<br> b) Rootkit<br> c)Malware
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!