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
The second stage of digestion takes place in the small intestine. <br> True Or False?
DedPeter [7]
False. The second stage of digestion happens in the stomach.
8 0
3 years ago
one business rule is that each project has one manager. Identify two (and no more than two) problems with the data structure or
Vinil7 [7]

Answer:

1. The data will not be tallying up - there will great variations and deviance.

2. There will be not enough data points

Explanation:

The management style, though it uses one manager, is not devoid of problems in the system. For example, there will be great difficulty in the collection of accurate data to properly define the system. This presents a great misinformation on the outcome of the data process. This is likely to be caused by the first factor that is the data having a lot of discrepancies. The discrepancy causes the data to be meaningless in terms of the trends displayed. In addition, the lack of enough points posses a challenge to the data collection and processing procedure. The data base management system can be used to concentrate data on a central point of reference.

3 0
3 years ago
____________ are the in – built functions that perform a particular pre – defined task when used in a computer program.
saveliy_v [14]

Answer:

System software.

Explanation:

System software are the in-built functions that perform a particular pre-defined task when used in a computer program. An example of a system software is an operating system.

An operating system (OS) is a system software pre-installed on a computing device to manage or control software application, computer hardware and user processes. Some examples of an operating system are QNX, Linux, OpenVMS, MacOS, Microsoft windows, IBM, Solaris, VM etc.

4 0
2 years ago
1. Here is a program segment to find the quantity base . Both base and exp are entered at the keyboard. System.out.println("Ente
zavuch27 [327]

Answer:

The correct code to this question can be de4fined as follows:

double power;

power = Math.pow(base, exp);

Explanation:

In the given question the choices were missing, that's why we defined the correct code only.

  • In the given code a two double variable "base and exp" is declared, that input the value from the user-side, and store its value into there respective variables.
  • In the next step, "power", that is a double variable is declared, which uses the  "Math.pow" function that calculates given values power and prints its value.

please find the attachment of the full code.

3 0
3 years ago
These things are commonly found on the front of desktop computer cases:
jok3333 [9.3K]

USB ports, headphone jack/microphone port, and of course, a power button.

3 0
3 years ago
Other questions:
  • What is special about the f and j keys on a standard keyboard?
    15·2 answers
  • What type of lights are necessary for silhouettes?
    12·2 answers
  • Anyone free to inbox me plz....​
    6·2 answers
  • An attacker compromises the Washington Post's web server and proceeds to modify the homepage slightly by inserting a 1x1 pixel i
    12·1 answer
  • Which is a benefit of traditional SLR cameras over digital cameras? A. They produce negatives to serve as backups. B. They make
    6·1 answer
  • Use the ________ property in the html link tag to to associate a web page with a style sheet for printing.
    5·1 answer
  • Designing a video game takes tons of creativity. What inspires your personal creativity and ideas for video games? Explain and g
    15·1 answer
  • I think you have been doing a great job but you haven’t been signing many people up for our new service feature I want you to se
    8·1 answer
  • Question 1 of 10
    15·1 answer
  • Which three pieces of information should be included in an artist statement? Select all that apply.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!