Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Access Program Write a program that reads a string (password) and a number. The program will keep asking the user for a password and number

image text in transcribedimage text in transcribedimage text in transcribedAccess Program Write a program that reads a string (password) and a number. The program will keep asking the user for a password and number as long as the user does not provide the expected values ("terps" and 1847, respectively), and as long as the user has not exhausted the maximum number of attempts (3 for this project). In addition, the program will stop asking for data if the word "quit" is provided as a password value (in this case, the program will not read the number). The program will print the message "Wrong credentials" when an invalid password or number (or both) is provided. If the user eventually provides the correct credentials the message "Access Granted" will be displayed; otherwise the message "Access Denied" will be generated. The following example illustrates the messages to use to read data and to display results.

code in one program (Java)

1 Enter password: Enter number: Wrong credentials 2 Enter password: Enter number: Access Granted 1 Enter_password: Enter number: Wrong credentials 2 Enter password: Access Denied 1 Enter password: Access Denied

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

From Herds To Insights Harnessing Data Analytics For Sustainable Livestock Farming

Authors: Prof Suresh Neethirajan

1st Edition

B0CFD6K6KK, 979-8857075487

More Books

Students also viewed these Databases questions