Develop a java application program for such a given scenario

Assignment Help JAVA Programming
Reference no: EM13836165

Programming Principles

Assessment-

Objectives

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

Assessment task

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:

Sales Amount Commission Rate

$10,000 - $25,000 5%

$25,001-$50,000 6%

$50,001 - $75,000 8%

$75,001 - $100,000 10%

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 1
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, as shown in Figure 2.

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, as shown in Figure 4.

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 as shown in Figure 5 (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. Figure 6 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, as shown in Figure 7.

8. Exit

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

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8

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

public class SalesDataManager

{
public SalesDataManager( ) //constructor public void displayMenu()
public void inputData() public void sortByName( ) public void sortBySales( ) public void searchByName( ) public void searchBySales( ) public void displayStatistics( ) public boolean isValidName(String name)
public double calculateCommission(int salesAmount)
helper methods here if any
public static main(String [ ] args)
{
...................................
}
}

Testing

Testing is important. You should:

• list the different types of test cases.

• display the results of each test case.

Reference no: EM13836165

Questions Cloud

What are the major provisions of the law : What environmental problems motivated the writing of his law? Be as specific as possible - What kinds of costs, fines, or economic benefits are associated with the law? Provide economic data to support this.
How this policy help improve education for ell students : policy help improve education for ELL students
Determine the moles of khco3 : Determine the moles of KHCO3 that reacted from the mass of KHCO3 used and its molar mass
What is the result of having bsn degree in nursing : What is the result (O) of having BSN degree in nursing in comparison (C) to ADN degree nursing(P), affect the efficiency and effectiveness of the nursing care (I) on a daily basis (T)?
Develop a java application program for such a given scenario : 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.
Define judicial activism and judicial restraint. : Define judicial activism and judicial restraint.
Explain the long-chain fatty acids arachidonic acid : The long-chain fatty acids arachidonic acid and docosahexaenoic acid are present in breast milk and are added to some commercial formulas because they are important in the development of
Discuss the key issues management : Discuss the key issues management needs to consider in deciding whether to support an in-house R&D function or outsource all Research & Development.
How mattel barbie lost the war against the bratz doll : How Mattel's Barbie Lost the War against the Bratz Doll-Explain why Mattel's managers were able to slowly change decision making over time and what kinds of cognitive errors contributed

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a class named java1306cmis141c801 that performs the

write a class named java1306cmis141c801 that performs the following actions.prompt the user for an int between lower

  Write a method called sigma

Write a method called sigma that takes an int parameter n and returns the sum of all the integers from 1 to n (inclusive). For example, sigma(4) should return 10.

  Write a method called range that returns the range of value

Write a method called 'range' that returns the range of values in an array of integers. The range is defined as 1 more than the difference between the maximum and minimum values in the array. For example, if an array called list contains the value..

  In this project you need to write a program called gf2java

in this project you need to write a program called gf2.java to implement the finite field gfpnwhere p is a prime number

  Declare an array and initialize it

Which one of the following will declare an array and initialize it with five numbers?

  On any given execution your program

On any given execution your program will produce just one version of the figure. However, you should refer to the class constant throughout your code, so that by simply changing your constant's value and recompiling, your program would produce a f..

  Button to increase or decrease the number of the balls

Simulates a bouncing ball. Extend to allow mulitple balls. You can use the +I or -I button to increase or decrease the number of the balls and use teh Suspend and Resume buttoms to freeze the balls or resume bouncing. For each ball, assign a random c..

  Method that returns the user entered number

write a java program that continues to prompt the user to input a real number. if the number is positive, the program calculates and outputs the area of circle using the inputted number as a radius. If the number is negative, the program exits.

  Small computer system interface-standard computer disk

How many primary drive partitions are supported on computers that still conform to the standard established by MS-DOS? How many total partitions can a standard computer disk [Intergrated Drive Electronics (IDE)/Serial Advanced Technology Attachment (..

  Echo client-server application

ASSIGNMENT 1- An echo client-server application, You are required to develop an application that allows clients running on MS Windows platforms to send sequences of strings to an echo server running on a windows platform

  Program that will ask the user for total debt of customer

Write a Java program that will ask the user for the (1) name, (2) gender, and (3) total debt of customers.

  Goals of managing health information

Describe how you would explain the purpose and goals of managing health information to a new health care employee.

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