Difference between revisions of "Input Validation"

From CompSciWiki
Jump to: navigation, search
Line 1: Line 1:
 
{{1010PrAD|ProblemName=Input Validation
 
{{1010PrAD|ProblemName=Input Validation
  
|Problem=Keep prompting the user for input until the user inputs a, b, or c.
+
|Problem=Prompt the user for input until they enter either a, b, or c. Use the following guidelines in coming up with a solution:
 +
* [[https://webmail.cs.umanitoba.ca/mediawiki/index.php/Input/Output_using_JOptionPane JOptionPane for input and ouput]]
 +
* [[While Loops|While loop]] for validating input
  
 
|SideSectionTitle=While and For Loops
 
|SideSectionTitle=While and For Loops
Line 8: Line 10:
 
[[Image:Wiki_loops03.jpg|center]]<BR>
 
[[Image:Wiki_loops03.jpg|center]]<BR>
  
|Solution=The solution...
+
|Solution=
 +
 
  
 
|SolutionCode=
 
|SolutionCode=

Revision as of 09:50, 8 April 2010

Back to the Program-A-Day homepage

Problem

Prompt the user for input until they enter either a, b, or c. Use the following guidelines in coming up with a solution:

 

While and For Loops

Wiki loops03.jpg

Solution

Code

Solution Code

Back to the Program-A-Day homepage