Question: im trying to construct a program that reads an integer up to 40 digits. The program should show if the input is correct or not.

im trying to construct a program that reads an integer up to 40 digits. The program should show if the input is correct or not.

PLEASE NOTE:

  • You cannot use any of BigDecimal / BigInteger / double / long / int types.
  • please use a method to check if the input is correct or not.

Here is an example console input output:

Enter a positive integer: 134245154123

Your input is correct

Enter a positive integer: 13aewqe33149slek.,13104

Your input is incorrect

Enter a positive integer: 13424515412333141451233235151231235415123123134123141233123141243412541251243434

Your input is incorrect, expecting up to a 40 digit number

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!