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
Javscript Basics

Quiz on basics of javascript programming language.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.