Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java question Class Exercise 2 (Please type your answer) Chapter 9 Text Processing and More about Wrapper Classes Programming Challenges Password Verifier: Imagine you are

Java question

Class Exercise 2 (Please type your answer)

Chapter 9

Text Processing and More about Wrapper Classes

Programming Challenges

Password Verifier:

Imagine you are developing a software package for Amazon.com that requires users to enter their own passwords. Your software requires that user's passwords meet the following criteria:

The password should be at least six characters long.

The password should contain at least one uppercase and at least one lowercase letter.

The password should have at least one digit.

Write a class that verifies that a password meets the stated criteria. Demonstrate the class in a program that allows the user to enter a password and then displays a message indicating whether it is valid or not.

Class Exercises

Find the errors

Chapter 9 Text Processing and More about Wrapper Classes 1. Telemarketing Phone Number List Write a program that has two parallel arrays of String objects. One of the arrays should hold peoples names and the other should hold their phone numbers. Here are example contents of both arrays:

name Array Example Contents phone Array Example Contents Harrison, Rose 555-2234 James, Jean 555-9098 Smith, William 555-1785 Smith, Brad 555-9224 The program should ask the user to enter a name or the first few characters of a name to search for in the array. The program should display all of the names that match the users input and their corresponding phone numbers. For example, if the user enters Smith, the program should display the following names and phone numbers from the list: Smith, William: 555-1785 Smith, Brad: 555-9224

---Part of the code -------------------

import java.util.*; public class PhoneList {public static void main(String [] args) {String name[]={"Harrison, Rose","James, Jean","Smith, William","Smith, Brad" }; String phone[]={"555-2234", "555-9098", "555-1785", "555-9224"}; String n; int i; boolean found=false; Scanner in=new Scanner(System.in); System.out.print("enter a name or the first few characters of a name: "); n=in.next(); for(i=0;i=0) {System.out.println(name[i]+": "+phone[i]); found=true; } } if(!found) System.out.println(n+" not found in the phone list"); } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions

Question

Has the priority order been provided by someone else?

Answered: 1 week ago

Question

Compare the current team to the ideal team.

Answered: 1 week ago