Calculate monthly commissions for n salespersons

Assignment Help JAVA Programming
Reference no: EM13731580

This assessment item is designed to test your understanding of arrays/arrayLists, objects, classes, sorting and searching.

This assignment requires you to develop a java application program for such a scenario that a local department store manager wants to use it for calculating monthly commissions for N salespersons. N should be declared as a constant and set N=9 or N=10 for the purpose of test. The application also requires displaying, sorting and searching the sales data and corresponding commissions as shown in figures on next a few of pages.

Assume that the salespersons have just started the sales job in the local department store. Each salesperson earns only sales commission which is calculated by multiplying his/her monthly sales amount by the appropriate commission rate. The commission rate scheme has been set up by the store manager and is shown as below:

From the above table, it can be seen that the commission rate is categorized into four levels according to the sales amount. The more the sales amount, the more the salesperson earns. The application should ask the user to enter a salesperson name and his/her monthly sales amount (In terms of the unit of $1000. For example, If the entered number is 20, it means the sales amount is $20,000).

Assume that the sales amount is an integer number between 10 and 100 (this means the actual sales amount is between $10,000 and $100,000), according to the statistical results of many year sales data. An error message should be displayed and re-entering data is required, if the user enters the sales amount beyond this range. In addition, the input of a salesperson's name must be validated in such a way that a valid name is assumed only to contain English letters and a space between first name and surname. An example of an invalid input of name can be shown in the Figure 8 on page 6.

The data of salesperson name, sales amount and the calculated commission (unsorted) were stored in three arrays (The sample data in Figure 2 on next page contain 10 records. You can enter these sample data to test your program functionality). You must use parallel arrays or ArrayLists in this assignment to store salesperson name, sales amount and commissions. Your application should display and execute a menu with the following options. A switch statement must be used to execute the following menu options.

1. Input & validate data
2. Display
3. Sort by name
4. Sort by sales
5. Search by name
6. Search by sales
7. Display statistics
8. Exit

The details for each option are described as below.

1. Input & validate data

This option reads each salesperson's name, and sales amount for N people from the keyboard and stores them in separate one-dimension arrays/arraylists. Figure 1 shows a sample input for a personal data. If the input of sales amount exceeds the ranges defined on the last page, then an appropriate message should be displayed and the user should be asked to re-enter a new value. In addition, the input of salesperson's name also must be validated as required on page 1.

2. Display

This option displays the salesperson names, sales amount and calculated commission that are stored in Arrays/ArrayLists for all sales persons.

3. Sort by name

When this option is selected, the names of sales person are sorted in ascending order and this option also displays sorted names with their sales amount and commission data, as shown in Figure 3. You can use any sorting algorithm which uses at least two while loops and one if statement. A built-in sort should not be used.

4. Sort by sales

This option sorts the sales amount in ascending order and displays the corresponding changes of salesperson names, and commissions.

5. Search by name

