Question: Breaking it Down Problem One problem that I find in new Java programmers is a tendency to put too mh code in main). It is
Breaking it Down Problem One problem that I find in new Java programmers is a tendency to put too mh code in main)". It is important to learn how to becak a program down into methods and classes. To give you practice at this. have a program th.at has too much code Your job will be to restructure the code into approgeiale methods to make it more readable. I will provide you with lots of coaching 0 how to do this. 2-) In order to show you what this looks ke I have a peogram belon This program has the following characteristics that does too much in main .repeatedly allows the user to select the mathematical operation desired and operands. Then the mathematical problem is calculated and printed out continues until the user enters a 'q for quit. This data. I will give you sample output of this program to show you this characteristic. Except for the fact that is long and all of the code is in main, it is better written and easier to understand than most programs that I see where the programmer has put too much code in main. However, it is harder to understand than it needs to be if we would just break the logic down to smaller methods program is robust in that i doesn't blow up even the user enters in bad .You can copy the code below and run it yourseto try tout Here is some sample output that I have created Enter operand Ester operand 23-45- e an OperaTOE ter operand 1 Your 1aat input waa baa, try 9ain se- 6 tet an Operat our operators b bad.ty ain Your last input ws bad tyai ster operand ter an Operators inished Calalations TooMuchlnMain program: package breaking a Lmport awa-t e pblie statie id ainBeringt
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
