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
The different types of variation of genes are called.
Dmitry [639]

Answer:

The different types of variation of genes are called <em>Alleles</em>.

Explanation:

brainliest pleaseeeeee <3

4 0
3 years ago
____ refers to the order in which values are used with operators.
mylen [45]

Answer:

b. Associativity

Explanation:

Associativity specifies the order in which operators are processed vis a vis operands/values in an expression. For example: Consider the expression: a + b + c. Here a + b is evaluated first before adding the result with c as the '+' operator is left associative. The default associativity can also be overridden by the use of parentheses. For example a + (b + c) . In this case b+c will be evaluated first.

5 0
3 years ago
What medium allows for electronic delivery of DTP content without the need for any physical media?
Lostsunrise [7]
Email? Dropbox?...Not sure give one of these a try? Hope this helps
0 0
3 years ago
What is the output of the following code?<br> print (12 // 6)
sveta [45]

Answer:

2

  • See here we have //
  • // means floor division in python.
  • It gives us only the integer part not floating or decimal.

So

12//6=2

8 0
3 years ago
Which of the following may present a problem for Linux users?
motikmotik
Tendancy to crash hope that helped
6 0
4 years ago
Read 2 more answers
Other questions:
  • What key combination in excel takes you back to the first cell
    7·1 answer
  • Which term represents a computational instruction stored in computer memory?
    13·2 answers
  • Select the correct answer.
    5·1 answer
  • Before entering a road from an alley or driveway, you must:Flash your high beam headlights 
    13·1 answer
  • 14. Which now-established technology went through the “emerging” phase in the early 2000s and makes the sharing of ideas much ea
    7·1 answer
  • The five steps in the fetch/execute cycle and how do they correspond to a restaurant
    5·1 answer
  • A cost-benefit analysis is intended to increase the likelihood that a support analyst has considered the major advantages and di
    5·1 answer
  • Publishers that participate in a display ad network _____ a) get paid each time an advertiser is charged by the ad network for d
    7·1 answer
  • If there is only a stop sign posted at a railroad
    9·1 answer
  • What function does an extranet perform?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!