Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write an app that gives advice about the number of dog toys the user has. It starts like this: Exercise: Dogs and toys Write an
Write an app that gives advice about the number of dog toys the user has. It starts like this:
Exercise: Dogs and toys Write an app that gives advice about the number of dog toys the user has. It starts like this Dog Toys Dog Toys Do you have enough dog toys? How many dogs? Number of dogs Enter the number of dogs you have. How many dog toys? Number of dog toys Enter the number of dog toys you have. Show advice Sample web app by Kieran Mathieson The user fills in the fields, and clicks Show advice. First, the app validates the input data. Make sure that: Neither field is empty. Neither field contains a negative number. Show appropriate error messages. For example: App Dog Sorry, you can't have a negative number of dogs Dog Toys Do you have enough dog toys? How many dogs? -3 Enter the number of dogs you have. How many dog toys? -4 Enter the number of dog toys you have. Show advice Sample web app by Kieran Mathieson Use the flag pattern so that all applicable error messages show. In this case, after the user clicks OK, another message would appear for dog toys. If the data is OK, show some advice on the page. Show the advice below the button. If there are more dogs than dog toys, show "You don't have enough dog toys! Get some more." If there are more dog toys than dogs, show "You have enough dog toys. Good to go!" If there the same number of dogs and dog toys, show "You have just enough dog toys, but no extra. Get some spares." For example: Dog Toys Dog Toys Do you have enough dog toys? How many dogs? Enter the number of dogs you have How many dog toys? Enter the number of dog toys you have. Show advice Advice: You have enough dog toys. Good to go! Sample web app by Kieran Mathieson Submit the URL of your solutionStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started