Project #93309 - Assignment10

 

CPSC 155 – COMPUTER PROGRAMMING

 

FALL 2015

 

ASSIGNMENT 10

 

 

 

A10.TXT Url: http://www.wikiupload.com/C9NHVXKSPKE9GEM

 

 

 

Assignment 10 Word File Url: http://www.wikiupload.com/4RSH9SXQ4C0QFT4

 

 

 

There is an input file called A10.TXT that is on Canvas and the S drive.  You have to write a Java program to help the ACME Beauty Company use information from the file. 

 

 

 

The input file has salespeople's names and sales figures in it. The salesperson's last name and first name are on one line, and four sales figures are on the next line.  Each name has only one word in it. You can assume that there will not be more than 50 salespeople.

 

For example:

 

Smith John

 

25  125.5  95  64

 

Willow Mary

 

154  189.5  95  76

 

 

 

  1. Create a class called SalesPerson to store the information for each salesperson. Add appropriate methods (gets, sets and anything else you want) and a constructor. The first name, last name and each of the four sales figures should be stored as 6 separate fields. You must have a method called salary that calculates and returns the person’s salary. The salary is 25 times the 4 sales combined. Store the number (25) as a named class level constant value.

     

  2. Add a second class that includes a main method. The class should do the following:

    1. Create an array of SalesPerson type. You may assume that there will be 50 or fewer salespeople in the file.

    2. Get Information: Read in all the information from the file and create objects for each of the sales people present in the file.  The SalesPerson objects should be stored in an array. The data from the file should be only read in once during the program.

    3. Print Information: For each person print out the full name, total sales, and the salary. The printout must have column headings that are underlined.  The data should be well formatted. The first and last name should be printed as one column, with one blank space separating the two. The average salary should be printed below the column it is averaging.

    4. Richest: Calculate and print out the full name of the salesperson with the highest salary, along with the salary.

    5. Search: Ask the user for the name (both first and last separately) of a salesperson (using the keyboard). If the salesperson exists, display the salary of the salesperson on the screen. If the name does not exist, an appropriate error message should be displayed. Find the employee regardless of what case the name is typed in. The name must be printed in upper case in the output.

       


 

 

Run the program 3 times, using the following names in the search:

 

        1. tom ANDREWS

        2. SuSaN Blue

        3. stacie andrea

           

          Submit the following:

 

  1. A printout of your classes

  2. A printout of the program output from each run

     

    Note.

    1) Each class must have a header, which has your name, the date and program number. 

    2) Your program should work correctly for any set of data, not only the given data. 

     

    Sample Output

    Full Name              Total Sales      Salary

    =========              ===========      ======

    John Smith                  619.50   15,487.50

    Mary Willow                 514.50   12,862.50

    Sallie Smite                519.50   12,987.50

    Tom Andrews                  55.00    1,375.00

    Norman Bates                366.00    9,150.00

    Horace Williams             301.00    7,525.00

    Anne Whitney                426.37   10,659.25

    Wallie Jawie                647.00   16,175.00

    Marie Bunker                 63.00    1,575.00

    Mopsie Bear               1,582.00   39,550.00

    Stephen Andrews             265.00    6,625.00

    Stacie Andrea               265.00    6,625.00

    Last Name                   463.00   11,575.00

    ===============================================

    Average                              11,705.52

     

    Mopsie Bear had the highest salary of $39,550.00

     

    Enter a first name: Stacie

    Enter a last name: Andrea

    STACIE ANDREA has a salary of $6,625.00

 

 

 

Part of output from other runs:

 

 

 

Enter a first name: SuSaN

 

Enter a last name: Blue

 

 

 

SUSAN BLUE was not found.

 

 

 

Enter a first name: tom

 

Enter a last name: Andrews

 

TOM ANDREWS has a salary of $1,375.00

 

 

 

Subject Computer
Due By (Pacific Time) 11/16/2015 12:00 am
Report DMCA
TutorRating
pallavi

Chat Now!

out of 1971 reviews
More..
amosmm

Chat Now!

out of 766 reviews
More..
PhyzKyd

Chat Now!

out of 1164 reviews
More..
rajdeep77

Chat Now!

out of 721 reviews
More..
sctys

Chat Now!

out of 1600 reviews
More..
sharadgreen

Chat Now!

out of 770 reviews
More..
topnotcher

Chat Now!

out of 766 reviews
More..
XXXIAO

Chat Now!

out of 680 reviews
More..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy