The following code is poorly structured: Rewrite it so that it has a better structure and avoids

Question:

The following code is poorly structured:

int sum = 1000; Scanner console new Scanner (System.in); !! System.out.print (

Rewrite it so that it has a better structure and avoids redundancy. To simplify things, you may assume that the user always types 1 or 2. (How would the code need to be modified to handle any number that the user might type?)

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: