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
patriot [66]
3 years ago
5

9.1.3: Printing vector elements with a for loop. Write a for loop to print all NUM_VALS elements of vector courseGrades, followi

ng each with a space (including the last). Print forwards, then backwards. End with newline. Ex: If courseGrades
Computers and Technology
1 answer:
svlad2 [7]3 years ago
8 0

Answer:

The program to this question as follows:

Program:

#include <iostream> //defining header file

#include <vector> //defining header file

using namespace std;

int main() //defining main method

{

//defining integer variable NUM_VALS and i.    

int NUM_VALS = 4,i;//assign value in NUM_VALS variable

vector<int> courseGrades(NUM_VALS); //defining vector array

cout<<"Input values: "; //print message

for(i=0;i<NUM_VALS;i++) //loop for input value

{

//input value in verctor array    

cin>>courseGrades[i]; //input from user-end

}

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

{

cout<<courseGrades[i]<< " ";//print value

}

cout << endl;//for new line

for (i = NUM_VALS-1;i >= 0;i--)//loop to print value in reverse order

{

//print value in reverse order

cout << courseGrades[i] << " "; //print value

}

cout << endl; //for new line

return 0;

}

Output:

Input values: 2

3

5

6

2 3 5 6  

6 5 3 2  

Explanation:

In the above-given code two integer variable "NUM_VALS and i" is declared, in which variable "NUM_VALS" assigns a value, that is 4, in the next step, a vector array "courseGrades" is defined, in which we take input from the user end.

  • In the next step two for loop is declared, in the first loop we simply print the value of the "courseGrades".
  • The second loop is also used to print the "courseGrades" value but, in the reverse order.
You might be interested in
When planning your website, what is one of the key things you should consider
Alex_Xolod [135]

You should definitely consider what kind of audience you are appealing to. For example, if you were running a business based on cosmetic products you may want to focus your website on self-care and makeup tips rather than something like cooking. By making your website direct about what you offer, the better the audience will understand. This will make your website succeed. Hope this helped :))

4 0
2 years ago
Read 2 more answers
To communicate with coworkers in the office
Elanso [62]

For effective communication to occur, everyone must trust and respect each other. ... Clear and concise communication will allow your colleagues to understand and then trust you. As a result, there will be more cooperation and less conflict in the workplace.

8 0
3 years ago
Create a medical report for Wellness Hospital. Mention the hospital name as the heading and the report name as the subheading. T
IrinaK [193]

Some things to consider when preparing a medical report are:

  1. Informed consent of the patient
  2. Physical examinations of the patient
  3. Background information
  4. Obtained specimens
  5. Medical history, etc.

<h3>What is a Medical Report?</h3>

This refers to the very detailed report that contains an account of a person's full clinical history.

Therefore, a sample medical report is given below:

  • Name of Hospital: Mellview Hospital
  • Address: 27, Hemingway Close, London
  • Gender: Male
  • Name: Oscar Pedrozo
  • HIV test, Malaria test, High Blood Pressure, etc.

Read more about medical reports here:

brainly.com/question/21819443

#SPJ1

5 0
2 years ago
Compared with traditional methods, the entire rapid application development (RAD) process is expanded and, as a result, the new
tensa zangetsu [6.8K]

Answer:

<u>False</u>

Explanation:

Note, the Rapid Application Development (RAD) software development approaches are noteworthy not for its expanded design details but for <u>its simplicity of the software development process.</u>

In other words, the RAD approaches while taking user preferences into the software development process, focuses on making the software design process more flexible, such as by employing the use of prototypes, and less unnecessary details.

5 0
2 years ago
Describe the concepts of confidentiality, integrity, and availability (C-I-A), and explain each of the seven domains of a typica
GREYUIT [131]

Answer:

Answer explained below. The remaining part of the question is incomplete

Explanation:

The concepts of confidentiality, integrity, and availability (C-I-A) can be explained in following given points.

1) Confidentiality: Its basically refer to the confidentiality of the information. Here we can think about the protection of the information from unauthorized person. Confidentiality enuser that at what level your information is secured and no unauthorized access will be done to the information. For maintaining the confidentiality, we can use various encryption methods. The main concept of confidentiality is to enforce various techniques like encryption, file permissions and access control to restrict access to important information.

2) Integrity: Integrity of the information refer to the unwanted modification of the information. Integrity of the data as well as the information should be maintained and only the autorized person can access as well as modify the information. For enforcing the integrity, we can implement various hashing techniques on information.

3) Availability: Availability refers to the availability of the information, when ever an autorized person requests for the information. High availability of the information should occur, so that any autorized person can access it, when ever its required. For high availability, we can create backup as well as replicate the data across the geo sites.

Seven domains of a typical IT infrastructure are given below:

1) User Domain: Its refer to the group of users as well as the person who access the information systems.

2) LAN Domain: Refer to the local area network, where various computers are connected to each other.

3) Workstation Domain: The area is called workstation, where various users connect to the IT infrastructure.

4) WAN and LAN link domain: Refer to the connection of local area network to wide area network.

5) WAN domain: Refer to the wide area network, connection of computers in large area.

6) Storage Domain: Refer to the storage, where we store the data.

7) Remote Access Domain: Refer to the domain where mobile user can access the local as well as wide network remotely.

8 0
3 years ago
Other questions:
  • EBay buyers voluntarily comment to other users and sellers on the quality of service, promptness of shipping, and their general
    5·1 answer
  • All of the following are qualities of an aprenticeship except
    12·1 answer
  • What is the service provided by a third party (such as an ISP) that enables you to connect another cloud directly to your Google
    15·1 answer
  • One of the advantages of off-the-shelf software is that ________________. a. the software contains important features, thus elim
    13·1 answer
  • Why is charles babbage known as father of computer?​
    10·1 answer
  • It is possible to limit the search results to a range of publication dates.
    13·1 answer
  • Information management should supply information in the form of meaningful images rather than raw data, which requires that we h
    13·1 answer
  • The number of pixels displayed on the screen is known as ________.
    13·1 answer
  • A. Get a value for x from the user.
    13·1 answer
  • Which is NOT true?<br> 9 + 4 = 17 - 4<br> 8 + 7 = 14 + 3<br> 11 = 19 - 8<br> 5 + 8 = 20 - 7
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!