Færdiggjort

build me a java program

Collections Project

This will be a two part project -- one part using a Priority Queue and the other using a Stack.

Part One

Implement a to do list. Tasks have a priority between 1 and 9, and a description.

When the user enters the command add priority description, create a task with the the priority and the description entered in the command. Then the program adds a new task.

When the user enters next, the program removes and prints the most urgent task.

The quit command ends the program.

Use a priority queue in your solution.

Override the hashcode() and equals() so that two tasks with the same description are considered equal. Make sure to ignore the case of the characters.

If the new task already exists in the priority queue, let the user know that and don't add it again. Additionally, print out each object's hashcode to prove it.

Sample Output for Part 1

To Do List - Please enter an option

add priority description (add a new task)

next (remove and print most urgent task)

quit (exit this program)

> add 3 description of new task

> add 4 even newer task

> add 2 least important task

> next

least important task

> next

description of new task

> next

even newer task

> quit

Press any key to continue . . .

Part Two

For this assignment you will be writing a mini-word processor. You are mainly concerned with inserting characters, deleting characters and positioning the cursor. If you think about it, that's mostly what the user does when entering or editing text. The user only adds and deletes characters next to the cursor. You can therefore get away with using two stacks. One stack holds the characters to the left of the cursor. The other stack holds the characters to the right of the cursor. This diagram shows how to represent the word elephantine with the cursor between the letters p and h:

LEFT STACK RIGHT STACK

___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___

|_e_|_l_|_e_|_p_| |_h_|_a_|_n_|_t_|_i_|_n_|_e_|

bottom top top bottom

To move the cursor right, you would just pop the h from the right stack and push it onto the left stack:

LEFT STACK RIGHT STACK

___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___

|_e_|_l_|_e_|_p_|_h_| |_a_|_n_|_t_|_i_|_n_|_e_|

bottom top top bottom

Build a small word-processor class that uses this two-stack representation. The class will include methods for inserting and deleting characters, and for moving the cursor.

To help you along, you will implement the MiniWPI interface that is linked here.

Your MiniWP constructor must be able to take in an initial string. The default will initialize an empty string.

To test your class, you will retrieve the commands from a Queue then execute them.

Make sure you use appropriate exception handling such as dealing with an empty stack, entering invalid commands into the queue, etc.

Sample output for part 2

For the following commands:

[login to view URL]("insert J");

[login to view URL]("insert K");

[login to view URL]("insert L");

[login to view URL]("move left");

[login to view URL]("move right");

[login to view URL]("move left");

[login to view URL]("move left");

[login to view URL]("search K");

This would be the output:

Starting Word processor!

----------

Initial: [i, n, i, t, i, a, l, , c, o, n, t, e, n, t, s]|[]

insert J: [i, n, i, t, i, a, l, , c, o, n, t, e, n, t, s, J]|[]

insert K: [i, n, i, t, i, a, l, , c, o, n, t, e, n, t, s, J, K]|[]

insert L: [i, n, i, t, i, a, l, , c, o, n, t, e, n, t, s, J, K, L]|[]

move left: [i, n, i, t, i, a, l, , c, o, n, t, e, n, t, s, J, K]|[L]

move right: [i, n, i, t, i, a, l, , c, o, n, t, e, n, t, s, J, K, L]|[]

move left: [i, n, i, t, i, a, l, , c, o, n, t, e, n, t, s, J, K]|[L]

move left: [i, n, i, t, i, a, l, , c, o, n, t, e, n, t, s, J]|[K, L]

search K: [i, n, i, t, i, a, l, , c, o, n, t, e, n, t, s, J, K]|[L]

All Parts

Evner: Java, JavaScript, PHP, Software Arkitektur, HTML

Se mere: building java programs: a back to basics approach 4th edition, how to write java programs in notepad, building java programs 4th edition pdf, building java programs 5th edition, java tutorial, how java program run, java programming for beginners, application to run java programs, jsr 082 java send message obex push, java program simulate queue, different parts simple java program, parts simple java program, application runs java program, easy java program creator, java program can read emails, ocr java program example, java program parse log files create report, outsouce java program, java program web application, java program code window messenger

Om arbejdsgiveren:
( 0 bedømmelser ) Torrance, United States

Projekt ID: #27970883

Tildelt til:

HaryCoders

Thanks for posting " build me a java program " project your job is interesting for me. please contact me then we can discuss more. thanks. regards. Avin H.

$35 USD på 1 dag
(54 bedømmelser)
5.7