Problem 5.1 (Read Example 10-1 on Page
615)
Write a program that read data from a file (InputData.txt attached
in the same web fold) that stores students’ names followed by their test scores
and outputs the following information. All data read from files should be
stored in Vector objects. Note that in
InputData.txt, the first column is student’s name and second column is the
score.
Class average score;
Name of all students whose test
scores are below the class average with an appropriate message;
Highest test score and the names of
all the students having the highest score;
615.jpeg  616.jpeg 617.jpeg   InputData.txt Problem 5.2 

Write a program that prompts the user to enter the length of feet
and inches and outputs the equivalent length in centimeters. If user enters a
negative number of non-digit number, throw and handle an appropriate exception
and prompt the user to enter another set of numbers. (Hint: look at the example
on Pages 92-93 for conversion and the example on Page 776 for fixing error and
continue)92.jpeg  93.jpeg  /  776.jpeg  777.jpeg 
Bonus Problem:
Define the exception class TornadoException. The class should have
two constructors, including one default constructor. If the eception is thrown
with the default constructor, the method getMessage shall return- “Tornado:
Take cover immediately!” The other constructor has a single parameter, say m,
of the int type. If the exception is thrown with this constructor, the method
getMessage shall return: “Tornado: m miles away; and approaching!”
Write a Java program to test the
class TornadoException specific in Step 1.
(Hint: Look at examples 12-12/12-13 in Chapter 12)12.12-12.13.jpeg   12.13.jpeg —————————————————————————————– hits for some problems:Hint for Problem 5.1:Create two vectors:Vector Students = new Vector();Vector Scores = new Vector();Read the file and put Students’ name into Vector Students and scores into Vector Scores (use method addElement)Go through Vector Scores and compute average and max (using method ElementAt to get element in the vector; Note that method size() tells the number of elements in a vector)Go through Vector Scoresif the element is same as max (or smaller than average), records the index of that element;use the recorded index to access and print student’s name from Vector Students————————-Hint for Problem 5.2Reuse the example on Page 776 for FixError and continue and implement a method to getNumber(). In this method, if the number is mismatch, InputMismatchExeception will be triggered. If the number is negative, you need to add statement “throw new Exception(“Number cannot be negative”) to manually trigger the exception. As you can see, in method getNumber(), you need to include two catch blocks: InputMismatchException nd Exception.Reuse the example on Pages 92-93 for conversion as main(). Call getNumber() to get feet and inches in main().




Why Choose Us

  • 100% non-plagiarized Papers
  • 24/7 /365 Service Available
  • Affordable Prices
  • Any Paper, Urgency, and Subject
  • Will complete your papers in 6 hours
  • On-time Delivery
  • Money-back and Privacy guarantees
  • Unlimited Amendments upon request
  • Satisfaction guarantee

How it Works

  • Click on the “Place Order” tab at the top menu or “Order Now” icon at the bottom and a new page will appear with an order form to be filled.
  • Fill in your paper’s requirements in the "PAPER DETAILS" section.
  • Fill in your paper’s academic level, deadline, and the required number of pages from the drop-down menus.
  • Click “CREATE ACCOUNT & SIGN IN” to enter your registration details and get an account with us for record-keeping and then, click on “PROCEED TO CHECKOUT” at the bottom of the page.
  • From there, the payment sections will show, follow the guided payment process and your order will be available for our writing team to work on it.