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
vesna_86 [32]
3 years ago
12

Write three statements to print the first three elements of array runTimes. Follow each statement with a newline. Ex: If runTime

= {800, 775, 790, 805, 808}, print:
800
775
790
Note: These activities will test the code with different test values. This activity will perform two tests, both with a 5-element array (int runTimes[5]). See "How to Use zyBooks".
Also note: If the submitted code tries to access an invalid array element, such as runTime[9] for a 5-element array, the test may generate strange results. Or the test may crash and report "Program end never reached", in which case the system doesn't print the test case that caused the reported message.
#include
using namespace std;
int main() {
const int NUM_ELEMENTS = 5;
int runTimes[NUM_ELEMENTS];
int i;
for (i = 0; i < NUM_ELEMENTS; ++i) {
cin >> runTimes[i];
}
/* Your solution goes here */
return 0;
}
Please help me with this problem using c++.

Computers and Technology
1 answer:
yawa3891 [41]3 years ago
8 0

Answer:

Following are the code to this question:

for (i = 0; i <3; ++i)//defining loop to print value

{

cout<<runTimes[i]<<endl;//print value

}

Explanation:

Full program code to this question:

#include<iostream>//defining header file

using namespace std;

int main() //defining main method

{

const int NUM_ELEMENTS = 5;//defining const integer variable

int runTimes[NUM_ELEMENTS]; //defining integer array

int i;//defining integer variable

for (i = 0; i < NUM_ELEMENTS; ++i)//defining loop to input value

{

cin >> runTimes[i];//input value  

}

cout<<"print three elements value of array: "<<endl;

for (i = 0; i <3; ++i)//defining loop to print value

{

cout<<runTimes[i]<<endl;//print value

}

return 0;

}

Output:

Please find the attachment.

Description:

  • In the above code, an integer const variable "NUM_ELEMENTS" is declared, that assign value "5" which is array size, in the next step, an array "runTimes" is declared.
  • In the next step, for loop is used, that uses an integer variable "i", which is used to input all array elements.
  • In the next line, another for loop is used, which uses "i" variable, which starts from 0 and ends when its value less than 3, inside the loop print method, used that prints 3 array elements.  

You might be interested in
CottonPlus, a sportswear company, is releasing a new casual sportswear line. The company approaches a basketball star to endorse
Airida [17]

Answer: Tactics

Explanation:

  According to the given question, the tactics is one of the type of element of the given program planning that helps in illustrating the given scenario as by using the various types of tactics marketing approach we can easily promote the products in the market.

  • The tactics is one of the legal or authorized element which deals with the new products in the market.
  • In the given scenario, the Cotton Plus is one of the sportswear organization and the main strategy of the company is to approach the basketballs stars for promoting their latest collection.

 Therefore, Tactics is the correct answer.

3 0
3 years ago
The Warn-on-Forecast has been developed by the National Weather Service to help predict hazardous weather earlier. Which of the
allsm [11]

Answer:

Federal agencies will be able to disseminate information to large local communitie

Explanation:

the headquarter of National weather service is responsible for to coordinate weather related warnings to organisations to ensure compatibility and effectiveness of weather services and provide  public protection and safety.

National Weather service entered in the new erra of innovation with use of technology they will be able to disseminate information to large local communitie

5 0
3 years ago
Read 2 more answers
Olivia has developed a great presentation with a distinct purpose and excellent content. She delivered it in a workshop and got
Umnica [9.8K]

less time and depth is required for panel discussions

3 0
3 years ago
On a client/server network, which computer initiates the process of assigning an IP address through DHCP?
Vera_Pavlovna [14]

Answer:

The client

Explanation:

On a client/server network, THE CLIENT computer initiates the process of assigning an IP address through DHCP. This is because "The Client" computer will serve as the Domain controller in which other computers of the network can find. Hence, The Client computer initiates the process of assigning IP addresses through DHCP to achieve this.

Though, in some case. A user can manually assign the IP address to computer if it is not through DHCP

4 0
3 years ago
Dealing with stress and strong emotions centeral idea​
STatiana [176]
The best way to deal with psychological stress is to learn to control your reactions to stressful situations. With practice, you can teach yourself how to remain calm and avoid making bad situations worse. Slow, deep breathing is one way to keep stress from overwhelming you.
Make me the brainlist
5 0
3 years ago
Read 2 more answers
Other questions:
  • Computer programmers often use binary codes (strings of 1s and 0s) to write programs for computers. These codes are then changed
    6·1 answer
  • Which wireless communication technology is most likely used when synchronizing device information to an automobile?
    9·1 answer
  • How to make changes to a file on the USB drive
    6·2 answers
  • What type of network is capable of delivering voice, video streams, text, and graphics between many different types of devices o
    15·1 answer
  • Please Help!! How to code this in Python?
    11·1 answer
  • What devices gives input​
    5·1 answer
  • Community gardens are public gardens where local residents can grow plants in a plot. They are very popular, so there are often
    7·1 answer
  • PLSSSSS HELPP!! Tropical rainforests are home to many kinds of birds, including parrots, toucans and eagles. Each different spec
    9·2 answers
  • The computer scientists Richard Conway and David Gries once wrote: The absence of error messages during translation of a compute
    7·1 answer
  • What does an arrow after a command indicate
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!