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
What is computer and its features<br>​
dlinn [17]

Answer:

A computer is a machine that can be programmed to manipulate symbols.

Explanation:

Following are the features of PC (computer)

Processor  

speed  

reliability  

accuracy  

automation  

diligence  

consistency    

Random access memory (RAM)  

Operating system  

Graphics adapter and video RAM  

Monitor

3 0
3 years ago
Read 2 more answers
Which of the following are important for protecting computing devices and systems? Physical safeguards like a secure space prote
Elenna [48]

Answer: All of the above

Explanation:

All the above listed point serves as security measures to safeguard our computing devices and systems.

4 0
3 years ago
Laura is in the middle of making a presentation. On one slide, she includes a heading, three subheadings, and three bullet point
Nat2105 [25]

The first one us d....


6 0
2 years ago
Read 2 more answers
Ransomware as a service has allowed the increase of:.
Montano1993 [528]

Ransomware as a Service has allowed the increase of ransomware infections globally.

<h3>What is a Ransomware as a Service?</h3>

Ransomware as a Service is a type of business association between ransomware operators and affiliates. These affiliates pay to launch ransomware attacks developed by operators.

A ransomware is a type of malicious software that infects the computer of an organization thereby restricting access to their important data unless an amount of money is paid.

Ransomware as a Service has allowed the increase of ransomware infections globally because this business model has allowed malware creators to earn from their ransomware by enlisting a network of distributors.

Therefore, ransomware as a service has allowed the increase of ransomware infections globally.

Learn more about ransomware here:

brainly.com/question/23294592

6 0
2 years ago
Why is it important to use a high sample rate when recording sound?
damaskus [11]

Answer:

jt baby

Explanation:

yup

3 0
2 years ago
Other questions:
  • You will write a program that reads a binary file that contains records of creatures. Each record can be stored in a Creature st
    10·1 answer
  • Create the following matrix M: 1 7 13 19 25 ?-3 9 15 21 27 5 11 17 2329By writing one command and using the colon to address ran
    8·1 answer
  • How do you customize Track Changes in a text document?
    11·1 answer
  • What are some of the benefits of project
    7·1 answer
  • In relation to data science,advances in technology has made it more feasible to do what
    5·1 answer
  • When you go to a website, your web browser requests a web page from:
    11·1 answer
  • A _____ is sent to companies that are hiring to get an interview. résumé brochure business report newsletter plz hurry need it n
    13·2 answers
  • HURRRY WILLL GIVE BRAINLIST!!!!!!
    12·1 answer
  • What are logic gates ?​
    10·2 answers
  • The current in a resistor is 5.0 A, and its power is 60 W. What is the voltage?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!