CSCE 145: Homework 1 1. Use Java to write and run a simple console-window program for checking passwords. The program must satisfy the following requirements: - When the program runs, it should first print its name, e.g., Password Checker - The program should next prompt the user to enter a username, e.g., Please enter your username: - The program should next prompt the user to enter a password, e.g., Please enter your password: - If the user enters a correct password, i.e., one that matches an internal secret password, the program responds You are approved by access control!, and quits. - If the user enters an incorrect password, the program responds Sorry, and quits. 2. Your source code must conform to the following style: - There must be a header that contains: (1) your name as author, (2) the date the program was written, (3) the version number of the program, and (4) a short description of the purpose of the program. The @author and @version keywords must be entered exactly as shown below. Other than this, it is an opportunity for you to be creative, and no two headers should be alike. For example, /** * @author Dr. Michael N. Huhns * * @version 1.2, 22 January 2014 * * This program confirms a password typed into a * * console window * */ - The source code must be indented properly and contain comments that describe the important parts of the algorithm.3. Upload a copy of your source code to the CSCE 145 dropbox at https://dropbox.cse.sc.edu. 4. Now create a second version of this program that uses JOptionPane to get the inputs from the user and show the output. When you are finished, upload the . java file for this second program to the dropbox. 5. The grades for this assignment will be based on the following 30% Style: comments and indentation 70% Functionality: Do the programs compile? Do they run? Do they work for all
View Full Document