QuestionQuestion

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 PreviewSolution 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(input1);
       add(new JLabel("Confirm : "));
       input2 = new JPasswordField(10);
       add(input2);
       OK = new JButton("OK");
       add(OK);
       result = new JLabel("");
       add(result);...
$25.00 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats