Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1 : ( 1 0 points ) Prompt the user for a number n . Find the number of digits in the number. Do

Problem 1: (10 points)
Prompt the user for a number n. Find the number of digits in the number. Do NOT
use string length.
Problem 2: (10 points)
Create a guessing game. Pick any number between 1 and 1000. Prompt the user
to guess numbers until the player guesses the correct number. For every guess,
output "Too high" or "Too low", and then ask for another input. At the end of the game,
the number is revealed along with the number of guesses it took to get the correct
number.
Problem 3: (10 points)
Prompt the user for a number n. Check if the number is an Armstrong number i.e.
sum of the cube of individual digits returns the same number. For example, 153 is
an Armstrong number since 13+53+33=153.371 is another example.
Problem 4: (10 points)
Prompt the user for a number n. Check if the number is a binary number or not i.e.
all digits in the number must be either 0 or 1. For example, 101 is a binary number
whereas 123 is not. Note: 0 and 1 are the only single digit binary numbers.
Problem 5:(10 points)
Prompt the user for a number n. Check if the number is composite i.e., the number
is NOT prime and hence it is divisible a number other than 1 an
d itself. For
example, 1,3,5,7 is prime whereas 4,6,8,9 are composite.
JAVA
image text in transcribed

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

Recommended Textbook for

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions