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 note that the last element is not followed by a comma, space, or newline.

Respuesta :

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; /* Answer */ System.out.println(""); return; } }
ACCESS MORE