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
Which of the following is true of how the Internet has responded to the increasing number of devices now using the network? a) T
zalisa [80]

Answer:

A

Explanation:

The internet protocols are changed every year to adapt to the new devices that have been connected to the network. Back in the 1990s, most traffic used a few protocols.  Pv4 routed packets, TCP turned those packets into connections, SSL (later TLS) encrypted those connections, DNS named hosts to connect to, and HTTP was often the application protocol using it all.

For many years, there were negligible changes to these core Internet protocols; HTTP added a few new headers and methods, TLS slowly went through minor revisions, TCP adapted congestion control, and DNS introduced features like DNSSEC. The protocols themselves looked about the same ‘on the wire’ for a very long time (excepting IPv6, which already gets its fair amount of attention in the network operator community.)

As a result, network operators, vendors, and policymakers that want to understand (and sometimes, control) the Internet have adopted a number of practices based upon these protocols’ wire ‘footprint’ — whether intended to debug issues, improve quality of service, or impose policy.

Now, significant changes to the core Internet protocols are underway. While they are intended to be compatible with the Internet at large (since they won’t get adoption otherwise), they might be disruptive to those who have taken liberties with undocumented aspects of protocols or made an assumption that things won’t change.

8 0
3 years ago
Read 2 more answers
Un automobil se desplaza a 1 458 km en direccion hacia el norte en un tiempo den 18 h. Cual es la velocidad promedio utilizada p
d1i1m1o1n [39]

Answer:

42

Explanation:

7 0
3 years ago
Which of the following statements about meta tags is TRUE?
Iteru [2.4K]

Answer:

I guess c no. is the answer

6 0
3 years ago
Read 2 more answers
The audience, setting, and type of presentation help determine presentation content. True or False?
WARRIOR [948]

True. The audience is the key to the style of presentation and the content is led by the key to the topic. If the setting blends well with the audience age, gender, background, the presentation will be more effectively presented and positive, which will be more helpful to sell the audience to the point that is being made by the presenter.

6 0
3 years ago
Help I don’t even know what class is this.
kvv77 [185]

Answer:

I would say D

Explanation:

7 0
2 years ago
Other questions:
  • How can you find Web pages that contain news published during the past week?
    8·1 answer
  • Variable costs are __________.<br><br> A. decreasing<br> B. increasing<br> C. static
    10·1 answer
  • .The __________ comes in handy when I'm using Microsoft Word to type an essay with a specific word number requirement
    6·1 answer
  • A cell reference in a formula allows you to point to another cell location
    8·2 answers
  • You are in the middle of a big project at work. all of your work files are on a server at the office. you want to be able to acc
    14·1 answer
  • _____________________________________________________is a pre-designed format to help users with the creation of a document, lik
    6·1 answer
  • B. Some of Company X's new practices and systems are unethical. Business ethics is a set of codes
    5·1 answer
  • If you double the force of and object what happens to the acceleration
    10·1 answer
  • The navigation items for a Lightning app are available on mobile: A. In a special mobile configuration in the navigation menu an
    15·1 answer
  • in a block in a blockchain what represents the transactional data, sender, receiver, and number of coins? group of answer choice
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!