The program should have a main method and another method called passwordChecker. The main method will send the two new passwords to passwordChecker.

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter7: String Manipulation
Section: Chapter Questions
Problem 2E
icon
Related questions
Question

//Assignment 06 
*/
public static void main[](String[] args) {
    
    String pass= "ICS 111";
    System.out.printIn(valPassword(pass));
}

      /*

 

public static boolean valPassword(String password)
{
    if(password.length() > 6)
    {
        if(checkPass(password)
        {
            return true;
        }
        else
        {
            return false; 
        }
      
}
else
       System.out.print("Too small");
    return false;
}

public static boolean checkPass (String password)
{
    boolean hasNum=false; boolean hasCap = false; boolean hasLow = false; char c;
    for(int i = 0; i < password.length(); i++)
    {
        c = password.charAt(1);
        if(Character.isDigit(c));
        {
            hasNum = true;
        }
        else if(Character.isUpperCase(c))
        {
            hasCap = true;
        }
        else if(Character.isLowerCase(c))
        {
            hasLow = true;
        }
    }      return true;
    {
        return false;
    }

 

 


    
}

Type your current password: ICS111
Type a new password: Secret Password!
Retype the new password: Secret Password!
Your new password can not have spaces.
Your password was not changed.
Type your current password: ICS111
Type a new password: SecretPassword
Retype the new password: SecretPassword
Your new password must contain ! or $ or ?.
Your password was not changed.
The program should have a main method and another method called passwordChecker.
The main method will send the two new passwords to passwordChecker.
The main method of the program will:
1. Print "Type your current password:" and accept user input.
2. Check the user input against a current password (test against the string "ICS111").
a. If the user input does not match the current password, print "Password not
recognized." and end.
b. If the user input does match the current password, continue to the next
step.
3. Print "Type a new password:" and accept user input.
4. Print "Retype the new password:" and accept user input.
5. Send the two new passwords to a boolean method named passwordChecker.
a. If passwordChecker returns true, print "Your password was changed to: "
followed by the new password.
b. If passwordChecker returns false, print "Your password was not changed."
6. End of program.
The passwordChecker method will:
1. Receive the two versions of a new password.
2. Set a boolean return value to false.
3. Compare the two passwords to be sure they match.
Transcribed Image Text:Type your current password: ICS111 Type a new password: Secret Password! Retype the new password: Secret Password! Your new password can not have spaces. Your password was not changed. Type your current password: ICS111 Type a new password: SecretPassword Retype the new password: SecretPassword Your new password must contain ! or $ or ?. Your password was not changed. The program should have a main method and another method called passwordChecker. The main method will send the two new passwords to passwordChecker. The main method of the program will: 1. Print "Type your current password:" and accept user input. 2. Check the user input against a current password (test against the string "ICS111"). a. If the user input does not match the current password, print "Password not recognized." and end. b. If the user input does match the current password, continue to the next step. 3. Print "Type a new password:" and accept user input. 4. Print "Retype the new password:" and accept user input. 5. Send the two new passwords to a boolean method named passwordChecker. a. If passwordChecker returns true, print "Your password was changed to: " followed by the new password. b. If passwordChecker returns false, print "Your password was not changed." 6. End of program. The passwordChecker method will: 1. Receive the two versions of a new password. 2. Set a boolean return value to false. 3. Compare the two passwords to be sure they match.
Type your current password: ICS111
Type a new password: SecretPassword!
Retype the new password: SecretPassword!
Your password was changed to: SecretPassword!
In order for the password to be changed:
a. the two new passwords must match
b. The new password must have 6 or more characters
c. The new password must contain no spaces
d. The new password must contain at least one of the following characters: ! or $ or
?
If the new password is acceptable, then the program will say that is has changed
the password. If any of the rules are violated, the program will tell the user what's wrong
and not change the password.
Here are examples of several unsuccessful runs: (user input is in bold):
Type your current password: ICS141
Password not recognized.
Your password was not changed.
Type your current password: ICS111
Type a new password: shhh
Retype the new password: shhh
Your new password must contain 6 or more characters.
Your password was not changed.
Transcribed Image Text:Type your current password: ICS111 Type a new password: SecretPassword! Retype the new password: SecretPassword! Your password was changed to: SecretPassword! In order for the password to be changed: a. the two new passwords must match b. The new password must have 6 or more characters c. The new password must contain no spaces d. The new password must contain at least one of the following characters: ! or $ or ? If the new password is acceptable, then the program will say that is has changed the password. If any of the rules are violated, the program will tell the user what's wrong and not change the password. Here are examples of several unsuccessful runs: (user input is in bold): Type your current password: ICS141 Password not recognized. Your password was not changed. Type your current password: ICS111 Type a new password: shhh Retype the new password: shhh Your new password must contain 6 or more characters. Your password was not changed.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
Computer Science
ISBN:
9781337569798
Author:
ECKERT
Publisher:
CENGAGE L