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
Create an application for a library and name it FineForOverdueBooks. TheMain() method asks the user to input the number of books
user100 [1]

Answer:

using System.IO;

using System;

class FineForOverdueBooks

{

static void Main()

{

Console.WriteLine("Enter the number of books user checked out: ");

int books = Convert. ToInt32(Console.ReadLine());

Console.WriteLine("Enter the number of overdue days: ");

int days = Convert. ToInt32(Console.ReadLine());

DisplayFine(books, days);

}

public static void DisplayFine(int books, int days) {

double amt = 0;

int d = days;

if(days>7) {

amt = (days-7) * .20 * books;

days = 7;

}

if(days > 0) {

amt = amt + days * .10 * books;

}

Console.WriteLine("The fine for {0} book(s) for {1} day(s) is {2}", books, d, amt);

}

}

Explanation:

7 0
3 years ago
Memory chips are used in ____ storage devices to read and write data
MakcuM [25]
Solid state storage?
There are three different types,
Like RAM, ROM, SSS

5 0
3 years ago
True or false with reason :- carriage inword is carriage on purchases​
Vlada [557]

Answer:

True

Explanation:

Carriage on purchases is carriage inward. Explanation: Carriage inwards refers to the transportation costs required to be paid by the purchaser when it receives merchandise it ordered with terms FOB shipping point. Carriage inwards is also known as freight-in or transportation-in.

:)

8 0
3 years ago
How to change your phone number t mobile?
dexar [7]
U van change it by buying an new Sim card or buy trading it in
8 0
3 years ago
Annie wants to create a polka-dot pattern. She wants the dots to be distributed evenly in her pattern. She has turned on the gri
Alekssandra [29.7K]

Answer:

Annie should ensure that her dots are grouped in the Layers Palate.

Explanation:

For Annie to create a polka-dot pattern, that has dots distributed evenly in her pattern. She should turn on the grid feature in Illustrator.

Annie should ensure that her dots are grouped in the Layers Palate in order not to have a hard time manually arranging the dots.

4 0
4 years ago
Other questions:
  • What common objects you think will benefit from embedded computers?
    15·1 answer
  • Describe the six clauses in the syntax of an SQL retrieval query. Show what type of constructs can be specified in each of the s
    14·1 answer
  • People who score high on the Big Five trait dimension of ________ tend to use more adjectives in their e-mail communications. Gr
    15·1 answer
  • I REALLY NEED HELP WITH THIS ASSIGNMENT. IT WOULD BE GREATLY APPRECIATED IF SOMEONE HELPED ME. I'M NOT GOOD AT COMPUTER SCIENCE
    6·2 answers
  • File compression is only available on hard-disk drives. <br><br><br> a. True <br><br><br> b. False
    6·1 answer
  • true or false then EXPLAIN why. Since many forms of money do not earn interest, people's demand for money is unaffected by chang
    14·2 answers
  • Write a flowchart and program that does the following: Asks the user for the average temperature in each of the last 12 months A
    12·1 answer
  • Anything a person writes or creates is __________
    6·2 answers
  • What would you need to do if you wanted a computer to always look for a bootable CD before looking to the local hard drive
    10·1 answer
  • Complete each sentence. To add a graphic to a Word document, start by clicking the tab. Next, click . Then, navigate to the grap
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!