Question

Wordlist generator in Java (Object Oriented)

Use: Inheritance, Polymorphism, Arrays, String class methods

The classes in this project:

+ Charlist.java

- Generate.java

+ TestGenerate.java

The Charlist Class will have the alpha-numeric, numeric, something like this:
ualpha-numeric = [ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]
ualpha = [ABCDEFGHIJKLMNOPQRSTUVWXYZ]
lalpha-numeric = [abcdefghijklmnopqrstuvwxyz0123456789]
lalpha = [abcdefghijklmnopqrstuvwxyz]
numeric = [0123456789]

The Generate class will be the “Engine class” that will generate the word list, line-by-line for example: if user want to generate a numeric list from 0 to 8 ... the Generate class will generate the numbers and append it to a file on the disk. Now the TestGenerate.java class will be the interface for the user, using Scanner to take user options to start generate, after taking user options the class Engine should generate the wordlist deepened on the user input options, then save it on the disk.

The options in TestGenerate.java class are:
charlist type: numeric, lalpha-numeric, ualpha-numeric...etc
range of the wordlist
file name to save the wordlist

More details:

ok example:

1- the user run the class has the main method
2- message appear like this:

Options:

Characters type:
ualpha-numeric: Upper alpha characters with numbers [ABCD134.9...Z]
ualpha: Upper alpha characters [ABCD...Z]
lalpha-numeric: Lower alpha characters with numbers [abcd1234.9..z]
lalpha: Lower alpha characters [abcd..z]
numeric: [0123456789]

Length:
Input Length of the characters in one word
[MinLength-MaxLength]
Ex: 8-8
This will generate a word list with minimum 8 characters in the one word and maximum 8 characters

AAAAAAAA
AAAAAAAA
....
AAAAAAAA
####################################

3 - message appear ask user to input file name to save the word-list:

"Please specify file name"

4 - the program will start generate the list and after done it should save the list generated in the file specified

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.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;

public class Generate {
private int min, max; //Hold data for min, max, list to use etc
private char[] charList;
private Charlist list;
private PrintWriter writer;

public Generate(Scanner input)
{
this.getFile(input); //Get file to write to
this.getMinMax(input); //Get min and max word sizes
list = new Charlist(); //Get the list we're to work with
charList = list.getList(input);
}

private void getFile(Scanner input) //Gets our file and opens it
{...

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

Related Homework Solutions

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 Programming Problems
Homework Solution
$13.00
Computer Science
Java
Programming
Algorithms
Buttons
Flow Layouts
Methods
Actions
Events
Statements
Conditions
Input
Output
From BS Tree to AVL Tree in Java
Homework Solution
$20.00
Java
Programming
Codes
Algorithms
Binary Search Tree
AVL Tree
Search Operation
Logarithmic Time
Rebalancing
Loops
Statements
Variables
Successors
Ancestors
Parents
Nodes
Edges
Boolean Values
Data Structures
Java Problems With Stack
Homework Solution
$40.00
Java
Programming
Coding
Computer Science
Stack
Generic Types
Push
Pop
Peek
Size
Linked List
Functions
Strings
Integers
Summation
Negative Values
Input
Output
Java Programming Problems
Homework Solution
$20.00
Java
Programming
Computer Science
File Management
Scripts
Input
Output
Keys
Arrays
Values
Samples
Lists
Hashes
Functions
Methods
Strings
Statements
Conditions
Loops
Widget Shop in Java
Homework Solution
$30.00
Computer Science
Java
Widget Shop
Programming
Algorithms
Orders
Costs
Data Structures
Statements
Variables
Conversions
Get help from a qualified tutor
Live Chats