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
Sanjay is giving a slideshow presentation on his entire college class and he is feeling quite nervous in order to share his pres
Likurg_2 [28]
I think that would be the (HDD) Hard Disk Drive! Hope this helps!
8 0
3 years ago
I really need help please abari is writing a program which prompts a user for a value without a decimal. Which function should h
insens350 [35]

Answer:

print()

Explanation:

print allows you to add words into the script, like this;

script.parent.mouse.touch <u>then</u>

<u>print(¨ḧimenewew¨)</u>

4 0
2 years ago
What is the output of the following function call? //function body int factorial(int n) { int product=0; while(n &gt; 0) { produ
maks197457 [2]

Answer:

zero

Explanation:

Because of the define the product variable is zero.

when the function call with pass by value 4.

The program control moves to that function, after that product

store the value zero. Then, product is multiply with n which become zero

because 0 * n is zero and store in the product again.

after that, n'' is wrong it must be 'n--' for performing the factorial function.

after that, the value of n is 3, again loop execute because condition n > 0

is true.

again zero multiply with n and become zero.

this process repeated until condition false and finally the output is zero.

Correction:

To make the code working:

change product = 1 instead of zero.

and change n-- in place of n''.  

5 0
3 years ago
Give an example of a language L such that |L|=5 and |L^2|=16.
Basile [38]

Answer:

He can define pas follows: Let P be defined on the set of languages accepted by some Turing machine M. Let it be True if 10 ] is 5 and False otherwise.  

Explanation:

The domain of P is the SD languages since it is those languages that are accepted by some Turing machine H. P is nontrivial since P({ a, aa, aaa, aaaa, aaaaa, aaaaaa, b, bb, bbb, bbbb, bbbbb, bbbbbb } ) is True and P ( 5 ) is False.  

Thus {< M> is a Turing machine and I L I - 5 and  I L I - 16 }

7 0
2 years ago
A good website design combines which of the following elements? (select all that apply) powerful web server hardware components
Anarel [89]

Sounds like it'd be all of the above.


7 0
3 years ago
Read 2 more answers
Other questions:
  • If reading or writing a cache line of size 64 bytes to Flash requires 2.56 μJ and DRAM requires 0.5 nJ, and if idle power consum
    9·1 answer
  • ____ is high-quality encryption software that has become quite popular for creating secure e-mail messages and encrypting other
    9·1 answer
  • What is a unique text-based Internet address corresponding to a computer's unique numeric IP address called
    14·1 answer
  • What is a traffic controller?what are its functions?
    13·1 answer
  • A program needs to allow a customer to input integers until the input number is zero. When the input number is zero, the program
    14·1 answer
  • What devices gives input​
    5·1 answer
  • Yesterday you installed a new game on your computer. When you ran the computer, you noticed that the application was running ver
    10·1 answer
  • You wrote a program to allow to guess a number chosen randomly.
    10·2 answers
  • What are the significances of blogs?
    7·2 answers
  • Collaboration, listening, and negotiating are considered __________ skills.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!