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
True or false? LearnSmart (the "smart flash card assignments") really gets your competitive spirit in gear by allowing you to se
vfiekz [6]
<h2>Answer:</h2>

The following statement is TRUE.

LearnSmart (the "smart flash card assignments") really gets your competitive spirit in gear by allowing you to see where you stand as compared to your classmates in terms of your mastery of grammar and vocabulary concepts.

<h2>Explanation:</h2>

LearnSmart is an adaptive technology that is helping a lot of students by letting them judge which parts/topics of the book are not clearly learnt by them and which of them are under their grip.

LearnSmart provides cards with short term questions that make i possible for students to complete their preparation in short time. In addition to this smart flash card assignments are a to compare students preparation relatively.

<h3>I hope it will help you!</h3>
4 0
3 years ago
jenny wants to create a resume after a two year gap. what should she consider? jenny has a two year gap between her last two job
Lunna [17]

Answer:

functional

Explanation:

Suppose you are pivoting to a certain new company, and you find that your experience is not suited. You are certainly going to highlight your skills that are required for the job. And suppose you are lacking work experience, concerning the position you are opting for. Also, you have many gaps in employment. Then the best format suited to you is functional format.

6 0
3 years ago
Read 2 more answers
Your client noticed that his ad was disapproved for editorial reasons. Why is it important for him to understand and abide by Go
astra-53 [7]

Answer: Ad Words policies can help ensure ads are useful, varied, relevant, and safe for web users

Explanation: Google Ads do have a policy for the ad display which requires that the ads should be secured, relevant and safe for the users on the web. Google Ads positively review every Ads that is created or has been changed in some terms as their policy. It maintains the standard and relevancy on the web and no objectionable content gets posted .

This might be the reason that the client's ads are disapproved because he/she is not aware of the Google's ads policies.

3 0
3 years ago
A programmer needs to understand sequencing to determine whether the order of steps will affects the outcome of the program.
professor190 [17]

Answer:

true

Explanation:

Based on the information provided within the question it can be said that this statement is completely true. Programming code is built as a series of steps that are followed in a linear way. So much so that one action needs to be completed before another action can begin. There are also conditions such as, if step 1 is true then execute step 2, these are all sequences that must be understood by the individual writing the code.

5 0
3 years ago
Bobby is investigating how an authorized database user is gaining access to information outside his normal clearance level. Bobb
Sveta_85 [38]

Answer:

Aggregate Function .

Explanation:

The aggregate function returns the single value of the entire column of the database management system. The Aggregate Function is used in the SELECT statement and the GROUP BY clause.  

The sum(),avg(), etc are some examples of Aggregate Function in the database with the help of aggregate function bobby gains the access to information above the usual clearance point. and summarizes the data.

7 0
3 years ago
Other questions:
  • Which company provides the Loki Wi-Fi mapping service?
    10·1 answer
  • How do you design video games
    5·1 answer
  • Is using abbreviations and symbols in social media a problem? Why or why not?
    11·1 answer
  • Under what circumstances are composite primary keys appropriate?
    5·1 answer
  • In what year was google launched on the web?
    14·1 answer
  • John has subscribed to a cloud-based service to synchronize data between his smartphone, tablet, and PC. Before allowing the dat
    10·1 answer
  • Write a brief, two-page paper describing how your lifestyle and values impact your use of the Web for e-commerce. How is your on
    15·1 answer
  • I am a bacterium. I cause stomach cramps and diarrhea. I am caused by eating rotten foods
    7·2 answers
  • 15. You read a news article that's politically biased and not well organized. It's
    6·1 answer
  • "kannst du mir bitte helfen" in German-English from Reverso Context: Hier, kannst du mir bitte helfen?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!