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
Submit your newsletter that includes the following: two or three columns a title at least three graphics, but not more than six
BigorU [14]

God Is Good He Will Always Help You He Is Good And Always Good!!

If God Is For Us Who Can Be Against us?? Romans 8:31

7 0
2 years ago
Read 2 more answers
Which daemon manages the physical memory by moving process from physical memory to swap space when more physical memory is neede
Anastasy [175]

Answer:

Swap daemon

Explanation:

Swap daemon manages the physical memory by moving process from physical memory to swap space when more physical memory is needed. The main function of the swap daemon is to monitor processes running on a computer to determine whether or not it requires to be swapped.

The physical memory of a computer system is known as random access memory (RAM).

A random access memory (RAM) can be defined as the internal hardware memory which allows data to be read and written (changed) in a computer.Basically, a random access memory (RAM) is used for temporarily storing data such as software programs, operating system (OS),machine code and working data (data in current use) so that they are easily and rapidly accessible to the central processing unit (CPU).

Additionally, RAM is a volatile memory because any data stored in it would be lost or erased once the computer is turned off. Thus, it can only retain data while the computer is turned on and as such is considered to be a short-term memory.

There are two (2) main types of random access memory (RAM) and these are;

1. Static Random Access Memory (SRAM).

2. Dynamic Random Access Memory (DRAM).

6 0
3 years ago
How to save a file for the first time?​
White raven [17]

by typing ctrl+ s on keyboard

7 0
2 years ago
Read 2 more answers
Each codec is stored within a file called a(n) ____ file.
frutty [35]
Im like 90% sure its a container file
5 0
3 years ago
What does PRAM stand for?
Nana76 [90]
<span>PRAM- Phase-Change Random Access Memory</span>
7 0
3 years ago
Read 2 more answers
Other questions:
  • Which protocol is often used to publish web pages to a web server?
    5·1 answer
  • A loop that repeats a specific number of times is known as a(n):
    9·1 answer
  • What is cyber stalking and how does it work?
    7·2 answers
  • The unique physical address burned into every network interface card is its:
    15·1 answer
  • If you wish to include a header or footer on all pages in a publication, you will need to insert this by navigating to the _____
    11·2 answers
  • Which type of cloud computing offers easily accessible software and applications on the machines?
    7·1 answer
  • Data are sent through a network on bundles called _______. select one:
    8·2 answers
  • If you wanted to create a line of code that would add ten to the user’s current score, which code should you use?
    12·2 answers
  • Write Tic tac toe program in python for beginners pls
    10·1 answer
  • Given three floating-point numbers x, y, and z, output x to the power of y, x to the power of (y to the power of z), the absolut
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!