has not yet been created else boolean success

Has not yet been created else boolean success

This preview shows page 3 - 4 out of 4 pages.

System.out.println("Canvas has not yet been created."); } else { boolean success = currCanvas.undo(); if (!success) { // If the undo function was not successful the console alerts the user System.out.println("undo could not be completed."); } } } else if (numCase == 4) { // Calls the redo functon if (currCanvas == null) { // Makes sure that a canvas object has been created. System.out.println("Canvas has not yet been created."); } else { boolean success = currCanvas.redo(); if (!success) { // If the redo function was not successful the console alerts the user System.out.println("redo could not be completed."); } } } else if (numCase == 5) { // Prints the contents of the Canvas
Image of page 3
if (currCanvas == null) { // Makes sure that a canvas object has been created. System.out.println("Canvas has not yet been created."); } else { System.out.print(currCanvas.toString()); } } else if (numCase == 6) { // Exits the loop and ends the driver exitLoop = true; } else { System.out.println("Not a valid input please try again."); } } scnr.close(); System.out.print("Bye!"); } }
Image of page 4

You've reached the end of your free preview.

Want to read all 4 pages?

  • Fall '19
  • partner, ASCII, Undo

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture