2016년 12월 2일 금요일

SSN App HELP!!!


Once the user clicks the button, the contents of the text box should be validated and formatted using the following rules:

1. If the text box contains exactly 9 digits, a valid but unformatted number has been entered
a) Format the 9 digit social security number adding dashes so the format is 999-99-9999
b) Display the now formatted social security number in the text box
c) Do not display a message

2. If the text box contains only digits but not 9 digits, an invalid number has been entered
a) Display the message "A social security number must have 9 digits"

3. If the text box is not strictly numeric, check if the number was entered in 999-99-9999 format
a) The entry must contain exactly 11 characters
b) Characters 1-3 must be digits
c) Character 4 must be a dash (-)
d) Characters 5-6 must be digits
e) Character 7 must be a dash (-)
f) Characters 8-11 must be digits
g) If these rules are met do not display a message

4. If the above rules are not met
a) Display the message "A social security number must be in the format 999-99-9999"

-- 
A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook   http://www.appinventor.org/book2 ... the links are at the bottom of the Web page.  The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro  and the aia files for the projects in the book are here:  http://www.appinventor.org/bookFiles  
How to do a lot of basic things with App Inventor are described here:  http://www.appinventor.org/content/howDoYou/eventHandling  .

Also do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of AppInventor, then try something and follow the
 Top 5 Tips: How to learn App Inventor

You will not find a tutorial, which does exactly what you are looking for. But doing the tutorials (not only reading a little bit) help you to understand, how things are working. This is important and this is the first step to do.

-- 
Pay particular attention to the builtin text blocks.

-- 


댓글 없음:

댓글 쓰기