Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Problem 1 and 2: TextImprover (20 pts)There are some words that people tend to overuse when writing documents, such as "amazing," "literally," "actually," "absolutely," etc. For this problem, you will...

2 answer below »

Problem 1 and 2: TextImprover (20 pts)

There are some words that people tend to overuse when writing documents, such as "amazing," "literally," "actually," "absolutely," etc. For this problem, you will implement a class that searches for overused words and replaces them with better choices.

Implement a classTextImproverthat provides a method for improving the text in a text file (let's call it the "input file") by replacing overused words with better choices of words, based on another text file (let's call it "word map") that maps overused words to non-overused words.

Use this template:TextImprover.javaDownload TextImprover.java

A few notes:

  • Assume the words in the word map will always be in all lower case and consist of only letters.
  • TextImprovermust preserve word case. But you can assume all words in the input file are either in all lower case, leading upper case, or all caps.
  • Assume every word in the input file consists of at least one letter and also include punctuation characters, and there is exactly one space in between each word in a line.
  • TextImprovermust preserve the punctuation of the input file.
  • You must catch anyFileNotFoundExceptionthat is thrown and print out a message in the format: "File: [filename] not found", e.g.,File: overused1.txt not found
Example:
// all examples useoverused-words.txtDownload overused-words.txtas the file containing overused words and their replacements
TextImprover ti = new TextImprover("overused-words.txt");
// overused1.txt starts out like this:overused1.txtDownload overused1.txt
ti.improveText("overused1.txt");
// overused1.txt now looks like this:overused1-after.txtDownload overused1-after.txt

Problem 4: Product and ProductDB(10 pts)

You must catch anyFileNotFoundExceptionthat is thrown and print out a message in the format: "File: [filename] not found", e.g.,File: products1.txt not found

Example:
ProductDB db = new ProductDB("products.txtDownload products.txt");
db.findProduct("Blue plaid bow tie collar"); // returns the product "Blue plaid bow tie collar" with price 29.95 and quantity 6
db.findProduct("Red bandana"); // returns the product "Red bandana" with price 3.99 and quantity 16
db.findProduct("White porcelain food and water bowl set"); // returns the product "White porcelain food and water bowl set" with price 23.00 and quantity 8
db.findProduct("XL tan fluffy dog bed"); // returns the product "XL tan fluffy dog bed" with price 75.25 and quantity 2
db.findProduct("stuffed sloth"); // returns null
db.addProduct("stuffed sloth", 9.99, 4);
db.findProduct("stuffed sloth"); // returns the product "stuffed sloth" with price 9.99 and quantity 4
db.addProduct("stuffed sloth", 10.99, 16);
db.addProduct("stuffed sloth", 0.99, 1);
db.findProduct("stuffed sloth"); // returns the product "stuffed sloth" with price 9.99 and quantity 4
// products.txt now looks like this:products-after.txtDownload products-after.txt

Part B:

Problems 6-10: Email (50 pts)

Implement a simple e-mail messaging system. A message has a recipient, a sender, and a message text. A mailbox can store messages. Each user has a mailbox.

Your program will take four commands: Log in, log out, send, read, and quit. When logging in, the program will ask for just a username. When asking to send a message, the program will ask for the recipient's username and the test of the message. When asking to read messages, the system will display all of the user's messages.

The driver / user interface class for the email system, EmailUI, has already been implemented as is given here:EmailUI.javaDownload EmailUI.java. Your task is to implement the Message, Mailbox, and MessagingSystem classes, using these templates:Message.javaDownload Message.java,Mailbox.javaDownload Mailbox.java,MessagingSystem.javaDownload MessagingSystem.java.Notice the templates have more details about each class.

Answered 5 days After Nov 04, 2022

Solution

Robert answered on Nov 09 2022
52 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here