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
balandron [24]
3 years ago
14

Write a for loop to print all NUM_VALS elements of array hourlyTemp. Separate elements with a comma and space. Ex: If hourlyTemp

= {90, 92, 94, 95}, print: 90, 92, 94, 95 Your code's output should end with the last element, without a subsequent comma, space, or newline. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #include using namespace std; int main() { const int NUM_VALS = 4; int hourlyTemp[NUM_VALS]; int i; for (i = 0; i < NUM_VALS; ++i) { cin >> hourlyTemp[i]; } /* Your solution goes here */ cout << endl; return 0; } 1 test passed All tests passed Run
Computers and Technology
1 answer:
MA_775_DIABLO [31]3 years ago
8 0

Answer:

  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.    const int NUM_VALS = 4;
  6.    int hourlyTemp[NUM_VALS];
  7.    int i;
  8.    
  9.    for (i = 0; i < NUM_VALS; ++i)
  10.    {
  11.        cin >> hourlyTemp[i];
  12.        
  13.    }
  14.    
  15.    /* Your solution goes here */
  16.    for(i = 0; i < NUM_VALS; ++i){
  17.        
  18.        if(i < NUM_VALS -1){
  19.            cout<<hourlyTemp[i]<<",";
  20.        }
  21.        else{
  22.            cout<<hourlyTemp[i];
  23.        }
  24.    }
  25.    cout << endl;
  26.    return 0;
  27. }

Explanation:

The solution code is given from Line 18 - 26. To print the element from array one after another, we create a for loop to traverse through every element in the array (Line 18). Create an if condition to check if the current index i is not the last index, print the element followed with a comma (Line 20 -22). Otherwise print only the element (Line 23 - 25).

You might be interested in
You can get context-sensitive help information from the code editor by
Drupady [299]
Visual Studio* IDE Code Editor.
8 0
3 years ago
Question very important cause after my school is over at 5 'oclock I will be playing rocket league if anyone wants to play just
jarptica [38.1K]

Answer:

So can u tell me wut is ur question...It is not understandable

6 0
3 years ago
DLS1 is connected to another switch, DLS2, via a trunk link. A host that is connected to DLS1 is not able to communicate to a ho
zubka84 [21]

Answer:

Switchport does not compromise, switch auto dynamic mode, switch native vlan 66, default swamp vlan enabled to add 99 is the correct answer of the following question.

Explanation:

As configuring 802.1Q warp links, DLS1 is connected to the next switch, DLS2, via a diffusion connection to the local VLAN, that must match on the both sides of the wire, either CDP error signals will be created and data to or from the the original VLAN will not be managed properly.Such instruction must be extended to Fa0/1 on DLS1 to address issues that can not be communicated by a server related to DLS1 to a network tied to DLS1, even though both are in VLAN 99.

6 0
3 years ago
On a timeline, a milestone 11 years in the future will be to the
aniked [119]

Answer:

D. Left,left

11 is less than 20 as well as it is less than 25 years. And we move from left to right on the timeline. Thus 11 is left of 20 and it is left of 25 years as well. And timeline is the core of a project management software. The Gantt and Pert chart are totally based on the timeline. Software like Microsoft project use the timeline quite a lot, and you cannot survive without the knowledge  of the timeline in software project management.

Explanation:

Timeline knowledge is a must for a software professional, and the above answer does not require explanation.

6 0
4 years ago
Which of the following best describes the infrastructure ISPs provide?
svet-max [94.6K]

Answer:

cables, towers, and underground tubes

Explanation:

Its certainly the above one, and through this internet service is being provided. So internet service is self-understood, and what ISP firstly provides are cables, underground tubes, and the towers. And it is only these all through which the ISP provides internet service. And remember we are in this question dealing with the infrastructure and not the services or products. Hence, phone service, websites, and files, as well as the emails, search engines, and the videos, are not the solution here as they are not the infrastructure. And ISPs never provide the computers, ethernet cables or keyboards.

Hence, the correct answer is as mentioned in the answer section.

4 0
4 years ago
Other questions:
  • An engineer is assigned the task of reducing the air pollutants being released from a power plant that generates electricity by
    9·1 answer
  • What should you remember about typography while creating your résumé?​
    14·1 answer
  • You are capturing packets with a network sniffer and notice a number of packets that are flagged by the sniffer and described as
    5·1 answer
  • Name at least two primary forms of identification needed to obtain a learner’s license.
    10·2 answers
  • Which creepy character is a user-generated myth in minecraft
    13·1 answer
  • Write a program whose input is a character and a string, and whose output indicates the number of times the character appears in
    11·1 answer
  • my headphone jack that is like in the computer will not work only my speakers will work when i plug in
    15·2 answers
  • ????????????????????????????????
    5·1 answer
  • Write the following program: Use struct data type to store information about courses. Every course is characterized by the follo
    6·1 answer
  • Tascake Gets Free Brainliest Because he didnt get it<br><br> Tascake Heres Brainliest
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!