Purchase Solution

Three Java examples that validate input

Not what you're looking for?

Ask Custom Question

Please help with the following problem.

Design an algorithm that prompts the user to enter a positive nonzero number and validates the input.

Design an algorithm that prompts the user to enter "yes or "no" and validates the input.

Design an algorithm that prompts the user to enter a secret word. The secret word should be at least 8 characters long. Validate the input.

Purchase this Solution

Solution Summary

This solution provides three different Java examples that show various ways of validating user provided input. It helps design various algorithms that prompt users to enter certain inputs.

Solution Preview

Problem: Design an algorithm that prompts the user to enter a positive nonzero number and validates the input. Design an algorithm that prompts the user to enter "yes or "no" and validates the input. Design an algorithm that prompts the user to enter a secret word. The secret word should be at least 8 characters long. Validate the input.

Since the language wasn't specified I will show each algorithm using Java but they can be translated to any common language ...

Purchase this Solution


Free BrainMass Quizzes
C# variables and classes

This quiz contains questions about C# classes and variables.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Basic Networking Questions

This quiz consists of some basic networking questions.