Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java!! Do-While Loop: Password Formatting Write a program that simulates password creation, where you collect the user's input for their password and validate whether or

Java!!

Do-While Loop: Password Formatting

Write a program that simulates password creation, where you collect the user's input for their password and validate whether or not that password is valid, according to certain conditions. If the user's input password does not satisfy the conditions, continue to ask for a password until it does. You should also include a count to keep track of the total number of attempts the user makes to match the correct formatting (i.e., the number of times we loop through the prompt). The conditions are as follows: - The password is at least 5 characters, but no more than 15 characters. - The password must contain at least one uppercase letter. Try to solve this problem using a do-while loop.

typing here:

int count;

// IMPORTANT: You do not have to define the main class! You do not have to define count, either. // Just initialize it (to 0) and increment it within your loop. // You do not need to import java.util.Scanner, it is already imported.

System.out.println("Total number of attempts: " + count);

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

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

More Books

Students also viewed these Databases questions

Question

What metaphors might describe how we work together?

Answered: 1 week ago

Question

What are some of the possible scenes from our future?

Answered: 1 week ago