SlideShare a Scribd company logo
1 of 1
Download to read offline
Start Program like this:
// Chapter 7 Validate Password
import java.util.*;
public class ch7
{
public static void main(String[] args)
{
// Define variables
Scanner input = new Scanner(System.in);
String userPassword; // for input
int userPasswordLength;
int numUppercaseLetters = 0; // counter for uppercase
int numLowercaseLetters = 0; // counter for lowerase
int numNumbers = 0; // counter for digits
boolean passwordIsInvalid = true; // changes to false when password is valid
// continue looping as long as password is invalid
while(passwordIsInvalid)
{
System.out.print("Please enter password >> ");
userPassword = input.nextLine();
userPasswordLength = userPassword.length(); // get the length of the password
// loop thru the password character by character
for(int i = 0; i < userPasswordLength; i++)
{
char ch = userPassword.charAt(i); // get one character at a time
// is character uppercase?
if(Character.isUpperCase(ch))
numUppercaseLetters++; // add 1 to counter ixample of Program Run: Phe
password was invalid. It did not have enough of the following : uppercase letters, iust be at least
2 lowercase letters, must be at least 3 digits, must be at least 3 Please enter password >> coast
The password was invalid. It did not have enough of the following: uppercase letters, wust be at
least 2 Please enter password >> coast2 The password was invalid. It did not have enough of the
following: Please enter password cCoastz Valid password

More Related Content

Similar to Start Program like this Chapter 7 Validate Password import.pdf

Lesson_07_Spring_Security_Register_NEW.pdf
Lesson_07_Spring_Security_Register_NEW.pdfLesson_07_Spring_Security_Register_NEW.pdf
Lesson_07_Spring_Security_Register_NEW.pdfScott Anderson
 
when I compile to get the survey title the overload constructor asks.docx
when I compile to get the survey title the overload constructor asks.docxwhen I compile to get the survey title the overload constructor asks.docx
when I compile to get the survey title the overload constructor asks.docxlashandaotley
 
Lab101.pptx
Lab101.pptxLab101.pptx
Lab101.pptxKimVeeL
 
Assume you have a scanner object (called input).Declare an integer.pdf
Assume you have a scanner object (called input).Declare an integer.pdfAssume you have a scanner object (called input).Declare an integer.pdf
Assume you have a scanner object (called input).Declare an integer.pdfezzi552
 
Creating a Whatsapp Clone - Part XIII - Transcript.pdf
Creating a Whatsapp Clone - Part XIII - Transcript.pdfCreating a Whatsapp Clone - Part XIII - Transcript.pdf
Creating a Whatsapp Clone - Part XIII - Transcript.pdfShaiAlmog1
 
Digits.javapackage week04;import java.util.Scanner; public cla.pdf
Digits.javapackage week04;import java.util.Scanner; public cla.pdfDigits.javapackage week04;import java.util.Scanner; public cla.pdf
Digits.javapackage week04;import java.util.Scanner; public cla.pdfannapurnnatextailes
 
JAVA Question : Programming Assignment
JAVA Question : Programming AssignmentJAVA Question : Programming Assignment
JAVA Question : Programming AssignmentCoding Assignment Help
 
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docxPROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docxamrit47
 
Creating a Facebook Clone - Part XLV - Transcript.pdf
Creating a Facebook Clone - Part XLV - Transcript.pdfCreating a Facebook Clone - Part XLV - Transcript.pdf
Creating a Facebook Clone - Part XLV - Transcript.pdfShaiAlmog1
 
Clean & Typechecked JS
Clean & Typechecked JSClean & Typechecked JS
Clean & Typechecked JSArthur Puthin
 
Write the code above and the ones below in netbeans IDE 8.13. (Eli.pdf
Write the code above and the ones below in netbeans IDE 8.13. (Eli.pdfWrite the code above and the ones below in netbeans IDE 8.13. (Eli.pdf
Write the code above and the ones below in netbeans IDE 8.13. (Eli.pdfarihantmum
 
Lab01.pptx
Lab01.pptxLab01.pptx
Lab01.pptxKimVeeL
 
week3_srcDoWhileLoopFactorial.javaweek3_srcDoWhileLoopFactoria.docx
week3_srcDoWhileLoopFactorial.javaweek3_srcDoWhileLoopFactoria.docxweek3_srcDoWhileLoopFactorial.javaweek3_srcDoWhileLoopFactoria.docx
week3_srcDoWhileLoopFactorial.javaweek3_srcDoWhileLoopFactoria.docxalanfhall8953
 
I Have the following Java program in which converts Date to Words an.pdf
I Have the following Java program in which converts Date to Words an.pdfI Have the following Java program in which converts Date to Words an.pdf
I Have the following Java program in which converts Date to Words an.pdfallystraders
 
User.DS_Store__MACOSXUser._.DS_Store__MACOSXUser._D.docx
User.DS_Store__MACOSXUser._.DS_Store__MACOSXUser._D.docxUser.DS_Store__MACOSXUser._.DS_Store__MACOSXUser._D.docx
User.DS_Store__MACOSXUser._.DS_Store__MACOSXUser._D.docxdickonsondorris
 

Similar to Start Program like this Chapter 7 Validate Password import.pdf (19)

Lesson_07_Spring_Security_Register_NEW.pdf
Lesson_07_Spring_Security_Register_NEW.pdfLesson_07_Spring_Security_Register_NEW.pdf
Lesson_07_Spring_Security_Register_NEW.pdf
 
when I compile to get the survey title the overload constructor asks.docx
when I compile to get the survey title the overload constructor asks.docxwhen I compile to get the survey title the overload constructor asks.docx
when I compile to get the survey title the overload constructor asks.docx
 
Lab101.pptx
Lab101.pptxLab101.pptx
Lab101.pptx
 
Assume you have a scanner object (called input).Declare an integer.pdf
Assume you have a scanner object (called input).Declare an integer.pdfAssume you have a scanner object (called input).Declare an integer.pdf
Assume you have a scanner object (called input).Declare an integer.pdf
 
Creating a Whatsapp Clone - Part XIII - Transcript.pdf
Creating a Whatsapp Clone - Part XIII - Transcript.pdfCreating a Whatsapp Clone - Part XIII - Transcript.pdf
Creating a Whatsapp Clone - Part XIII - Transcript.pdf
 
Digits.javapackage week04;import java.util.Scanner; public cla.pdf
Digits.javapackage week04;import java.util.Scanner; public cla.pdfDigits.javapackage week04;import java.util.Scanner; public cla.pdf
Digits.javapackage week04;import java.util.Scanner; public cla.pdf
 
JAVA Question : Programming Assignment
JAVA Question : Programming AssignmentJAVA Question : Programming Assignment
JAVA Question : Programming Assignment
 
07-Basic-Input-Output.ppt
07-Basic-Input-Output.ppt07-Basic-Input-Output.ppt
07-Basic-Input-Output.ppt
 
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docxPROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
 
Creating a Facebook Clone - Part XLV - Transcript.pdf
Creating a Facebook Clone - Part XLV - Transcript.pdfCreating a Facebook Clone - Part XLV - Transcript.pdf
Creating a Facebook Clone - Part XLV - Transcript.pdf
 
Bot builder v4 HOL
Bot builder v4 HOLBot builder v4 HOL
Bot builder v4 HOL
 
Clean & Typechecked JS
Clean & Typechecked JSClean & Typechecked JS
Clean & Typechecked JS
 
Write the code above and the ones below in netbeans IDE 8.13. (Eli.pdf
Write the code above and the ones below in netbeans IDE 8.13. (Eli.pdfWrite the code above and the ones below in netbeans IDE 8.13. (Eli.pdf
Write the code above and the ones below in netbeans IDE 8.13. (Eli.pdf
 
Lab01.pptx
Lab01.pptxLab01.pptx
Lab01.pptx
 
week3_srcDoWhileLoopFactorial.javaweek3_srcDoWhileLoopFactoria.docx
week3_srcDoWhileLoopFactorial.javaweek3_srcDoWhileLoopFactoria.docxweek3_srcDoWhileLoopFactorial.javaweek3_srcDoWhileLoopFactoria.docx
week3_srcDoWhileLoopFactorial.javaweek3_srcDoWhileLoopFactoria.docx
 
I Have the following Java program in which converts Date to Words an.pdf
I Have the following Java program in which converts Date to Words an.pdfI Have the following Java program in which converts Date to Words an.pdf
I Have the following Java program in which converts Date to Words an.pdf
 
Creating Interface- Practice Program 6.docx
Creating Interface- Practice Program 6.docxCreating Interface- Practice Program 6.docx
Creating Interface- Practice Program 6.docx
 
Java practical
Java practicalJava practical
Java practical
 
User.DS_Store__MACOSXUser._.DS_Store__MACOSXUser._D.docx
User.DS_Store__MACOSXUser._.DS_Store__MACOSXUser._D.docxUser.DS_Store__MACOSXUser._.DS_Store__MACOSXUser._D.docx
User.DS_Store__MACOSXUser._.DS_Store__MACOSXUser._D.docx
 

More from aloeplusint

Starware Software was founded last year to develop software for gami.pdf
Starware Software was founded last year to develop software for gami.pdfStarware Software was founded last year to develop software for gami.pdf
Starware Software was founded last year to develop software for gami.pdfaloeplusint
 
Some obstacles in Project Development. One of the main goals of Proj.pdf
Some obstacles in Project Development. One of the main goals of Proj.pdfSome obstacles in Project Development. One of the main goals of Proj.pdf
Some obstacles in Project Development. One of the main goals of Proj.pdfaloeplusint
 
Sophocles Enterprises had the following pretax income (loss) over it.pdf
Sophocles Enterprises had the following pretax income (loss) over it.pdfSophocles Enterprises had the following pretax income (loss) over it.pdf
Sophocles Enterprises had the following pretax income (loss) over it.pdfaloeplusint
 
Solve using java and using this Singly linked list classpublic cl.pdf
Solve using java and using this Singly linked list classpublic cl.pdfSolve using java and using this Singly linked list classpublic cl.pdf
Solve using java and using this Singly linked list classpublic cl.pdfaloeplusint
 
SQL was created at IBM in the 1970s. Why was SQL createdSQL was .pdf
SQL was created at IBM in the 1970s. Why was SQL createdSQL was .pdfSQL was created at IBM in the 1970s. Why was SQL createdSQL was .pdf
SQL was created at IBM in the 1970s. Why was SQL createdSQL was .pdfaloeplusint
 
SQL- Write a select statement that returns the Freight cost from.pdf
SQL- Write a select statement that returns the Freight cost from.pdfSQL- Write a select statement that returns the Freight cost from.pdf
SQL- Write a select statement that returns the Freight cost from.pdfaloeplusint
 
Some of our most basic questions about the history of life concern w.pdf
Some of our most basic questions about the history of life concern w.pdfSome of our most basic questions about the history of life concern w.pdf
Some of our most basic questions about the history of life concern w.pdfaloeplusint
 
Southeastern Oklahoma State Universitys business program has the fa.pdf
Southeastern Oklahoma State Universitys business program has the fa.pdfSoutheastern Oklahoma State Universitys business program has the fa.pdf
Southeastern Oklahoma State Universitys business program has the fa.pdfaloeplusint
 
Sorensen Systems Inc. is expected to pay a $2.50 dividend at year en.pdf
Sorensen Systems Inc. is expected to pay a $2.50 dividend at year en.pdfSorensen Systems Inc. is expected to pay a $2.50 dividend at year en.pdf
Sorensen Systems Inc. is expected to pay a $2.50 dividend at year en.pdfaloeplusint
 
Subject Computer Architecture & Organization Q-4 Assume that .pdf
Subject Computer Architecture & Organization  Q-4 Assume that .pdfSubject Computer Architecture & Organization  Q-4 Assume that .pdf
Subject Computer Architecture & Organization Q-4 Assume that .pdfaloeplusint
 
Subject Management Information System Please complete the four qu.pdf
Subject Management Information System Please complete the four qu.pdfSubject Management Information System Please complete the four qu.pdf
Subject Management Information System Please complete the four qu.pdfaloeplusint
 
Subject Computer Architecture & Organization i. Show the con.pdf
Subject Computer Architecture & Organization  i. Show the con.pdfSubject Computer Architecture & Organization  i. Show the con.pdf
Subject Computer Architecture & Organization i. Show the con.pdfaloeplusint
 
Solve the following balance and income sheet for this specialty hosp.pdf
Solve the following balance and income sheet for this specialty hosp.pdfSolve the following balance and income sheet for this specialty hosp.pdf
Solve the following balance and income sheet for this specialty hosp.pdfaloeplusint
 
Su clase se ha ofrecido como voluntaria para trabajar por el Refer�n.pdf
Su clase se ha ofrecido como voluntaria para trabajar por el Refer�n.pdfSu clase se ha ofrecido como voluntaria para trabajar por el Refer�n.pdf
Su clase se ha ofrecido como voluntaria para trabajar por el Refer�n.pdfaloeplusint
 
Su compa��a de TI es responsable de crear programas de virus de soft.pdf
Su compa��a de TI es responsable de crear programas de virus de soft.pdfSu compa��a de TI es responsable de crear programas de virus de soft.pdf
Su compa��a de TI es responsable de crear programas de virus de soft.pdfaloeplusint
 
Study the cladogram above and match the names of the five organisms .pdf
Study the cladogram above and match the names of the five organisms .pdfStudy the cladogram above and match the names of the five organisms .pdf
Study the cladogram above and match the names of the five organisms .pdfaloeplusint
 
study of tension, compression, and shear and compare those three dir.pdf
study of tension, compression, and shear and compare those three dir.pdfstudy of tension, compression, and shear and compare those three dir.pdf
study of tension, compression, and shear and compare those three dir.pdfaloeplusint
 
Students may research the local Aboriginal andor Torres Strait Isla.pdf
Students may research the local Aboriginal andor Torres Strait Isla.pdfStudents may research the local Aboriginal andor Torres Strait Isla.pdf
Students may research the local Aboriginal andor Torres Strait Isla.pdfaloeplusint
 
Stevie es un hombre ocupado. El viaja mucho. Usa las palabras entre .pdf
Stevie es un hombre ocupado. El viaja mucho. Usa las palabras entre .pdfStevie es un hombre ocupado. El viaja mucho. Usa las palabras entre .pdf
Stevie es un hombre ocupado. El viaja mucho. Usa las palabras entre .pdfaloeplusint
 
Step 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdf
Step 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdfStep 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdf
Step 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdfaloeplusint
 

More from aloeplusint (20)

Starware Software was founded last year to develop software for gami.pdf
Starware Software was founded last year to develop software for gami.pdfStarware Software was founded last year to develop software for gami.pdf
Starware Software was founded last year to develop software for gami.pdf
 
Some obstacles in Project Development. One of the main goals of Proj.pdf
Some obstacles in Project Development. One of the main goals of Proj.pdfSome obstacles in Project Development. One of the main goals of Proj.pdf
Some obstacles in Project Development. One of the main goals of Proj.pdf
 
Sophocles Enterprises had the following pretax income (loss) over it.pdf
Sophocles Enterprises had the following pretax income (loss) over it.pdfSophocles Enterprises had the following pretax income (loss) over it.pdf
Sophocles Enterprises had the following pretax income (loss) over it.pdf
 
Solve using java and using this Singly linked list classpublic cl.pdf
Solve using java and using this Singly linked list classpublic cl.pdfSolve using java and using this Singly linked list classpublic cl.pdf
Solve using java and using this Singly linked list classpublic cl.pdf
 
SQL was created at IBM in the 1970s. Why was SQL createdSQL was .pdf
SQL was created at IBM in the 1970s. Why was SQL createdSQL was .pdfSQL was created at IBM in the 1970s. Why was SQL createdSQL was .pdf
SQL was created at IBM in the 1970s. Why was SQL createdSQL was .pdf
 
SQL- Write a select statement that returns the Freight cost from.pdf
SQL- Write a select statement that returns the Freight cost from.pdfSQL- Write a select statement that returns the Freight cost from.pdf
SQL- Write a select statement that returns the Freight cost from.pdf
 
Some of our most basic questions about the history of life concern w.pdf
Some of our most basic questions about the history of life concern w.pdfSome of our most basic questions about the history of life concern w.pdf
Some of our most basic questions about the history of life concern w.pdf
 
Southeastern Oklahoma State Universitys business program has the fa.pdf
Southeastern Oklahoma State Universitys business program has the fa.pdfSoutheastern Oklahoma State Universitys business program has the fa.pdf
Southeastern Oklahoma State Universitys business program has the fa.pdf
 
Sorensen Systems Inc. is expected to pay a $2.50 dividend at year en.pdf
Sorensen Systems Inc. is expected to pay a $2.50 dividend at year en.pdfSorensen Systems Inc. is expected to pay a $2.50 dividend at year en.pdf
Sorensen Systems Inc. is expected to pay a $2.50 dividend at year en.pdf
 
Subject Computer Architecture & Organization Q-4 Assume that .pdf
Subject Computer Architecture & Organization  Q-4 Assume that .pdfSubject Computer Architecture & Organization  Q-4 Assume that .pdf
Subject Computer Architecture & Organization Q-4 Assume that .pdf
 
Subject Management Information System Please complete the four qu.pdf
Subject Management Information System Please complete the four qu.pdfSubject Management Information System Please complete the four qu.pdf
Subject Management Information System Please complete the four qu.pdf
 
Subject Computer Architecture & Organization i. Show the con.pdf
Subject Computer Architecture & Organization  i. Show the con.pdfSubject Computer Architecture & Organization  i. Show the con.pdf
Subject Computer Architecture & Organization i. Show the con.pdf
 
Solve the following balance and income sheet for this specialty hosp.pdf
Solve the following balance and income sheet for this specialty hosp.pdfSolve the following balance and income sheet for this specialty hosp.pdf
Solve the following balance and income sheet for this specialty hosp.pdf
 
Su clase se ha ofrecido como voluntaria para trabajar por el Refer�n.pdf
Su clase se ha ofrecido como voluntaria para trabajar por el Refer�n.pdfSu clase se ha ofrecido como voluntaria para trabajar por el Refer�n.pdf
Su clase se ha ofrecido como voluntaria para trabajar por el Refer�n.pdf
 
Su compa��a de TI es responsable de crear programas de virus de soft.pdf
Su compa��a de TI es responsable de crear programas de virus de soft.pdfSu compa��a de TI es responsable de crear programas de virus de soft.pdf
Su compa��a de TI es responsable de crear programas de virus de soft.pdf
 
Study the cladogram above and match the names of the five organisms .pdf
Study the cladogram above and match the names of the five organisms .pdfStudy the cladogram above and match the names of the five organisms .pdf
Study the cladogram above and match the names of the five organisms .pdf
 
study of tension, compression, and shear and compare those three dir.pdf
study of tension, compression, and shear and compare those three dir.pdfstudy of tension, compression, and shear and compare those three dir.pdf
study of tension, compression, and shear and compare those three dir.pdf
 
Students may research the local Aboriginal andor Torres Strait Isla.pdf
Students may research the local Aboriginal andor Torres Strait Isla.pdfStudents may research the local Aboriginal andor Torres Strait Isla.pdf
Students may research the local Aboriginal andor Torres Strait Isla.pdf
 
Stevie es un hombre ocupado. El viaja mucho. Usa las palabras entre .pdf
Stevie es un hombre ocupado. El viaja mucho. Usa las palabras entre .pdfStevie es un hombre ocupado. El viaja mucho. Usa las palabras entre .pdf
Stevie es un hombre ocupado. El viaja mucho. Usa las palabras entre .pdf
 
Step 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdf
Step 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdfStep 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdf
Step 1You need to run the JAVA programs in sections 3.3 and 3.5 for.pdf
 

Recently uploaded

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxAnaBeatriceAblay2
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 

Recently uploaded (20)

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 

Start Program like this Chapter 7 Validate Password import.pdf

  • 1. Start Program like this: // Chapter 7 Validate Password import java.util.*; public class ch7 { public static void main(String[] args) { // Define variables Scanner input = new Scanner(System.in); String userPassword; // for input int userPasswordLength; int numUppercaseLetters = 0; // counter for uppercase int numLowercaseLetters = 0; // counter for lowerase int numNumbers = 0; // counter for digits boolean passwordIsInvalid = true; // changes to false when password is valid // continue looping as long as password is invalid while(passwordIsInvalid) { System.out.print("Please enter password >> "); userPassword = input.nextLine(); userPasswordLength = userPassword.length(); // get the length of the password // loop thru the password character by character for(int i = 0; i < userPasswordLength; i++) { char ch = userPassword.charAt(i); // get one character at a time // is character uppercase? if(Character.isUpperCase(ch)) numUppercaseLetters++; // add 1 to counter ixample of Program Run: Phe password was invalid. It did not have enough of the following : uppercase letters, iust be at least 2 lowercase letters, must be at least 3 digits, must be at least 3 Please enter password >> coast The password was invalid. It did not have enough of the following: uppercase letters, wust be at least 2 Please enter password >> coast2 The password was invalid. It did not have enough of the following: Please enter password cCoastz Valid password