Write a java program which validates that the entry

Assignment Help Computer Engineering
Reference no: EM132200473

Write a java program which:

1. Asks the user to enter a positive integer greater than 0

2. Validates that the entry is a positive integer

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

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

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

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

7. 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

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

In addition:
8. The program must have the following four void methods:

a. validate //validate user input

b. reverse // output reverse digits to screen and txt file

c. even //output even digits to screen and txt file

d. odd //output odd digits to screen and txt file

Reference no: EM132200473

Questions Cloud

Write a gui application for the webbuy company : The "Message:" area should allow multiple lines of input and be able to scroll if necessary to accommodate a long message.
Record the name of the person and their score : Write the guessing game (1-1000). AND: Record the name of the person and their score # guesses taken) in a database.
What annual cash flow is needed to make the plant profitable : At a 7 percent discount rate, what annual cash flow is needed to make the 500-megawatt plant profitable? What about using NG at half the cost of coal?
Write an inheritance hierarchy of three-dimensional shapes : Create an abstract class that represents all ThreeDimensionalShapes and has methods for finding the volume and surface area of the shapes.
Write a java program which validates that the entry : Write a java program which Validates that the entry is a positive integer and Outputs the digits in reverse order with a space separating the digits.
How might you measure the direct output of the state : How might you measure the direct output of the state? How might that differ from the consumer output that citizens experience?
Encapsulates statistics for summer job salaries for a group : Write a java class (and a client class to test it) that encapsulates statistics for summer job salaries for a group of people over several years.
Calculate the wavelength for the electronic transition : Calculate the wavelength (in nm) for the electronic transition from n = 3 to n = 5 in the hydrogen atom.
What kind of shots are mostly used in the film and why : Is there any symbolical use in using the colors black and white in the Streetcar film? Is there any particular symbolism conveyed in the film.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Describe dma transfer

Describe DMA transfer

  What is name of a virus that changes itself when it spreads

What is the name of a virus that changes itself when it spreads? Which of the following options is a useful defense against database attacks?

  Setup a lvm volume for the sales group

Your task is to use /dev/sdb to create a logical volume named sales_lvm, format it with XFS, and mount under /sales.

  Explain the concept of scalability to the team

The project leader wants you to explain the concept of scalability to team. How would you do that? Several managers on the team have heard of TCO but are not quite sure what it is. How would you explain it to them.

  Write pseudocode and c program for the given problem

Write pseudocode, and C program for the following problem: get a date from the input of a user. The date is of the form mm/dd/yyyy.

  Basic strategic planning questions

What the basic strategic planning questions must be addressed for the infrastructure? Suppose that x and y are “int” variables and “ch” is a char variable.

  Show a pipeline execution diagram for the program

Indicate all data dependencies (RAW, WAR, WAW) that exist between instructions by writing the instruction pairs among which the dependency exist.

  What is the result of a poor design of a runner system

What is the result of a poor design of a runner system? What is the difference between a sprue and other cooling channels?

  Question1 what three things most an attacker have and why

question1. what three things most an attacker have and why with reason?2. describe disparity between a vulnerability

  Compute the bus fare one must pay in a given city

Using Matlab, write a function called fare that computes the bus fare one must pay in a given city based on the distance travelled.

  Identify cwas hardware and software needs

CWA leases space on an Internet service provider's computer to host a simple Web site that lists the services CWA provides.

  Define various types of electronics equipment

Design and implement a set of classes that define various types of electronics equipment (computers, cell phones, pagers, digital cameras, etc.).

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd