Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!