1. Change the following so that for any input number, the changed program produces exactly the same...
Question:
1. Change the following so that for any input number, the changed program produces exactly the same output as the original, but the changed program uses a while loop instead of a for loop for the inner loop. and change it so that for any input number, it produces exactly the same output, but uses a do-while loop instead of a for loop for the outer loop. Be careful! (Hint: How does it behave if len is not positive?) You may need to add a little additional code to make sure the program behaves identically to the program.
2. Assume codeSection has been previously declared as an int and given as its value the number of a section of the California Penal Code. Write a switch statement that for any value of codeSection, produces exactly the same output as the following if statement.