subject

This is a console-based I/O program. Display should go to System. out (print or println) and the program will get user input using the Scanner class. The flow of execution should be as follows: When the program starts, display a one-line introduction to the user
Display a menu with 4 options
1. validate zip code
2. validate SSN
3. instructions
0. quit
Prompt the user to input an option
Prompt the user for the required input and then display the results
Repeat the main menu until the user enters the option to quit
If the user enters an invalid menu option, print a helpful error message and re-prompt. Note, this could be either a wrong value or wrong data type.
For this assignment, you will write two different classes. The goal is to separate the user interface code from the code that performs validation.
In a supplier class named Validations, implement 2 static methods to perform these different validation tasks:
validate that a String represents a valid zip code. A valid zip code is made up of 5 digits.
validate that a String represents a 9-digit SSN. A valid SSN follows the pattern XXX-XX-, including the dashes.
Though I specify 2 public methods, you may have more if you choose to do some decomposition. Note that this Validations class does not need a 'main' method. However, you may write one for testing purposes if you wish. You must use parameter lists and return statements to move data in and out of these methods. No method in this class should use System. out. println or the Scanner class (except an optional test method). In other words, no method here should interact with the user; that's the job of the other class.
In a class named ValidateApp, create a console-based, menu-driven user interface that behaves like the one described above. This class must use a 'main' method to start things off. However, you are encouraged to decompose your solution to organize your code.
No class variables may be used; class constants are ok.
Your program should not throw any exceptions to the user. If a user enters an invalid menu option, the program should display a helpful error message and ask for new input.
You must implement your solution using loops.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:00, nika0001
When designing content as part of your content marketing strategy, what does the "think" stage represent in the "see, think, do, care" framework?
Answers: 3
image
Computers and Technology, 23.06.2019 00:10, witerose701
Write a function so that the main0 code below can be replaced by the simpler code that calls function mphandminutes tomiles0. original main0 int main) l double milesperhour-70.0; double minutestraveled = 100.0; double hourstraveled; double milestraveled; hourstraveled = minutestraveled / 60.0; milestraveled = hourstraveled * milesperhour; cout < "miles" 2 using namespace std; 4 /* your solution goes here/ 6 int maino 1 test passed 7 double milesperhour 70.0 all tests passed 8 double minutestraveled 100.0; 10 cout < < "miles: " < < mphandminutestomiles(milesper-hour, minutestraveled) < < endl; 12 return 0; 13
Answers: 1
image
Computers and Technology, 24.06.2019 08:30, 5theth
Intellectual property rights are exclusive rights that protect both the created and the creation. ipr offers exclusively what benefits to the person or people covered by it
Answers: 3
image
Computers and Technology, 24.06.2019 13:00, toshahoskins0098
What are some websites that you can read manga (ex: manga rock)
Answers: 1
You know the right answer?
This is a console-based I/O program. Display should go to System. out (print or println) and the pro...

Questions in other subjects:

Konu
Mathematics, 12.07.2019 11:20
Konu
English, 12.07.2019 11:20