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
Question 1 (1 point)
Annette [7]

Answer:

All of the answers

Explanation:

5 0
2 years ago
In round-robin scheduling,a) the time quantum should be larger than the context switch time. b) the time quantum should be as sm
pickupchik [31]

Answer: d. the time quantum should be as small as possible.

Explanation: Round robin is a CPU scheduling algorithm. If the time quantum is extremely small, number of context switches is very high, round robin scheduling will be same as processor sharing algorithm. Then the algorithm is good. Very large time quantum will make response time of processes too much which may not be tolerated in interactive environment.

3 0
3 years ago
George wants to pursue a career in web technology as a web developer. Which certifications can help him as a web developer?
skelet666 [1.2K]

Answer:Google Analytics IQ.

he can use this

Explanation:

3 0
3 years ago
The___ allows you quickly access features such as formatting, charting, tables, and totals
cricket20 [7]

Answer:

Quick Analysis toolbar

Explanation:

it appears with the options formatting, chart, total, table, sparklines

7 0
3 years ago
6. You and your friends take an awesome selfie, and you add your name and addresses to the picture. It is a good idea to share t
Trava [24]

Answer:

family and friends you trust

3 0
3 years ago
Other questions:
  • What is an advantage of sharing documents in PDF format instead of Word format?
    6·2 answers
  • 2. Suppose you want to write a method that prints a heading on a new output page, along with a page number that is 1 in the firs
    15·1 answer
  • Data ____ travel over the Internet from router to router until reaching their destinations.
    7·1 answer
  • Which of the following attacks seeks to introduce erroneous or malicious entries into a server's hostname-to-IP address cache or
    5·1 answer
  • Multiple arrays. Jump to level 1 For any element in keysList with a value greater than 40, print the corresponding value in item
    7·2 answers
  • Given an char variable last that has been initialized to a lowercase letter, write a loop that displays all possible combination
    8·1 answer
  • 5. Compare the telephone network and the internet. What are the similarities? What are the differences?
    12·1 answer
  • Even though jdoe and jrock have the same password (i.e., hacker), their password hashes in the /etc/shadow file are different. W
    15·1 answer
  • Trojans depend on ________ to spread. A rootkits B self-replication C code injection D social engineering
    14·1 answer
  • Once you select a theme, you__________ change the theme’s individual elements independently of each other.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!