Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program in JAVA which: Asks the user to enter a positive integer greater than 0 Validates that the entry is a positive integer

Write a program in JAVA which:

Asks the user to enter a positive integer greater than 0

Validates that the entry is a positive integer

Outputs the digits in reverse order with a space separating the digits

Outputs the even digits not in reverse order with a space separating the digits (consider zero to be even)

Outputs the odd digits not in reverse order with a space separating the digits

Allows user is to repeat/continue the program as many times as he/she wants

Keeps a record in a txt file named outDataFile.txt with the history of all numbers entered and the associated results, in the following format:

the original number is 1023

the number reversed 3 2 0 1

the even digits are 0 2

the odd digits are 1 3

-----------------

the original number is 102030

the number reversed 0 3 0 2 0 1

the even digits are 0 2 0 0

the odd digits are 1 3

-----------------

SPECIFIC REQUIREMENTS

The program must have the following four void methods:

validate //validate user input

reverse // output reverse digits to screen and txt file

even //output even digits to screen and txt file

odd //output odd digits to screen and txt file

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

Practical Neo4j

Authors: Gregory Jordan

1st Edition

1484200225, 9781484200223

More Books

Students also viewed these Databases questions

Question

What role does integrity play in a total quality setting?

Answered: 1 week ago

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago