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]
3 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]3 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
Why might a business choose a server-based network over a peer-to-peer network?
valina [46]

Answer:

Hope this helps you out    Answer: Greater security

Explanation:

Server maintains better relationship with server at everry time. So it gives maximum of security and reliability against unauthorised access

3 0
3 years ago
Which Of the following components leads to slow computer performance when it becomes outdated
Scorpion4ik [409]

guess its d drivers , since u said wen it gets outdated


8 0
3 years ago
Read 2 more answers
Copy the 10 statements as they appear below into your journal.
AURORKA [14]

B A C D C A B B CDAAD

4 0
3 years ago
Read 2 more answers
How can you put a logo on html without breaching the copyright, design and patents act
Andrei [34K]
You create your own logo
5 0
3 years ago
How important are operating system in our devices?​
TiliK225 [7]

Answer:

Explanation:

An operating system is the most important software that runs on a computer. ... It also allows you to communicate with the computer without knowing how to speak the computer's language. Without an operating system, a computer is useless.

6 0
2 years ago
Read 2 more answers
Other questions:
  • Matt wants to build an app that will reach many people all over the world. However, he worries about having to modify apps for a
    14·1 answer
  • What are the 4-bit patterns used to represent each of the characters in the string "1301"? Only represent the characters between
    14·1 answer
  • A porta power tool is what kind of tool
    9·1 answer
  • Which of the following is a school-to-work program that provides the student with paid employment, school credit, and school gra
    7·2 answers
  • You cannot advance slides during the slide show by pressing the PAGE DOWN key
    12·1 answer
  • Describe 2 health risks posed by computers
    8·1 answer
  • Gabriel's sister called him about a message that suddenly appeared on her screen that says her software license has expired and
    11·1 answer
  • What is the purpose of heading tags?
    15·1 answer
  • 8. Which of the following is an output device
    14·1 answer
  • If I use the command right(90), which way will Tracy turn?<br> If correct I mark brainlist
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!