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
Crank
3 years ago
9

Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both doubles) as input, and output the g

as cost for 20 miles, 75 miles, and 500 miles. Output each floating-point value with two digits after the decimal point, which can be achieved by executing cout << fixed << setprecision(2); once before all other cout statements.
Computers and Technology
1 answer:
zepelin [54]3 years ago
8 0

Answer:

Explanation:

The following is written in C++ and asks the user for inputs in both miles/gallon and dollars/gallon and then calculates the gas cost for the requested mileages using the input values

#include <iostream>

#include <iomanip>

using namespace std;

int main () {

   // distance in miles

   float distance1 = 20.0, distance2 = 75.0, distance3 = 500.0;

   float miles_gallon, dollars_gallon;

   cout << "Enter cars miles/gallon: "; cin >> miles_gallon;

   cout << "Enter cars dollars/gallon: "; cin >> dollars_gallon;

   cout << "the gas cost for " << distance1 << " miles is " << fixed << setprecision(2) << (float) dollars_gallon * distance1 / miles_gallon << "$\n";

   cout << "the gas cost for " << distance2 << " miles is " << fixed << setprecision(2) << (float) dollars_gallon * distance2 / miles_gallon << "$\n";

   cout << "the gas cost for " << distance3 << " miles is " << fixed << setprecision(2) << (float) dollars_gallon * distance3 / miles_gallon << "$\n";

   return 0;

}

You might be interested in
In case of an emergency, once you or someone already on the scene has contacted 9-1-1, the next thing to do is: A) Move them to
velikii [3]

if alone, you would give care first for which situation

4 0
3 years ago
Read 2 more answers
PLSSS HELPP IM DESPERATE!!!
adoni [48]

Answer:

C

Explanation:

4 0
2 years ago
A____________ is defined as (1) a program of care devoted to providing comfort to terminally ill people through a team approach
Alborosie

Answer:

palliative care

Explanation:

Palliative care is a program dedicated for people who is terminally ill. Palliative care is aimed to relieve symptoms and street of the illness and at the same time improve quality of life for the patient. This program involves a team of doctors, nursers and also patient's family members. One important point is that, the palliative care is not based on patient's prognosis but to provide support to the patient based on their needs.

6 0
3 years ago
FIRST AMSWER GET BRAINLIEST​
MA_775_DIABLO [31]

Answer:

agile --> business modeling

RAD --> pair programing

waterfall --> deployment

spiral --> risk analysis

v-shaped model --> integration testing

not too sure about this but i tried

4 0
2 years ago
Is it legal to "use" an unprotected wireless access point that you discover in a public area? Is it ethical to use it? Hypotheti
mrs_skeptik [129]

Answer:

The legality of use is dependent on the permissions provided by the owner, service provider ad state's laws. It is not ethical to use open wifi not provided or sponsored by event's organizer.

Some of the risk are:

Privacy leak and risk of confidentiality. Wifi data transfer occur using encryption but there are also some devices that can decrypt this data provided the have access the wifi. In open wifi, since everyone has access hence anyone with malicious intents can overlook your activities by decrypting data. This become more dangerous when a person is accessing bank statement or doing transactions on public wifi.

6 0
3 years ago
Other questions:
  • Vpns create a _____________ to transport information through public communications media.
    8·1 answer
  • Which is the best description of a computer virus?
    5·2 answers
  • A file named numbers.txt contains an unknown number of lines, each consisting of a single positive integer. Write some code that
    11·2 answers
  • Create a Racket procedure compute_pos that reads numbers from the keyboard until 0 is read, count how many positive numbers are
    12·1 answer
  • What is wrong with each of the following?
    6·1 answer
  • Which of the following statements is not correct ​
    6·2 answers
  • When using a line graph, why is it inportant to only graph 1 - 3 series of data?. A. A line graph in Microsoft Excel will not al
    7·1 answer
  • CAN SOMEONE PLEASE HELP ME OUT I REALLY NEED THE ANSWER!
    14·1 answer
  • What is the index of 7 in this list?
    10·1 answer
  • Name at least 3 different portable computer devices that can be purchased
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!