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
How can learning opportunities for AI be extended to all
statuscvo [17]

Answer:

Learning opportunities for AI can be extended to all through the inclussion of courses and different teaching methods related to Artificial Intelligence, new technologies, computer science, programming and, in short, everything related to the digital world, in the educational plans at the national level. This is so because artificial intelligence and computer systems are the basis for the development of the new tools jobs of tomorrow. Thus, education in these subjects is essential so that citizens can enter the labor market once they acquire the necessary age, having the knowledge to do so in a proper way.

6 0
2 years ago
If you press the Tab key when you're in in the last cell of a table,
KengaRu [80]
The answer is B.

If you press the tab key when you're in the last cell of a table, you will add a new blank row
8 0
3 years ago
Read 2 more answers
Write two separate formulas using different commands that concatenate " john and "smith" together to form " John Smith"
VladimirAG [237]

Answer:

1. =CONCATENATE(" John"," ","Smith")

2. =(" John"&" "&"Smith")

Explanation:

Given

Two separate strings; "John" and "Smith"

Required

2 separate formulas to concatenate both strings to form " John Smith"

There are several ways to concatenate strings in Microsoft Office Excel; one of the methods is using the concatenate function while the another method is using the traditional & operator.

Using the concatenate function, the formula is as follows

=CONCATENATE(" John"," ","Smith")

This function will combine the " John", " " and "Smith" to give a new string " John Smith" (without the quotes).

Using the traditional & operator may be a little bit difficult (and not frequently used) but the formula is as follows;

=(" John"&" "&"Smith")

The result will be the same as (1) above

5 0
2 years ago
Ms. Rogers wants to see the names of all the students who scored below 25 on the test. Which of these custom options will help h
photoshop1234 [79]
B Is less than because it says below

6 0
3 years ago
A router has a valid operating system and a configuration file stored in nvram. the configuration file contains an enable secret
Makovka662 [10]
The answer is user EXEC mode. This is for setting, viewing, and testing system processes. In common, the user EXEC commands let you to link to remote devices, modify terminal line settings on a temporary basis, perform basic tests, and list system information. This also used by common system administrators, while the privileged EXEC mode is used by the root administrator. Use the enable and disable instructions to shift between the two levels. Access to the user-level EXEC command line needs a valid password.
8 0
3 years ago
Other questions:
  • Describe the indicators and hazards of a metal deck roof fire in an unprotected steel joist warehouse as well as the techniques
    6·1 answer
  • Kurt is editing a table in his powerpoint that displays accounting formulas and when to use them. he wants to remove the table s
    15·1 answer
  • 3.What is deep focus, and when is it a good choice for a scene?
    8·1 answer
  • Mass production usually uses an _______________ ____________ or production line technique.
    7·1 answer
  • A drop-down menu must be contained by
    5·1 answer
  • Fundamental types of data, such as strings, integers, and real numbers, are known as
    5·1 answer
  • What options of the hierarchical star topology within the ANSI/TIA-568-C allow the ability to move the workgroup switches closer
    7·1 answer
  • 1. A tachometer measures:
    8·1 answer
  • Why bootable installer preparation is important? explain
    9·1 answer
  • Computer instructions are converted to binary when executed. Binary numbers use which set of digits?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!