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
BigorU [14]
2 years ago
10

Write a program that declares three one-dimensional arraysnamed miles, gallons, and mpg. Each array should be declared in main()

and should becapable of holding ten double-precision numbers. The numbers that should be stored in miles are240.5, 300, 189.6, 310.6, 280.7, 206.9, 199.4, 160.3, 177.4, and 192.3. The numbers should bestored in gallons are 10.3, 15.6, 8.7, 14, 16.3, 15.7, 14.9, 10.7, 8.3, and 8.4.
Computers and Technology
1 answer:
Helen [10]2 years ago
4 0

Answer:

#include <iostream>

using namespace std;

int main(){

   double miles[10] = {240.5, 300, 189.6, 310.6, 280.7, 206.9, 199.4, 160.3, 177.4, 192.3};

   double gallons[10] = {10.3, 15.6, 8.7, 14, 16.3, 15.7, 14.9, 10.7, 8.3, 8.4};

   double mpg[10];

   for (int i = 0; i < 10; i++){

       mpg[i] = miles[i]/ gallons[i];

       cout << "mpg: " << mpg[i] << endl;

   }

}

Explanation:

The C++ source code declares three arrays miles, gallons and mpg with an array length of 10. The gallons and miles arrays are assigned 10 array items each and they are used to push values to the mpg array in the for loop statement. The result of each item in the mpg array is displayed on the screen.

You might be interested in
How is an interpreter different from a compiler?
lyudmila [28]

Answer:

An interpreter is quite different from a complier due to the following statement below:

O. An interpreter translates and executes code line by line, while a compiler translates all code at once so that it is ready to be executed at any time.

Explanation:

For an interpreter, it works in translating and execution of the codes line after another line. In a situation where there is a mistake in the code, the next line would not be able to be executed, but rather display error message. On the other hand, compiler translate all codes at once and execute them as a single work.

<em>During its translation of the codes in compiler, should there be any error, it would not be able to execute despite the fact that, the error might be in the last line of the code.</em>

7 0
2 years ago
Read 2 more answers
Why is it important to have a price assiociated in every product​
artcher [175]

Answer:

The wrong price can also negatively influence sales and cash flow. tbh there is no point to me  

Explanation:

7 0
2 years ago
Read 2 more answers
Where is the thesis statement usually located in research paper?
Ugo [173]
The thesis statement is typically located in the last sentence of the first paragraph of a research paper.
7 0
3 years ago
What is a symbol such as a heavy dot or another character that precedes a text in a power point
Fantom [35]

Answer:

<em>I </em><em>think </em><em>the </em><em>answer </em><em>is </em><em>a </em><em>bullet.</em>

<em>Hope </em><em>this </em><em>helps</em>

4 0
1 year ago
How to recover permanently deleted files from drive
HACTEHA [7]
Go into your trash bin in your computer.
7 0
3 years ago
Other questions:
  • How much a 1 Gigabyte in Bytes:<br> 1. 1e+9<br> 2. 1e+6<br> 3. 1000
    8·2 answers
  • Give two separate print statements: one will print your name, the other will print your major. Ensure that both will print on th
    15·1 answer
  • What is a orogram to block access to websites
    15·1 answer
  • The order of precedence is very important when building formulas in Excel. Which of the following formulas will produce 778 as t
    11·1 answer
  • Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te
    13·1 answer
  • How do the companies gather data to determine common passwords?
    13·1 answer
  • . A store offers a deposit of 6% on the cash price of $462. The deposit amount is?​
    6·1 answer
  • Each drop-down menu.
    8·1 answer
  • What is the main difference between the ICD-10 annual revision released by the WHO and the ICD-10-CM/PCS annual revision release
    11·1 answer
  • St. CHarles school's music community is organizing a fundraiser. They want to create a simple but attractive website. However, t
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!