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)
Pachacha [2.7K]

Answer:

The answers are in the Explination :3

Explanation:

Question 1 - Portrait and Landscape.

Question 2 - Header and Footer

Question 3 - Formatting

Question 4 - Ctrl + Enter

Question 5 - Margins

7 0
2 years ago
A friend is having a problem with keeping a fish tank at the right temperature so the fish stay healthy. Describe how you could
omeli [17]

Answer:

water temperature gauge sensor

Explanation:

  • We can connect a temperature sensor connected to the water and a heater or cooler sensor, we have created a program to check the temperature from the sensor.
  • when the water is hotter than recommended, we turn on the refrigerator and when it is cold, we turn on the heater
  • so correct answer is water temperature gauge sensor

4 0
3 years ago
Enlist the various data analysis methods for study of Infrasonic waves, Seismic waves, Earthquake prone areas and how AI can be
snow_tiger [21]

Answer:

Throughout the clarification segment below, the essence including its query is mentioned.

Explanation:

  • The analytical techniques utilize magnetic fields that allow the waves to be analyzed.
  • They sometimes use echolocation strategies.
  • It is possible to be using artificial intelligence to research potential forecasts. Climate, improvements throughout the climate as well as other things.
  • Like toxic waves, this will be capable of predicting tides.
5 0
3 years ago
In this chapter, you saw an example of how to write an algorithm that determines whether a number is even or odd. Write a progra
vagabundo [1.1K]

Answer:

// Program is written in Java Programming Language

// Comments are used for explanatory purpose

// Program starts here

public class RandomOddEve {

/** Main Method */

public static void main(String[] args) {

int[] nums = new int[100]; // Declare an array of 100 integers

// Store the counts of 100 random numbers

for (int i = 1; i <= 100; i++) {

nums[(int)(Math.random() * 10)]++;

}

int odd = 0, even = 0; // declare even and odd variables to 0, respectively

// Both variables will serve a counters

// Check for odd and even numbers

for(int I = 0; I<100; I++)

{

if (nums[I]%2 == 0) {// Even number.

even++;

}

else // Odd number.

{

odd++;

}

}

//.Print Results

System.out.print("Odd number = "+odd);

System.out.print("Even number = "+even);

}

8 0
3 years ago
Read 2 more answers
Rafael needs to add a title row to a table that he has inserted in Word. What should he do? Use the alignment options. Use the M
raketka [301]

Answer:

Answer is C

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following can be both an input device and an output device? mouse. keyboard. display screen. laser printer .
    9·1 answer
  • How many rows and columns does ms-excel 2007 have???
    10·1 answer
  • Which of the following is a full selector?
    12·1 answer
  • write the cell address for the following 1. First row and first column 2.First column and last row. 3. 10th column and 19th row.
    5·1 answer
  • What is the maximum number of WildFire® appliances that can be grouped in to a WildFire® appliance cluster?
    7·1 answer
  • Name all mario kart games in order
    15·2 answers
  • List the difference between GIGO and bug ​
    15·1 answer
  • What is the correct way to write h1 tag
    12·1 answer
  • Sigma Technology is a company based in Singapore, with branches in 24 countries. It needs multiple CAs in different locations to
    6·1 answer
  • A network of computers that provides access to information on the web.
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!