Question: Simple JAVA program Write a program to find out a number is even or odd. The program must ask users to input an integer number,
Simple JAVA program
Write a program to find out a number is even or odd. The program must ask users to input an integer number, if the number is even, it will display "number (number should replace with whatever user entered) is an even number" otherwise it will display "number number should replace with whatever user entered) is an odd". If the user entered any other data types such as double, float, etc. the program should display "please enter an integer" and terminate. Write program to request a character input from user and to do the following If user input a or Ait must display Apple If user input bor Bit must display Banana If user input cor it must display Cherry if user input g or it must display Grapes If user input mor Mit must display Mango If user input o or it must display Oranges If user input wor W it must display Watermelon You must use switch statement to do it!!!! . (Game: scissor, rock, paper) Write a program that plays the popular scissor-rock paper game. (A scissor can cut a paper, a rock can knock a scissor, and a paper can wrap a rock.) The program randomly generates a number 0, 1, or 2 representing scissor, rock, and paper. The program prompts the user to enter a number 0, 1, or 2 and displays a message indicating whether the user or the computer wins, loses, or draws. Here are sample runs: scissor (0), rock (1), paper (2): 1 tter The computer is scissor: You are rock. You won scissor (0), rock (1), paper (2): 2 ter The computer is paper. You are paper too. It is a draw
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
