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
Mumz [18]
3 years ago
11

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
Computers and Technology
1 answer:
expeople1 [14]3 years ago
6 0

Answer:

#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--)

You might be interested in
Help me this questions I will Brainly the one who correct them all .
Eddi Din [679]
Nice question will answer wait
7 0
4 years ago
Create and integrate a script on the registration.html page that stores the input field data into hidden fields to be used in th
Pavel [41]

Answer:

Explanation:

// CAPTURE QUERY STRING VALUES

var urlParams = new URLSearchParams(location.search);

var uid = urlParams.get('userName');

var fName = urlParams.get('firstName');

var lName = urlParams.get('lastName');

var pass = urlParams.get('password');

var email = urlParams.get('email');

var phone = urlParams.get('phoneNumber');

var signUp = urlParams.get('signUpNewsletter');

=====================================

Modified the checkbox control into multiple control

<div>

<select id="interests" name="interests" multiple>

<option value="Technology">Technology</option>

<option value="Music">Music</option>

<option value="Movies">Movies</option>

</select>

</div>

==================================

Added a js function to read multiple input values

function getSelectValues(select) {

var result = [];

var options = select && select.options;

var opt;

for (var i=0, iLen=options.length; i<iLen; i++) {

opt = options[i];

if (opt.selected) {

result.push(opt.value || opt.text);

}

}

return result;

}

==============================

Below is how I create cookie object

ar data =

{

uid:document.myForm.userName.value,

fName: document.myForm.firstName.value,

lName: document.myForm.lastName.value,

pass: document.myForm.password.value,

email: document.myForm.email.value,

phone:document.myForm.phoneNumber.value,

signUp: document.myForm.signUpNewsletter.value,

interests: getSelectValues(document.myForm.interests).toString(),

comment: document.myForm.comment.value,

referredBy: document.myForm.referredBy.value,

};

var dataString = "uid=" + data.uid + ",fName=" + data.fName + ",lName=" + data.lName + ",pass=" + data.pass + ""+ +",email=" + data.email + ",phone=" + data.phone + ",signUp=" + data.signUp + ",interests=" + data.interests + "" + +",comment=" + data.comment + ",referredBy=" + data.referredBy + "";

===========

Make sure you write last line in single line

3 0
3 years ago
Select the correct answer.
IrinaK [193]
The answer is the letter (D)
4 0
3 years ago
John is selling his pizza for $6 per slice in an area of high demand. However, customers are not buying his pizza.
lesya692 [45]
I think John could lower the price of his pizza. He could also put out advertisements. One more thing John could do is increase options for people to customize their pizza.

7 0
3 years ago
Read 2 more answers
The internet has made worldwide access to networks and information simpler and faster. This access comes with both benefits and
igor_vitrenko [27]
Information will be easier to access, but that info has a slight chance of being downright wrong. Also, very technical info will be unavailable.
6 0
3 years ago
Other questions:
  • You picked the corridor which led you here. If the guards find you, they're going to be really ANGRY! What is the synonym of ANG
    5·2 answers
  • Use both if and else may contain only one statement, you would have to use a ______ if you want to use more than one instruction
    14·1 answer
  • 20
    14·1 answer
  • Which of the following identifies the goods or services of a
    15·2 answers
  • As a student, why do you need to know and follow the steps printing a <br><br>document?​
    6·2 answers
  • 3. Comparing the Utopian and dystopian views of Technology according to Street (1992) which one in your view is more applicable
    9·1 answer
  • Match the order in which you should develop a plan:
    7·1 answer
  • What is the total running time of counting from 1 to n in binary if the time needed to add 1 to the current number i is proporti
    5·1 answer
  • Can anyone talk to me?
    9·2 answers
  • What is the most important person and why
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!