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
What are the main features cyber law of Nepal​
muminat

Answer:

What are the provisions of cyber law in Nepal?

Provision of cyber law of NEPAL

It provides legal status to digital signatures and electronic records which in turn are used in electronic banking, shopping and commerce. It provides laws for formation of judicial system that operates only for crimes related to computer (internet and cyber space).

Hope this helps Have a good day

6 0
3 years ago
What is the purpose of the Occupational Safety and Health Act?
NikAS [45]

Answer:

The purpose of this act was to reduce workplace hazards and implement more safety and health programs for both employers and their employees.  

3 0
3 years ago
Read 2 more answers
A cell reference is also called a cell _______.
viva [34]
A cell reference is also called a cell address.
7 0
3 years ago
Can a result that contains road maps for European countries have a highly meets rating
Mice21 [21]

Đápán3e

Explanation:

8 0
3 years ago
Write a Python program to convert the characters to lowercase in a string
wel

Answer:

Following is the program in the python language

st = 'sAN RaN'  #String

print(st.lower()) #display into the lowercase

Output:

san ran

Explanation:

Following are the description of program

  • Declared and initialized the string in the "st" variable .
  • The lower function in python is used for converting the uppercase string into the lower case string .
  • Finally in the print function we used lower function and display the  string into the lower case
8 0
4 years ago
Other questions:
  • What is required to control access to the file system using file and folder permissions on a windows based computer?
    8·1 answer
  • The computer mouse is used to
    11·1 answer
  • What is the value of length after the code that follows is executed?int[][] nums = { new int [] {1, 2, 3},new int [] {3, 4, 5, 6
    8·1 answer
  • Write a Student class in Java which has a name, id_number, year (e.g. 2) and
    9·1 answer
  • An application with which you can perform calculations on numbers and work with other data
    8·1 answer
  • Assume that you want two C# or C++ programs to share some data. You can write the first program so that it writes it's output to
    5·1 answer
  • Write a function that dynamically allocates an array of integers. The function should accept an integer argument indicating the
    8·1 answer
  • Describe the uses of computer in different fileds? please help me ​
    14·1 answer
  • In Outlook 2016, the Tell Me function can be accessed by
    15·2 answers
  • What refers to a collection of small sections of code that are stored together to solve many everyday programs?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!