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 the software development life cycle, what is the role of participants in the planning phase? The participants’ role in the pl
SVEN [57.7K]

The stages of the life cycle for software development (SDLC) need to be continuously entwined with planning in order to ensure the process works  smoothly, and efficiently to run in a productive way.   If these guidelines are not met, there will be complications that arise unexpectedly, causing many frustrations to the end user.

Before planning: Make sure that the current problems have been identified. Also, ask questions so you know exactly what the client wants.  This stage of SDLC means getting input from all stakeholders, including customers, salespeople, industry experts, and programmers.  Completely study the current software usage in order to learn the strengths and weaknesses of the current system.

Planning:  Once you know what is needed and what the client wants, the team can now define the requirements of the new software. This will also be where the team researches the costs and resources necessary to achieve the final product. The team will also look at details such as the risks involved and provides sub-plans for softening those risks. A Software Requirement Specification document will also be created by the team before moving forward.

The next steps will be to design, build, test and finally deply in a "go-live".

5 0
3 years ago
Braxton is writing a program to design t-shirts. Which of the following correctly sets an attribute for color?
forsale [732]

Answer:

the answer is Self=color()

Explanation:

A color not mixed or variegated. Webster's Revised Unabridged Dictionary, published 1913 by G.

7 0
3 years ago
What is the language of computers?
myrzilka [38]

<em>Answer:</em>

<em>Computers have language of their own. It is called Binary language. </em>

<em>It’s a very simple language with just 2 symbols – 0 and 1. A computer stores all information in the form of 0’s and 1’s.</em>

3 0
3 years ago
Consider the following statement from the CS Principles course framework: The global distribution of computing resources raises
SSSSS [86.1K]

Answer:

The issue of access when it comes to global distribution of computing  resources can be described as that which entails an inequality in access when it comes to computing resources at different location of the world and this is most times due to the inequality in cost of these computing resource around the world result from inequality in availability .

This issue affect me as a person for example due to the fact that i am living in a third world country i find it harder to complete task that access to computing resources would have made easier because the cost of gaining  access  to computing resources is high compared to developed countries

Explanation:

Well the answer above is in two parts the first part talks about the issue while the second throws more light on the issue with a personal example with a view of make the point then driving it home and then keeping it brief

3 0
3 years ago
What is the value of x after running this code?
igor_vitrenko [27]

counter = 1

sum = 0

while counter <= 6:

sum = sum + counter

counter = counter + 2

print(sum)

A. 12

B. 9

C. 7

D. 8

✔️ Correct! This loop executes 3 times. After the first loop sum = 1 and counter = 3, after the second loop sum = 4 and counter = 5, and after the third loop sum = 9 and counter = 7.

5 0
3 years ago
Read 2 more answers
Other questions:
  • In addition to training on the products and on company policy, it does not make sense to be prepared to speak about your company
    6·2 answers
  • Briefly describe the client/server model.
    8·1 answer
  • Which computer device is used to capture or copy a photograph to place in a report?
    14·1 answer
  • If you define a destructor, are you required to define an operator '=' and a copy constructor?
    9·1 answer
  • Which statement is NOT CORRECT?
    11·1 answer
  • You can rotate a selected graphic by dragging a ________ rotation handle
    13·1 answer
  • What are horizontal and vertical page break? how and where are these inserted?​
    10·1 answer
  • I need help picture above
    14·2 answers
  • Suppose you want to boot a VM from its virtual DVD drive, but it boots to the VM’s hard drive. Which of the following could be t
    12·1 answer
  • Discuss the impact printer and its types in detail?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!