Exercise - using Java library classes with method calls For this exercise, you are required to write
Question:
Exercise - using Java library classes with method calls For this exercise, you are required to write a java class with a main method that does the following: Ask the user to enter an int number Display a message to tell the user what was just entered Generate a random int number between 20 to 40 Display a message to tell the user what number has been generated Determine which one of the two numbers is smaller Display a message to tell the user which one is smaller Determine the difference of the two numbers Display a message to tell the user the difference Ask the user to enter a sentence that include the word "like" Replace "like" with the word "dislike", and turn the whole sentence to all upper cases Display a message to tell the user what have happened and display the resulting sentence to the user. In your program, you must use the if statement at least once.
Below shows a sample output of the program: Please enter a whole number: 10 You just entered 10 Press enter to continue.... The computer just generated a random number between 20 to 40, and it is 36 We are about to determine the difference and the smaller number. Press enter to continue... The smaller number is 10 The difference of the two numbers is 26 Please enter a sentence that includes the word "like". I like shopping We have replaced "like" with "dislike" and turn the whole sentence to all uppercases. The resulting sentence is: I DISLIKE SHOPPING
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill