JavaFx Application

profileunique12
Lab_3.docx

INSY 4306 Lab 3

Q1:

(Metric Conversions)

Write an application that will assist the user with metric conversion. Your application should allow the user to specify the names of the units as strings (i.e., centimeters, liters, grams, and so on, for the metric system and inches, quarts, pounds, and so on, for the English system) and should respond to simple questions, such as

"How many inches are in 2 meters?"

"How many liters are in 10 quarts?"

Your application should recognize invalid conversions. For example, the question

"How many feet are in 5 kilograms?"

is not meaningful because "feet" is a unit of length, whereas "kilograms" is a unit of mass.

Sample run 1

Please enter the source unit:

inches

Please enter the destination unit:

feet

Please enter the amount to convert

10

10 inches = 0.8333 feet

Sample run 2

Please enter the source unit:

feet

Please enter the destination unit:

gallons

Please enter the amount to convert

23

invalid conversion

Sample run 3

Please enter the source unit:

liters

Please enter the destination unit:

pints

Please enter the amount to convert

10

10 liters = 21.1338 pints

Sample run 4

Please enter the source unit:

ounces

Please enter the destination unit:

feet

Please enter the amount to convert

100

invalid conversion

Q 2:

(Spam Scanner) Spam (or junk e-mail) costs U.S. organizations billions of dollars a year in spam-prevention software, equipment, network resources, bandwidth, and lost productivity. Research online some of the most common spam e-mail messages and words and check your own junk e-mail folder. Create a list of 30 words and phrases commonly found in spam messages. Write an application in which the user enters an e-mail message. Then, scan the message for each of the 30 keywords or phrases. For each occurrence of one of these within the message, add a point to the message's message's "spam score." Next, rate the likelihood that the message is spam, based on the number of points it received.

list of spam words can be retrieved from:

http://www.wilsonweb.com/wmt8/spamfilter_phrases.htm

Sample run

Deliverables:

1. Source codes (.java files) – 90%

2. Screenshots of the program output – 10%

Note: Sparingly comment your java source code, save all the files in your_lastname_lab_3 folder, zip it, and upload for grading. Thank you!

Note:

· if the program runs without any error and correct output. 100%

· if the program runs without any error and incorrect output. 90%

· if the program crashes due to error: up to 40% if the algorithm is ok