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
artcher [175]
3 years ago
9

A car holds 16 gallons of gasoline and can travel 312 miles before refueling. Write aC++ program that calculates the number of m

iles per gallon the car gets. Display the result on the screen.
Computers and Technology
1 answer:
IgorC [24]3 years ago
6 0

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // variables Declaration and initialization

   int no_gallon=16;

   int dis=312;

   // find the miles per gallon

   double mile_gallon=dis/double(no_gallon);

   // print the results

   cout<<"number of gallons: "<<no_gallon<<endl;

   cout<<"distance travel before refueling: "<<dis<<endl;

   cout<<"miles per gallon is: "<<mile_gallon<<endl;

return 0;

}

Explanation:

Declare and initialize the number of gallon and distance travel without refueling. Calculate the miles per gallon by dividing distance with number of gallons.Then print the results.

Output:

number of gallons: 16

distance travel before refueling: 312

miles per gallon is: 19.5

You might be interested in
In a system where Round Robin is used for CPU scheduling, the following is TRUE when a process cannot finish its computation dur
masha68 [24]

Answer:

B. The process will be terminated by the operating system.

Explanation:

When Round Robin is used for CPU scheduling, a time scheduler which is a component of the operating system is used in regulating the operation. A time limit is set for each of the processes to be run.

So, when a process fails to complete running before its time elapses, the time scheduler would log it off and return it to the queue. This queue is in a circular form and gives each of the processes a chance to run its course.

7 0
3 years ago
Web navigation gives the user a sense of control.
Leviafan [203]
1. a.
2. d
3. b
I hope this helps
6 0
3 years ago
Read 2 more answers
Omar sends a PDF file to his teacher. He then prepares another copy of the presentation that includes only the slides he wants t
maria [59]

Answer:

D. Custom Slide Show

Explanation:

Correct on edg

7 0
3 years ago
What error can you identify? (Points : 4)
QveST [7]

Answer:

Assumes indentation has a logical purpose

Explanation:

No period

6 0
3 years ago
Please help with this coding problem! Any help is greatly appreciated!!
Nonamiya [84]

The python program is an illustration of python functions; Functions are names statements that are executed when called.

<h3>The order in which the statements are executed?</h3>

The program uses functions, and the functions would be executed when called.

So, the order of the statements is:

  • Line 10
  • Line 11
  • Line 1 to 3
  • Line 12
  • Line 4 to 6
  • Line 13
  • Line 7 to 9
  • Line 14

<h3>The value of x in between lines 11 and 12</h3>

On line 11, the function F(n) is called and executed.

This function multiplies 10 by 5 and assigns the product to x.

Hence, the value of x in between lines 11 and 12 is 50

<h3>The value of x in between lines 12 and 13</h3>

On line 12, the function G(n) is called and executed.

This function adds 25 to the global value of x (100) and assigns the sum to x.

Hence, the value of x in between lines 12 and 13 is 125

<h3>The program output</h3>

On line 13, the function H(n) is called and executed.

This function adds -25 to the global value of x (125) and assigns the sum to x.

The output is then printed on line 14

Hence, the output of the program is 150

Read more about Python programs at:

brainly.com/question/16397886

7 0
2 years ago
Other questions:
  • What process describes using technology as a basis for controlling the access and usage of sensitive data?
    7·1 answer
  • Define additional characteristics such as font weight or style for an html tag
    5·1 answer
  • Think about some of the most memorable and forgettable games ever created. They can be games that were
    15·1 answer
  • Which tab should be selected to add a hyperlink within a cell? Home tab Review tab Insert tab Formula tab
    12·2 answers
  • Your first submission for the CIS 210 Course Project should include the following functionality: - Requests the user to input hi
    13·1 answer
  • Activity 1.1.4 What is Technology?
    10·1 answer
  • How is the pattern matching done in the SQL?
    5·2 answers
  • I need the answer asap !!!!
    9·1 answer
  • Because some countries have poor traditional telephone services, companies and consumers have resorted to Group of answer choice
    15·1 answer
  • When a linked chain contains nodes that reference both the next node and the previous node, it is called a(n)?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!