Question

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

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

$25.00

or $1 if you
register a new account!

Assisting Tutor

Related Homework Solutions

Simple Mathematical Computations in Java
Homework Solution
$20.00
Java
Programming
Codes
Algorithms
Mathematics
Computer Science
Objects
Summation
Odd Digits
Even Digits
ItemIndex
Functions
Integers
Multiple Values
Statements
Variables
Input
Output
Java Program: A Dictionary with Array and Linked List
Homework Solution
$30.00
Java
Programming
Codes
Algorithms
Arrays
Linked Lists
Dictionary
Constructor
Class
Integers
File Management
Predecessor
Successor
Input
Output
Statements
Variables
Java Problems: Integers, Strings, File Management & Arrays
Homework Solution
$33.00
Java
Programming
Coding
Computer Science
Input
Output
File Management
Arrays
Integers
Average Values
Methods
Functions
Parameters
Declaration
Strings
Prime Numbers
Array Problems in Java: Summation, Average, Min/Max, Searching, Sorting
Homework Solution
$13.00
Java
Programming
Coding
Computer Science
Arrays
Summation
Average
Minimum Number
Maximum Number
Bubble Sort
Selection Sort
Sequential Search
Binary Search
Algorithms
Input
Output
Methods
Integers
Functions
Java Programming: Stack & Queue
Homework Solution
$40.00
Programming
Java
Coding
Computer Science
Data Sets
Stack
Queue
Matrix
Circular Array
Algorithm
Duplicates
Sequences
Test Files
Random Functions
Mathematicians
Josephus Problem
Statements
Variables
Get help from a qualified tutor
Live Chats