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

Simple & Compound Interest Using Java
Homework Solution
$65.00
Java
Programming
Codes
Algorithms
Computer Science
Statements
Variables
Loops
Input
Output
Integers
Strings
Simple Interest
Compound Interest
Money
Finance
Annual Rates
Calculations
Functions
Screen Messages
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
Multiplication Table in Java
Homework Solution
$40.00
Java
Programming
Codes
Algorithms
Computer Science
Statements
Variables
Loops
Rows
Columns
Input
Output
Integers
Strings
Multiplication
Tables
Operations
Conditions
Odd Numbers Problem in Java
Homework Solution
$10.00
Java
Programming
Computer Science
Mathematics
Integers
Odd Values
Even Values
Output
Input
Range
Loops
Conditions
Statements
Samples
Java Program: Arrays Of Marks
Homework Solution
$30.00
Java
Programming
Codes
Computer Science
Algorithms
Arrays
Marks
Characters
Strings
Integers
Maximum Value
Minimum Value
Difference
Range
Median
Sorting Methods
Boundaries
Statements
Vaariables
ArrayLoop in Java
Homework Solution
$40.00
Java
Programming
Codes
Algorithms
Computer Science
Statements
Variables
Loops
Input
Output
Integers
Strings
Arrays
Sum
Average
Product
Screen Message
Calculations
Elements
Get help from a qualified tutor
Live Chats