News Ticker

Menu

Browsing "Older Posts"

Browsing Category "only $20"

Lock Up Tite user authentication program in Java GUI

Thursday, 14 April 2016 /
Buy now

Objective 

You work for a company called Lock Up Tite. They want you to write a front end program to grant authentication access to programs using a user name and password. Requirements Write a program that creates a loop and has three options for the user to select.

Option 1 allows the user to add a user name and password, which is then stored into a file.

Option 2 allows the user to enter a user name and password up to three times. For a given attempt, the user will be notified if the attempt is successful or unsuccessful.

Option 3 will exit the loop and end the program Main Menu Requirements: When the program starts, present the user with a menu offering the three options described above. After the user chooses either option 1 or 2, the program should go back to the main menu. The final option will end the program.

Option 1 Requirements:

This option prompts the user for their user name and password and stores them in a file named passwords.txt. The program should not overwrite what's already in the file; it should append the new user name and password to the end of the file.

Option 2 Requirements: 

This option uses the passwords.txt file to verify the user is entering a valid user name and password. It begins by asking the user for a user name and password within a loop that runs up to three times. If the password is correct, an appropriate message will be printed, the loop will end, and the program will go back to the main menu. If the user is unable to provide a user name and password that matches any of the combinations in the file, an appropriate message will be printed and the user will be allowed to try again. If the user fails after three attempts, the loop should end and the program should go back to the main menu.

Technical Requirements: 


1. Create a Java program named LockUpTite.java.

2. Create a procedure for each major task in the program. Call the procedures based on the option selected by the user.

3. After completing the tasks of Option 1 or 2, re-display the menu and allow the user to pick another option. Option 3 will exit the program.

4. Make sure your program is adequately commented, uses consistent naming conventions for variable and module names, and uses appropriate indentation and line spacing to enhance the readability of the code.

Instructions Follow these instructions as you build your program: 


1. Create the LockUpTite.java class and create a main() method.

2. In the main() method, create a try-catch block. Within the try block, get the path to theplayers.txt file. While you can do this many different ways, the easiest approach is to put all your files in the same folder and use Path filePath = Paths.get("players.txt"); If you use an IDE that keeps .java and .class files in a separate folder, then use the following approach: Path filePath = Paths.get("players.txt").toAbsolutePath();

3. You may want to declare this variable outside of the main() method but within the class so that the other functions you build can use it.

4. For the function that responds to Option 2, you should do the following:
(a) Ask the user for a username and password.
(b) Create a Boolean variable to indicate a successful login, and set it to false.
(c) Open the players.txt file by creating a BufferedReader object. Call theFiles.newBufferedReader() method and pass it the BufferedReader reader = Files.newBufferedReader(filePath); NOTE: If you are using Java 7, this technique will not work. Instead, you must send two arguments, aPath and a Charset. So if you are using
Java 7, you will need to do the following:

import java.nio.charset.Charset; Create your Path object as outlined above. Then when you create the BufferedReader: BufferedReader reader = Files.newBufferedReader(filePath, Charset.forName("UTF-8"));

1. Create a String named line, and assign it to reader.readLine(), where reader is the name of theBufferedReader object you created in step 4.

2. Create a while loop that will continue as long as line is not NULL and a match has not been found.
(a) Within the loop, use the line object’s split() method to break the String into two pieces, both of which should be stored in a String array.
(b) Check the name and password for a match. The user name taken from the file will be stored in the first element of the array; the password will be in the second. If both match, set Boolean to true.
(c) Assign line to the next line of text in the file by calling reader.readLine().

3. Below the while loop, check the Boolean variable. If it is true, then a match was found. If not, bump a counter to give the user a second chance unless the value of the counter has exceeded three increments.

4. Within the catch block, print out the Exception object’s error message.

Output Screenshots:








Order Now and get your work!


Buy now

Moving shapes in JavaFX with Multi threading

Wednesday, 6 April 2016 /

Multithreading and JavaFX

Create an object-oriented JavaFX GUI that shows two shapes or images moving around a GUI. Each shape will have its thread to move it around the GUI. You must use threads – not AnimationTimelines or JavaFx Paths- this is a threading homework that happens to use JavaFx- not just a JavaFx homework.

You must have two separately distinct activities. Two flashing texts are only one different activity. I have provided an example of how to move an image in a circle and flashing text using threads. You may choose one of these, but your second activity must be different from shooting and moving in a circle. Do not directly copy the examples- you may use the algorithm with other things. Try moving in an up-down, side to side, zig-zag, etc. Be sure to shut down all threads when the Application closes. (Hint: interrupt() method on Thread class)

Your program should consist of multiple classes. Put thread Runnable classes in a different class from Application and pass shared information in the constructor.

Order Now:


Buy now

Passenger Seats Assigning Program full implementation in C++ - HJ Soft

Monday, 28 March 2016 /

Description:

