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
Is 583 a string or a number?
Rasek [7]
It is a number that is the answer
3 0
4 years ago
Read 2 more answers
Is designed to access a computer or operating system without the knowledge or permission of the user.
kramer

Answer:

Spyware

Explanation:

Spyware is a type of program that is installed with or without your permission on your personal computers to collect information about users, their computer or browsing habits tracks each and everything that you do without your knowledge and send it to remote user.

5 0
2 years ago
Electronic age,what format/equipment people use to communicate with each other?​
uranmaximum [27]

Answer:

They share or broadcast information by making a letter or information in a papyrus material. in industrial age they use Telegraph or typewriter to communicate each other.

4 0
3 years ago
Read 2 more answers
QUESTION 3 / 10
Deffense [45]
A.keeping track of how much you have spent is simple
6 0
3 years ago
The type of e-cards that have an antenna built into them are __________ cards.
maw [93]
Contactles..........................................................
3 0
3 years ago
Read 2 more answers
Other questions:
  • What does carefully controlled research on cell phone conversations suggest about hands-free devices?
    7·1 answer
  • On a hard disk each track is divided into invisible wedge-shaped sections called _______
    15·1 answer
  • This LEGENDARY character made a much-celebrated comeback in 2017. What was the name of the villain he faced in this epic tale?
    7·2 answers
  • A developer needs to create a visualforce page that displays case data. The page will be used by both support reps and support m
    10·1 answer
  • Consider the classes below:
    13·1 answer
  • Which of the following was (and still is) used by computer programmers as a first test program?
    13·2 answers
  • Recently mobile phones have been used to pay for goods in stores and supermarkets. One method
    11·1 answer
  • Write a program code to accept the names of 3 users and generate a user name as shown in the example. Accept the name of 3 user
    9·1 answer
  • For a single CPU core system equipped wiith addditional hardware modes (besides user and kernel), choose those items that are ex
    7·1 answer
  • When users connect to the network, they use a basic hardware terminal to access a desktop hosted on a virtualization server. wha
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!