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
enyata [817]
3 years ago
9

Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards

, then backwards. End each loop with a newline. Ex: If courseGrades = {7, 9, 11, 10},
print:
7 9 11 10
10 11 9 7

Hint: Use two for loops. Second loop starts with i = NUM_VALS - 1.

#include

int main(void) {
const int NUM_VALS = 4;
int courseGrades[NUM_VALS];
int i = 0;
courseGrades[0] = 7;
courseGrades[1] = 9;
courseGrades[2] = 11;
courseGrades[3] = 10;

/* Your solution goes here */
return 0;
}
Computers and Technology
1 answer:
konstantin123 [22]3 years ago
4 0

Answer:

for(i = 0 ; i < NUM_VALS; ++i)

{

   cout << courseGrades[i] << " ";

}

cout << endl;

for(i = NUM_VALS-1 ; i >=0 ; --i)

{

   cout << courseGrades[i] << " ";

}

cout << endl;

Explanation:

The first loop initializes i with 0, because we have to print the elements in order in which the appear in the array. We print each element, adding a space (" ") character at its end. After the loop ends, we add a new line using endl.

The second loop will print the values in a reverse order, so we initialize it from NUM_VALS-1, (since NUM_VALS = 4, and array indices are 0,1,2,3). We execute the loop till i >= 0, and we print the space character and new line in a similar way we executed in loop1.

You might be interested in
A computer ____ is the amount of data (measured in bits or bytes) that a cpu can manipulate at one time
garik1379 [7]

A computer BIT is the amount of data that a CPU can manipulate at one time.

8 0
3 years ago
A _______ is a particular type of report that is made up of strategic objectives and metrics to help the organization reach its
Reika [66]

Answer:

A balanced score card is a particular type of report that is made up of strategic objectives and metrics to help the organization reach its target measures in line with strategic goals

Explanation:

A balanced scorecard is a framework for strategic planning and performance , which be presented in the form of a report.It clearly outlines organizational goals into measurable quantities such as time, quality of service or product, performance and cost. With a balanced scorecard, the organization can set a strategy and measure it and then effectively monitor and track the progress and results of the strategy.

5 0
4 years ago
A firewall filters traffic.true or false
valentinak56 [21]
Its TRUE firewalls filters traffic
Firewall is a network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules.Firewall typically establishes a barrier between a trusted internal network and untrusted external network such as the internet.
4 0
3 years ago
WILL GIVE 50 POINTS AND GIVE BRAINIEST TO THE FIRST PEOPLE THAT ANSWER CORRECTLY!!!!!! Luis receives a workbook from a classmate
k0ka [10]

Answer:

the third one

Explanation:

4 0
4 years ago
Read 2 more answers
Many web browsers include _________ tools to make it easier for designers to locate the source of a style that has been applied
nordsb [41]

Answer:

c. developer

Explanation:

DEVELOPER TOOLS are tools that enables designers to easily and quickly edit web page and as well diagnosed issues or problem on a website which will inturn enables them to build a great and better websites without stress reason been that when a designer makes use of DEVELOPER TOOLS they can quicky track down and as well fix the problem that was diagnosed within a minute or seconds thereby saving time when developing a website profile.

8 0
3 years ago
Other questions:
  • The checksum doesn't compute for a packet sent at the Internet Protocol (IP) level. What will happen to the data?
    14·1 answer
  • Describe the Sign in process of an Email account.​
    6·1 answer
  • 3. By default, Blender® remembers your last 32 actions and allows you to undo them one at a time by pressing CTRL+Z. (1 point)
    9·1 answer
  • An _____ is a narrow strip of land connecting two larger land areas.
    13·1 answer
  • If you sort a portion of an Excel sheet and you get an error message such as #DIV/0, what is a likely cause of the error message
    9·1 answer
  • Create the code that will find
    11·1 answer
  • Who wants brainlyest! NO LINKS how do you message someone on brainly
    10·2 answers
  • Which areas of a business would most benefit from using the Workday platform?
    7·1 answer
  • For any element in keysList with a value smaller than 40, print the corresponding value in itemsList, followed by a comma (no sp
    6·1 answer
  • 5 points)*list all of the data that needs to be kept track of for the scenario above in a 1nf (flat file) table (20 points)*use
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!