Write a C++ program to assign passenger seats in an airplane. Chesapeake Airlines is a small commuter airline with seats for 36 passengers in 9 rows of 4 seats each. See the sample display below for a layout of the plane.

The user enters the row (1 – 9) and the seat (A – D). The program checks the array to see if the seat is available. An X in the array indicates the seat is not available.
If the seat is available, assign an X to that position in the array. If it’s unavailable, display a message to the passenger.

There are 3 ticket classes:
Row 1 = First Class
Rows 2-4 = Business Class
Rows 5-9 = Coach

*Note that the rows are 0-8 in the C++ program.
Use the classCtr array supplied in the header file to keep track of how many seats in each class are purchased.
Continue processing requests until the user enters -1 for the row. After -1 is entered for the row, display

  • number of seats sold.
  • percentage occupied.
  • sales report.


You need to include the following functions in your program.

  • Function to get the row and seat.

This function displays a prompt requesting the value for the row. If -1 is not entered for the row, the function displays a prompt requesting the seat letter. The seat can be an upper or lowercase letter. Check how the toupper function works in Chapter Six (Display 6.9).
This function is a call-by-reference since it needs to supply main with two values.
See the function declaration getData in the cpp file provided.
Check Display 5.4 get_numbers function and Display 5-9 get_input function.
These two functions are call-by-value.

  • Function to display the plane layout using the layout array provided in the header file. See the function declaration displayPlane in the cpp file provided.
  • Function to display the Sales Report, using the classes, classCtr, and fares arrays provided.


Header files

User-defined header files are useful for reducing redundant code. The array.h file contains all the arrays you need for this project. To incorporate these arrays into your cpp file, use a statement like this:
#include "f:\\array.h"
The f:\\ is in the string because I saved this file in the root directory of my flash drive. The program has to know where this file is located so adjust the drive for your storage. You may also right-click on Header Files in the Solution Explorer of the IDE and add the header file to the project so you don’t need to specify the drive.

The #include statement is basically like a copy/paste operation. The compiler will replace the #include line with the actual contents of the file you're including when it compiles the file. This way, any program that needs these arrays can include them instead of keying the array data in each program.

Develop C++ program with the following new features:

Arrays
Arrays and functions
Call-by-reference functions
User-defined header files.

Advice from the Instructor:
As usual, code this problem in small steps, one function at a time.
In main, the row and seat values need to be converted to indices for the plane layout array.

The row value needs to be converted to a legal index from 0 to 8.
You can use one statement to adjust the row index.

The seat letter needs to be converted to a legal index from 0 to 3. Consider subtracting the ASCII value 65 from the value of the seat entered to change the index. It only takes one statement to adjust the column index using this technique.

For example: A – 65 = 0

o The advantage of arrays is the same in C++ as in Java - often reducing the amount of code you need. First, make sure your program works correctly and then go back and see if you can write the code more efficiently. For example, the function to write the sales report can contain one for loop that produces the 3 line items in the report as well totaling total sales.

Do not use code like this:
Total = classCtr[0] + classCtr[1] + classCtr[2];

Output Screenshot:


Buy now

CS 211 Project 3: Cipherous Symmetry full solution with JUnit Testing, Encryption and Decryption

Wednesday, 2 March 2016 /

Class Alphabet


Alphabet represents the set of characters that will be allowed in some message. For different messages, we can choose to use different Alphabet objects.
The primary function of Alphabets is to provide the translation of characters from symbols to integers and back via its indexOf(c) and get(i) methods. Several ciphers will require translating a character like 'C' into a number. The Alphabet provides such a functionality via its a.indexOf('C') method which will produce the integer associated with C if the letter is in the alphabet. Similarly, converting a number like 8 to an equivalent character is done via a.get(8) which returns a character from the alphabet.

CS222 Project 1 The Game of Korona és Horgony - Dice Rolling Game

Friday, 26 February 2016 /

Project Description:

For this project, you will be creating a program to play a dice game known in Hungary as Korona és Horgony. The rules are fairly simple. Three dice, each containing six different symbols on each face are used. A mat, also containing the same six symbols is on the table. The player makes bets by placing wagers on one or more of the six symbols. The dice are then thrown. If any of the dice show the symbol on which a bet has been placed, the banker pays the player the amount of his stake for each die  showing that symbol.

2015 Fall Computer Science I Program #3: Mastermind

Sunday, 21 February 2016 / No Comments

Introduction

In the popular game Mastermind, one player creates a secret code of four pegs, each of which can be chosen from one of six colors. (The number of pegs and colors may be different than this in different versions, but your implementation will use these values, but be extendible to other values. Also, a color can be reused, thus there really are six choices for each of the four pegs.) The other player then has to guess the color of each peg, with the order mattering.The player who made the secret code then has to give feed back to the player guessing. This feedback is in the form of white and black pegs. A black peg means that the guesser has chosen the correct color in the correct slot.