Question: using Java CHALLENGE ACTIVITY 5.4.5: Printing array elements separated by cor commas Write a for loop to print all NUM_VALS elements of array hourlyTemp. Separate
CHALLENGE ACTIVITY 5.4.5: Printing array elements separated by cor commas 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 import java.util.Scanner; 2 3 public class PrintwithComma 4 public static void main(String [] args) { 5 Scanner scnr = new Scanner(System.in); 6 final int NUM VALS = 4; 7 int(1 hourlyTemp. new int [NUM_VALS); 8 int i; 9 10 for (1 0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
