1.Write an app. that prompts a user to create a new password that must have at least:
7 characters, 1 uppercase letter, 1 lowercase letter, and 1 digit.
They must enter it exactly the same twice.
Re-prompt them if it’s invalid, either because they’re different or don’t meet the requirements.
Create a GUI app instead of using the output window & keyboard scanner for user interactions.

2. Write an app that asks the user for the name of a .txt file and then reports out to them how many words that file contains.
You should create your sample .txt file using a simple text editor such as Windows Notepad.

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPasswordField;

* @author
public class problem4 extends JFrame implements ActionListener{

    private JPasswordField input1;
    private JPasswordField input2;
    private JButton OK;   
    private JLabel result;
    public problem4() {
       super("Problem 4");
       setLayout(new FlowLayout(FlowLayout.LEFT,10,20));
       add(new JLabel("Password"));
       input1 = new JPasswordField(10);
       add(new JLabel("Confirm : "));
       input2 = new JPasswordField(10);
       OK = new JButton("OK");
       result = new JLabel("");

This is only a preview of the solution. Please use the purchase button to see the entire solution

Assisting Tutor

Related Homework Solutions

Get help from a qualified tutor
Live Chats