When the ‘Search by name' option is executed and the user enters a salesperson's name regardless of the lower case or upper case in the name spelling, the sales amount, and commission for that person will be displayed (In this example, the salesperson's name - david sydney is entered). If the entered name doesn't match any existed one, it will show a warning message.

6. Search by sales

If the user selects this option and enters a particular sales amount, the running program will display the salesperson name and sales amount that are less than the particular amount. It shows an example where the specific sales amount is $50,000.

7. Display statistics

If the user selects this option, the program will calculate and display the lowest and highest value of sales amounts and corresponding salesperson names, as well the median sales amount.

8. Exit

Selecting ‘Exit' option will exit the execution of the program.

Program design

You may use any design that meets the specification. However, a good design will adhere to the following guidelines:

• be logically correct
• be easy to read and maintain
• be well-designed
• use UML class diagram
• use following methods and class

What to submit

You should submit online the following files:

• SalesDataManager.java (this file contains java source code for class SalesDataManager and main method)

• Report.docx (this file contains a brief report - maximum 2 pages that includes student name, student ID, course name, course code , test cases and UML class diagram for the class - SalesDataManager ). The UML class diagram is a type of static structure diagram that describes the structure of a system by showing the class' data members and operations.

Reference no: EM13731580

Questions Cloud

What is average accounting return criterion decision rule : Describe how the average accounting return is usually calculated and describe the information this measure provides about a sequence of cash flows. What is the Average Accounting Return criterion decision rule? What problems associated with using the..
Several proactive responses organization : This chapter outlines outlined several proactive responses organization can make to the environment: Strategic maneuvering, Cooperative strategies, Independent strategies.
Describe the independent variables and blocking variables : Describe the independent variables, blocking variables, dependent variables, and extraneous variables. Explain how you plan to deal with issues related to internal and external validity. Be specific
Identify and explain key external factors : Identify and explain key external factors that affect the passenger airline industry. Explain the major airline market segments by applying the marketing concepts of segmentation, targeting, and positioning
Calculate monthly commissions for n salespersons : Understanding of arrays - arrayLists, objects, classes, sorting and searching. Develop a java application program for such a scenario that a local department store manager wants to use it for calculating monthly commissions for N salespersons.
Federal law impacts healthcare organizations : Do you think that quality would be adversely impacted if the growth in medical technology were to be constrained in the United States. If costs are reduced, and more people could have access, do you think that this is a reasonable trade-off
Payback period as a means of measuring cash flows : What are the problems associated with using the payback period as a means of measuring cash flows? What are the advantages of using the payback period to evaluate cash flows and are there any circumstances under which using the payback might be appro..
Corporate bond with an annual coupon : Five years ago, Highland, Inc. issued a corporate bond with an annual coupon of $7,000, paid at the rate of $3,500 every six months, and a maturity of 25 years. The par (face) value of the bond is $1,000,000. Recently, however, the company has run in..
What are the basic need-satisfying benefits : How and What? What are the basic need-satisfying benefits? Does a competitor's product fit a need this product/service does not provide

Reviews

Write a Review

JAVA Programming Questions & Answers

  Describe creating java programs to calculate the squares

Using a while loop, write the square of all integer numbers from 0 to 10 make the program calculate the squares

  Create an interface called player

Create an interface called Player. The interface has an abstract method called play() that shows a message describing the meaning of "play" to the class.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Create file lab7.java with a main method.

Create file Lab7.java with a main method. Inside your main method, write a segment of code which instantiates an object of the Student class (This class has been created for you in the  Student.java  file that is provided as part of this lab).

  Write an application that uses an array to store

Write an application that uses an Array to store 10 messages of type String - You will store this Array with 10 messages

  The user is assumed to enter the list in sorted order

Make sure you FULLY test your program! Make sure to run your program multiple times, inputting combinations of values that will test all possible conditions for your IF statements and loops. Also be sure to test border-line cases.

  Explain calculating average asdouble

EnhancedTestScoreApp.javacompiles, Uses += onscoreCountandscoreTotalfields, UsesMathclass methods to track minimum and maximum scores, Displays minimum and maximum scores at end, ChangedscoreTotaltoint, CastscoreCountandscoreTotaltodoublebefore calcu..

  Why is the order of the execution of two processes important

Modify the code so that the senderReceiver process sends then receives repeatedly suspending itself for 3 seconds between each iteration.

  Implement the basic properties of a bank account

Define the class bankAccount to implement the basic properties of a bank account. An object of this class should store the subsequent data:

  Write a script that simulates a casino machine

Write a script that simulates a casino machine. To play a single round on the machine user pays $ 5. Now when the user start the machine, the machine rolls a pair of dice

  Learn how expressions can be evaluated at run-time

Write a Java program (a collection of Java classes) including a class named ExpressionCalculator that contains a static main method. This main method will prompt the user to enter a constant expression.

  Outline a test plan for a substantial real-life system

Describe how you would approach the design and testing process to ensure success and quality in the result and where are the risks? How are you going to address them?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd