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
Select the six criteria for a baseline.
Karo-lina-s [1.5K]

Explanation:

nose pero también se usa para la musica electronica

6 0
3 years ago
What is a way of telling the computer how to display certain content pls answer quick
coldgirl [10]
Machine language is the language understood by a computer. It is very difficult to understand, but it is the only thing that the computer can work with. All programs and programming languages eventually generate or run programs in machine language
4 0
3 years ago
Write a program that reads the balance and annual percentage interest rate and displays the interest for the next month. Python
denis23 [38]

Answer:

Explanation:

The following code is written in Python. It asks the user to enter the current balance and the annual interest rate. It then calculates the monthly interest rate and uses that to detect the interest that will be earned for the next month. Finally, printing that to the screen. A test output can be seen in the attached picture below.

balance = int(input("Enter current Balance: "))

interest = int(input("Enter current annual interest %: "))

interest = (interest / 12) / 100

next_month_interest = balance * interest

print('$ ' + str(next_month_interest))

7 0
2 years ago
Please select all examples of systems using guided media. Group of answer choices ADSL 802.11 Wifi Home Networks Global Position
dusya [7]

Answer:

- ADSL.

- Ethernet Home Networks.

- Fiber Optics.

- Cable Television.

Explanation:

In Computer, Guided media also known as bounded media involves the use of cable such as fibre-optic cables, coaxial cable to transmit data signals from one system device to another.

Examples of systems using guided media are;

- ADSL.

- Ethernet Home Networks.

- Fiber Optics.

- Cable Television.

7 0
3 years ago
This is Microsoft Word. ONLY RIGHT ANSWERS. 50 points
pishuonlain [190]
She should select the first sentence then press and hold ALT while selecting the second sentence
5 0
2 years ago
Other questions:
  • Which of the following binary (base-2) numbers is LARGEST?
    14·1 answer
  • Which of the following is a preferable method to secure wireless access in a SOHO?
    12·1 answer
  • he fundamental building block in every Hypertext Markup Language (HTML) document is the _____ tag, which marks a component in th
    7·1 answer
  • Read the following scenario: A project will require more people than originally estimated. Identify the possible risks to the pr
    8·2 answers
  • س2) اکتب خوارزميه لحل المعادلة الرياضيه الاتيه
    9·1 answer
  • Remember that kid who would always ask you for your food, even though he packed his own lunch.
    8·2 answers
  • Of the following field which would be the most appropriate for the primary key in a customer information table?
    5·1 answer
  • 9. These particular machines can be decentralized.
    9·1 answer
  • Can someone make me a natural selection comic but only 5 same thing in the example pic but draw the animal different and a diffe
    11·1 answer
  • reagan's firm has not had to make large investments in computer or networking hardware or in personnel to maintain the hardware
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!