Question: Lab Exercise 6.1 Instructions: In the main() of a program called YourLastNameFirstlnitialLE61.java, code an array that contains the top 3 jackpot winnings in millions. Code
Lab Exercise 6.1 Instructions: In the main() of a program called YourLastNameFirstlnitialLE61.java, code an array that contains the top 3 jackpot winnings in millions. Code a second array that holds the locations/states in which the winnings were won. Code a for loop that will populate the arrays by prompting for the winnings and then the locations/states. Sometimes the same winnings can span multiple locations/states. Then, code another for loop that will display the content from these arrays as follows Output Specifications: where the Xs represent the state's name and the Zs the total area in square miles. Here's code for some of the output: System.out.printf("%n%nTHE TOP 3 JACKPOT WINNINGS%n" +" %nWINNINGS IN MILLIONS%19s", "LOCATION"); Use this printf) when array index is less than 2: System.out.printf("%n $%,.int %s", winningsj].locationli); /6 blank spaces before format specifier, 5 blank spaces after last Otherwise, use this print): System.out.printf("%n $%,.innt %s", winningsj], locationlil); /6 blank spaces before format specifier, 5 blank spaces after last "t THE TOP 3 JACKPOT WINNINGS WINNINGS IN MILLIONS $zZZ,ZZZz,zzz.99 $ZZZ,ZZz,ZZZ.99 LOCATION
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
