![alexabessin](/avatars/13307.jpg)
alexabessin
11.03.2020 •
Computers and Technology
Write a for loop to print all NUM_VALS elements of vector 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 using namespace std;int main() {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
Solved
Show answers
More tips
- S Sport How to Get Rid of Belly Fat: Easy Way to Achieve the Perfect Figure...
- F Family and Home When and how to start introducing solid foods to your baby?...
- B Business and Finance Moneybookers – What it is and How it Works...
- C Computers and Internet How to Format Your C Drive: Detailed Guide and Tips...
- F Food and Cooking What can and cannot be eaten during Lent?...
- H Health and Medicine What to Do When Your Jaw Locks Up?...
- F Family and Home Why Having Pets at Home is Good for Your Health...
- D Dating, Love, Relationships Is it a Compliment or Flattery: What s the Difference?...
- S Science and Technology The Metric System in Our Daily Life: Understanding Its Importance...
- C Computers and Internet What to Do If Your ICQ Gets Hacked?...
Answers on questions: Computers and Technology
- C Computers and Technology When configuring the iSCSI storage adapter for an ESXi host, you must pick the vSwitch that will be used for the communication between the ESXi host and the iSCSI server....
- C Chemistry When 1,3,5-cycloheptatriene is treated with the powerful hydride (H-) acceptor triphenylmethyl fluoroborate, a light yellow water-sensitive salt A, C7H7BF4, is formed. Draw...
- P Physics The potential difference between two charged, parallel plates is 200 V and the distance between the plates is 360 cm. Calculate the electric field strength between the plates....
- B Business requires an insurance policyholder to pay a percentage of a loss, and the insurance company pays the remaining cost. A. Insurance B. Coinsurance C. An insurance policy D....
- B Business A credit card company uses information about each customer s age, gender, income, and past credit history to find patterns that make customers a poor credit risk. This company...
- S Social Studies Every open-sided floor or platform that rises four feet or more above the adjacent floor must be protected on all open sides by a standard railing. If there is moving equipment...
- H History Which civilizations were located on the banks of the Nile River? Select the best answer from the choices provided. A. Egypt, Ghana, Mali B. Egypt, Kush, and Axum C. Egypt,...
- S Social Studies You have familiarized yourself with the streets of your town without any reinforcement; then one day you are asked to go to the post office. You are able to do so with ease...
- B Business Create a sub program that will calculate the interest rate required given a present investment, the desired future value, the number of years for this investment, and the...
- M Mathematics The teacher has a mystery spinner. The teacher spins it and gets the following colors: purple, pink, purple, purple, blue, pink, pink, purple, blue, silver, purple, pink What...
Ответ:
#include <iostream>
using namespace std;
int main()
{
int courseGrades [ ] = {7, 9, 11, 10};
for(int i =0; i<4; i++){
cout<<courseGrades[i]<<" ";
}
for(int j = 3; j>=0; j--){
cout<<courseGrades[j]<<" ";
}
}
Explanation:
Using C++ programming language
Create the array vector and assign values with this statement int courseGrades [ ] = {7, 9, 11, 10};
The first for loop prints the values from 0-4 (Since four values are given and hard coded) for(int i =0; i<4; i++)
The second for loop prints from the last to the first element (i.e reversed) for(int j = 3; j>=0; j--)
Ответ:
1/2 mile
Step-by-step explanation:
If you add 1/4 and 1 3/4, you get 2. Then, subtract 2 1/2-2=1/2