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
Database administrators must make sure that ________ and ________ techniques and procedures are operating to protect the databas
butalik [34]

Answer:

backup; recovery

Explanation:

Backup and recovery refers to the process of backing up data in case of a loss and setting up systems that allow that data recovery due to data loss. Backing up data requires copying and archiving computer data, so that it is accessible in case of data deletion or corruption. Data from an earlier time may only be recovered if it has been backed up.

Data backup is a form of disaster recovery and should be part of any disaster recovery plan.In some cases, backing up or restoring entire systems, or the enterprise, after an event or disaster can take days

5 0
3 years ago
A musician has recorded some initial ideas for new songs which she wishes to share with her bandmates. As these are initial idea
Ugo [173]

Answer:

1.save the audio using a low sampling rate

2.save the audio using a low bit depth

Explanation:

1. if the quality of the audio is low then the size of the audio will also be low and which will make the size of the data to be less and also easier to download

3 0
3 years ago
What are the specifications of mine shaft head gear​
svetlana [45]

Answer:

the depth of the shaft,

the carrying load of the skip and the mass of the counterweight,

the approximate size of the winding drum,

the approximate height of the headgear and the sheave wheel

4 0
2 years ago
Read 2 more answers
​What file system below does not support encryption, file based compression, and disk quotas, but does support extremely large v
Elena L [17]

Answer:

D.  ReFS

Explanation:

File system is simply a management system for files that controls how and where data are stored, where they can be located and how data can be accessed. It deals with data storage and retrieval.

Examples of file system are NTFS, FAT(e.g FAT 16 and FAT 32), ReFS.

ReFS, which stands for Resilient File System, is designed primarily to enhance scalability by allowing for the storage of extremely large amounts of data and efficiently manage the availability of the data. It is called "resilient" because it ensures the integrity of data by offering resilience to data corruption. It does not support transaction, encryption, file based compression, page file and disk quotas, to mention a few.

6 0
3 years ago
¿Toda sustancia de aspecto homogéneo es siempre una sustancia pura?
Gwar [14]

Answer:

No, las sustancias homogéneas pueden ser mezclas.

8 0
2 years ago
Other questions:
  • Web storage stores data in the browser in
    5·1 answer
  • When you send an echo request message with the ping program, a successful attempt will return a(n) ______ message.
    8·1 answer
  • 11. Print Layout, Full Screen Reading, Web Layout, Outline and Draft are examples of _______. 12. What do you do if the spelling
    5·1 answer
  • list the six external parts or "peripherals" of a computer system and identify which are output and which are input devices.
    15·1 answer
  • Write a Twitter class that sets the Twitter user first (who is to be followed) and lets the client add up to 5 followers, which
    10·1 answer
  • Write a program that allows the user to enter a time in seconds and then outputs how far an object would drop if it is in free f
    7·1 answer
  • Which type of financial institution typically has membership requirements?
    14·1 answer
  • Why bootable installer preparation is important? explain
    9·1 answer
  • My feelings alwayss T-T
    14·2 answers
  • Five plus six is equal to?​
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!