Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(c) Write a Java program that: (i): Asks the user to enter an integer number. (ii): Determfres and displays a message to indicate if the

image text in transcribed

(c) Write a Java program that: (i): Asks the user to enter an integer number. (ii): Determfres and displays a message to indicate if the given input is an even number or an odd number. (iii): Determines and displays if the number is a prime number. A prime number is a number that is divisible ONLY by itself and 1. If the number is not a prime number the program should output one number that divides in to the inputted number, otherwise it should print a message saying it is not prime and state that it is only divisible by itself and one. For example, some sample outputs from your program would be as follows: 6 is not a prime number. It is divisible 3. 12 is not a prime number. It is divisible 6 . 7 is a prime number as it is only divisible by 1 and 7. 13 is a prime number as it is only divisible by 1 and 13

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

If ( A^2 - A + I = 0 ), then inverse of matrix ( A ) is?

Answered: 1 week ago

Question

What is computer neworking ?

Answered: 1 week ago