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
Hoochie [10]
2 years ago
11

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, 95Note that the last element is not followed by a comma, space, or newline.import java.util.Scanner;public class PrintWithComma {public static void main (String [] args) {final int NUM_VALS = 4;int[] hourlyTemp = new int[NUM_VALS];int i = 0;hourlyTemp[0] = 90;hourlyTemp[1] = 92;hourlyTemp[2] = 94;hourlyTemp[3] = 95;/* Your solution goes here */System.out.println("");return;}}
Computers and Technology
1 answer:
slavikrds [6]2 years ago
3 0

Answer:

Here are the for loop for the given question.

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

       {

         /* check if the value of i is equal to NUM_VALS or not.If it is

         equal then just print the value without comma.*/

       if(i==(NUM_VALS-1))  // if block

       System.out.print(hourlyTemp[i]);

  /* if i is not equal then just print the value with comma.*/

       else   // else block

       System.out.print(hourlyTemp[i] + ", ");

       }

Explanation:

In this we iterating the for loop  and check the condition

check if the value of i is equal to NUM_VALS or not.If it is  equal then just print the value without comma

If i is not equal then just print the value with comma .

Output:

90,92,94,95

You might be interested in
A project manager is working with a software development group to collect and evaluate user stories related to the organization’
MA_775_DIABLO [31]

Answer:

Answer: C Scrum

Explanation:

Answer: C Scrum would BEST support this objective, to collect and evaluate user stories related to the organization’s internally designed CRM tool.

3 0
3 years ago
a_____________ may have its value change during program execution. options. flowchart,counter, Algorithm,None of them​
Amiraneli [1.4K]

Answer:

i think is "none of them"

5 0
3 years ago
Archie wants to optimize an XFS filesystem and minimize the chance of future corruption. Which of the following commands will co
svlad2 [7]

Answer:

The best answer is "B"

xfs_fsr

Explanation:

The is a typical format of the command to use:

xfs_metadump -o /dev/sdb1 /reviewxfs

6 0
3 years ago
Read 2 more answers
_______ is a process that insures that operations meet data validity standards. For instance, information systems that process c
lutik1710 [3]

Answer:

The answer is consistency

Explanation:

Information systems deal with the retrieval, storage, manipulation and sharing of data for organisational needs. It is important that there are measures in place that corresponds to data validity standards. The process that ensures that operations meet these standards is known as consistency.

This is very necessary for information systems.

5 0
3 years ago
How many feet do you have to stop away from a school bus
mr_godi [17]
You are required by law to stop twenty feet away from a school bus when driving.
7 0
3 years ago
Other questions:
  • Information permanently stored on a hard disk, diskette, cd-rom disk, or tape, is called ________ storage.
    8·1 answer
  • Where does most of the work in creating a presentation will take place? Either formatting toolbar, normal (Slide) view, slide so
    12·2 answers
  • Lucy wants to develop a web page to display her profile. She wants to just start with a basic page that lists her accomplishment
    13·1 answer
  • The company currently runs 60 autonomous APs and has plans to increase wireless density by 50% in the near future
    13·1 answer
  • #include #include int main( ) { int value = 10; int pid; value += 5; pid = fork( ); if (pid &gt; 0 ) { value += 20; } printf(val
    10·1 answer
  • Any part of the computer that you can touch is called ________.
    6·1 answer
  • Write a deffrentiate between inkjet peinter and laser printer​
    8·1 answer
  • Which of the phases of the software development life cycle (SDLC) would the following action take place in?
    9·1 answer
  • China sends a computer virus that shuts down telephone service in the United States. In retaliation, the United States hacks int
    13·1 answer
  • Which backup requires a small amount of space and is considered to have an involved restoration process?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!