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
A cell has 12 pairs of sister chromatids in G2 of the cell cycle. How many pairs of homologous chromosomes should be seen at met
Basile [38]

Answer:

6 pairs of chromosomes

Explanation:

The cell cycle consist of 4 phases:

G1 Phase

S  Phase

G2 Phase

M Phase

G1 Phase

In the G Phase cell duplicates its organelles. In the example the cell has 6 pairs of chromosomes. In every pair of chromosomes one chromosome comes from the father and one chromosome comes from the mother. Although these chromosomes carry similar genetic information there are some differences between them.

S Phase

In the S Phase each chromosome is duplicated

In the example the cell has 12 pairs of chromosomes. Since each chromosome has a identical copy, they are called sister chromatids.

G2 Phase

In G2 phase cell prepares for mitosis. In the example the cell has 12 pairs of chromosomes.

M Phase

The M phase in the Meiosis is divided in Meiosis 1 and Meiosis 2

In Meiosis 1 pairs of sister chromatids  align  and undergo homologous recombination. For chromosome 1 ,  2 pairs of sister chromatids align and mix their genetic content. In the example the cell has 12 pairs of chromosomes. At the end meiosis 1,  6 pairs of chromosomes goes to one side of the cell and the other 6 pairs of chromosomes go to opposite side of the cell. Finally the cell divides and two cells are formed, each cell has 6 chromosomes.

At the metaphase 2 Meiosis each pairs of homlogous chomosomes is aligned al the center of the cell. In the example you have 6 pairs of chromosomes in each cell aligned at the center.  

7 0
3 years ago
Match each word to its correct meaning.
monitta

Answer:

1. Graphics.

2. Clip art.

Explanation:

1. Graphics: visual representations of information that are not text-images, photos, symbols, diagrams, and so on. Some examples of software applications used for graphics design are CorelDraw, Adobe Illustrator, Affinity Designer, Inkscape, Adobe Photoshop, etc.

Adobe Photoshop is a proprietary software application designed and developed by Adobe inc. for both Windows and MacOS operating system. It is a raster graphics editor that's typically used for imaging and graphics design. It comprises of various shape tools such as ellipse, line, polygon, triangle, custom shape and rectangle.

2. Clip art: digital artwork such as symbols and pictures that can be imported for use in documents or other software applications.

7 0
3 years ago
In the value chain concept, upgrading IT is considered what kind of activity?
ANTONII [103]

Answer:

Upgrading IT is considered as B. Support activity

Explanation:

It is considered as support activities because they help the primary activities move smoothly and consistently.

For example, efficient communication between a particular firm and its subsidiaries will be extremely difficult without the necessary IT infrastructure, which will slow down the primary activities that are to be carried out.

6 0
3 years ago
HTML5 is______because it works on tablet or smartphone,notebooks
jeyben [28]

Answer:

Wonderful and easy language

Explanation:

Hope this helps

3 0
3 years ago
Read 2 more answers
Using Task Manager, you discover an unwanted program that is launched at startup. Of the following items, which ones might lead
Harrizon [31]

Answer: Option (a) ,(c) and (e) can become a solution for the problem.

               Option(b) and (d) are not exactly a solution to the issue rather can    be considered on temporary basis

 

Explanation: Windows Task Manager is used for processing task taking place in the system and monitors the performance of that task or program that is running.To stop the unnecessary program execution on the system. methods like searching the source of the program from Task scheduler, startup files or registry key that initiated the execution that unwanted task.

Methods like disabling the program by using Msconfig and Task manager will only deactivate them but they are not eliminated from the source .Thus the appropriate answers would be option(a), (c) and (e).

7 0
3 years ago
Other questions:
  • If a method writes to a file it should start out like (fill out the blank, what should you write after the parameters in the met
    12·1 answer
  • Suppose we are comparing implementations of insertion sort and merge sort on the same machine. for inputs of size n, insertion s
    10·1 answer
  • What i have to care about transmitting data packet from one controller to other controller?
    8·1 answer
  • Josh's boss asked him to write a letter to their customers explaining some upcoming price increases. But Josh was in a hurry to
    8·2 answers
  • When should students practice netiquette in an online course? Check all that apply.
    7·2 answers
  • Justine was interested in learning how to play the piano. Before she was allowed to even play the piano, she has had to learn
    15·2 answers
  • Write a function named "list_concat" that takes a list of strings as a parameter and returns the concatenation of all the values
    13·1 answer
  • Earthquakes happen when _____.
    12·1 answer
  • What are some disadvantages of using a word processor over a type writer?​
    7·1 answer
  • What is one of the disadvantages of a server-based network compared to a peer-to-peer network?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!