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
A student dissolves some solid sodium hydroxide in a beaker of water.
STALIN [3.7K]
C water is the soulute
7 0
3 years ago
Read 2 more answers
Consider the formula: G=D+(A+C^2)*E/(D+B)^3 Show the order that a processor would follow to calculate G. To do so, break down th
motikmotik

Answer:

1. G=D+(A+C^2)*E/(D+B)^3

cobegin:

p1: (D+B)

p2: p1^3

p3: C^2

p4: A+ p3

p5: E/p2

p6: p4 * p5

p7: D + p6

   :G

coend

2. Now The value A=2, B=4, C=5, D=6, and E=8

p1: 6+4 =10

p2: p1 ^3= 10^3= 1000

p3: c^2= 5^2 =25

p4: A + p3= 2 +25 =27

p5: 8/1000

p6: 27 *8/1000

p7: D+ P6= 6+ 216/1000

      = 6216/1000

      =6.216

Explanation:

The above, first bracket with power is processed, and then power inside and outside bracket. And rest is according to BODMAS, and one process is solved at a time.

4 0
3 years ago
Why is it important to enforce access controls and to keep logs regarding who has access to data closets
vlada-n [284]

Answer:

To ensure that in the event of a failure or breach, there is a record of when the equipment was accessed.

Explanation:

Hope this helps:)....if it don't then sorry for wasting your time and may God bless you:)

8 0
3 years ago
Read 2 more answers
What is wrong with the formula below?<br><br> SUM(A1:A5)/SUM(B1:B5)
Vlad [161]

Answer:

You forgot the "=" sign.

Explanation:

formulas in excel start with an "="

=SUM(A1:A5)/SUM(B1:B5)

4 0
4 years ago
You don't have to answer them all, just give me 2 or 3. Thanks
frozen [14]

Answer:

5. iOS and Android are some popular OS’.

Explanation:

4 0
3 years ago
Other questions:
  • Which of these jobs would be most appropriate for someone who majors in computer engineering? I need the answer ASAP Helping com
    14·2 answers
  • A broadcast network is one in which a transmission from any one attached station is received by all other attached stations over
    10·1 answer
  • Each brochure template produces _____ pages of graphics, business information text boxes, and story boxes.
    15·1 answer
  • As a graphic designer, you'll refer to a line as which of the following? A. Point B. Border C. Rule D. Frame
    9·2 answers
  • Most sim cards allow ___________ access attempts before locking you out.
    10·1 answer
  • What is an advantage and disadvantage to file compression
    8·1 answer
  • “Artificial intelligence is the tool of education in the near future”. Research on the possibility of “AI technology” in scienti
    15·1 answer
  • Complete function PrintPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 2, print "To
    5·1 answer
  • Which of the following statements is TRUE of business intelligence (BI) systems? Business intelligence systems are primarily use
    7·1 answer
  • An input value has to be greater than 18 and less than 65 if a driving license is to be approved for issue. What type of input c
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!