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
muminat
3 years ago
6

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.
Computers and Technology
1 answer:
vlabodo [156]3 years ago
4 0

Answer:

#include <iostream>

using namespace std;

int main() {

   int NUM_VALS;//variable NUM_VALS for the size of the array..

   cout<<"Enter the size of the array"<<endl;

   cin>>NUM_VALS;//taking input the size of the array..

   int hourlyTemp[NUM_VALS]; //declaring array hourlyTemp of size n..

   cout<<"Enter values of the array "<<endl;

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

   cin>>hourlyTemp[i];//taking input of hourlyTemp

   for(int i=0;i<NUM_VALS;i++) //for loop for iterating over the array..

   {

       if(i!=NUM_VALS-1)

       cout<<hourlyTemp[i]<<", ";// print statement.

       else

       cout<<hourlyTemp[i];//print statement.

   }

return 0;

}

Explanation:

I have taken NUM_VALS variable for the size of the array hourlyTemp. First i am taking input the size of array form user and after that array elements are also entered by the user.I am iterating over the array using for loop and checking that it is not the last element if it is simply printing it if it is not then printing comma and space also.

You might be interested in
The information of an management information system comes from?
Debora [2.8K]

A management information system is a computer system consisting of hardware and software that serves as the backbone of an organization's operations

5 0
2 years ago
What are the differences and similarities of computer virus and biological virus. Give 4 examples
Papessa [141]

Answer:

During recent months, we’ve witnessed an unexpected and distressing pandemic of a coronavirus disease. What I find especially distressing about it is how the worldwide adversity was caused by just a tiny thing — namely, a virus called SARS-CoV-2.

However, biological viruses have always been a potent threat to humanity, as historic pandemics have proved. No wonder viruses became an ideal weapon model in a totally different world — a world of programming. The first computer viruses were created as early as in the 1970s. Starting as pranks, they evolved to become a major threat to the stability of computer networks worldwide. And the more I think of viruses, both biological and digital, the more amazed I am by their similarities.

We don’t know what kind of challenges viruses of either type will cause in the future, but understanding how they infect, the symptoms they induce, how they spread, and the damage they can cause can help us fight both.

The Common Thread

Let’s start with the basics: What does a virus look like?

computer virus of 1999

Click image for larger version

Figure 1: Pictured on the left is an electron microscope image of SARS-CoV-2 particles - the pandemic-causing coronavirus. Source: NIAID-RML. Pictured on the right is a code snippet of a Melissa, the notorious email-spreading computer virus of 1999. Source: Gizmodo.

The images in Figure 1 might look vastly different, but, essentially, they’re the same: a string of code. In the coronavirus, it’s the RNA genome in a shell; in Melissa, it’s computer code. In both cases, the code is an “instruction” for the virus to follow.

Explanation:

here is your answer hope you will enjoy

thank you

6 0
2 years ago
Fiona is creating a presentation with PowerPoint Online about how pencils are made. She would like to type an explanation about
777dan777 [17]

Answer:THE ANSWER IS A.

Explanation:I DID IT AND I GOT 100

6 0
2 years ago
[5]Suppose a 1,600 kg car is traveling at 20.0 m/s. What average force is needed to stop the car in 4.0 s?
SVEN [57.7K]
This is in the wrong caterigore and yes the answer is 8.0 × 103 N 
5 0
3 years ago
Read 2 more answers
Cuáles son las partes más importantes de una flor​
castortr0y [4]

Answer:

estas son

Explanation:

El cáliz. Está formado por los sépalos, que son un conjunto de hojas verdes en la base de la flor.

La corola. Está formada por los pétalos que son hojas coloreadas en el interior de los sépalos.

Los estambres. Son los órganos masculinos de la flor. ...

El pistilo. Es el órgano femenino de la flor.

7 0
3 years ago
Other questions:
  • What are the different between Facebook and LinkedIn
    15·2 answers
  • Use the RSA cipher with public key n = 713 = 23 · 31 and e = 43. Encode the word "KING" into its numeric equivalent and encrypt
    15·1 answer
  • Which ofthe following is the most correct statement about the interestsection of the indirect plan for persuasion?
    8·1 answer
  • Which activity represents a violation of the licensing agreement?
    13·2 answers
  • What is it called when an attacker convinces you to enter personal information at an imposter website after receiving an email f
    10·2 answers
  • For this assignment, select one of the organizations with a prominent IT department from the Topic 1 assignment. Once identified
    11·1 answer
  • When Mark completed his research paper, he decided that he wanted to have all headings to be in bold, underlined, and 14 points.
    11·1 answer
  • Examples of pop in computer​
    14·1 answer
  • ¿Qué creo que debe considerar una empresa para elegir ellugar en el cual va a desarrollar su actividad económica osu emprendimie
    8·1 answer
  • There is a development team delivering a new software package with agile and devops frameworks. in one of the releases, the auto
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!