Relative Content

Tag Archive for javaloopsnetbeansswitch-statement

How to loop this switch statement if it defaults?

I went over making a switch statement in my homework for class which will calculate the area or perimeter of a rectangle based on the user’s input and I wanted to make it so that if the user enters an invalid input, the program would loop back to the start where it asks the user to enter either ‘A’ or ‘P’ for the respective calculation.