ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 2 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 27 Apr 2017 My Price 11.00

Three Java application using NetBeans IDE

We chatted last night and you said you'd like to help me with my Week 4 Assignment.  I am attaching it.  Do you need my Week 3 assignments, or do you still have them?

 

Modify the Week Three Java application using NetBeans IDE to meet these additional and changed business requirements:

  • The application will now compare the total annual compensation of at least two salespersons.
  • It will calculate the additional amount of sales that each salesperson must achieve to match or exceed the higher of the two earners.
  • The application should ask for the name of each salesperson being compared.

The Java application should also meet these technical requirements:

  • The application should have at least one class, in addition to the application's controlling class.
  • The source code must demonstrate the use of Array or ArrayList.
  • There should be proper documentation in the source code.

 

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
*
* Class SalesCommission
*
*
*
* Main class to initiate a terminal application allowing sales employees to
* calculate expected salary after commission.
*
*
*
* @package Sales Commission Calculator
*
*
* @author Robin Mathers * @course PRG/420
*
*
*/
public class SalesCommission {
/**
*
*
* Initialize the program.
*
*
* @param args Application arguments.
*
*
*/
public static void main(String args) {
// Initiate sales person class.
SalesPerson salesPerson = new SalesPerson();
// Request user to enter current annual sales amount.
System.out.print("Enter your current annual sales: $");
BufferedReader bufferedReader = new BufferedReader(new
InputStreamReader(System.in));
// Initiate string value to be read from terminal. String
annualSalesInput;
// Use boolean to track if we can move on to calculations.
boolean validEntry = false;
// Keep prompting for data until we get an integer or double.
while (!validEntry) {
try {
// Begin to read the user's input.
String annualSalesInput = bufferedReader.readLine(); IOException. try {
// If the input cannot be converted to a double, throw salesPerson.setAnnualSales(Double.parseDouble(annualSalesInput));
// Print out the data user is looking for.
System.out.println("Current salary: $" +
salesPerson.getSalary()); System.out.println("Estimated amount from commission: $" +
salesPerson.getCommissionAmount());
System.out.println("Total compensation is expected to be: $"
+ salesPerson.getCompensation());
//potential sales
System.out.println("Total Sales\tTotal compensation: ");
double target = 1.5 * Double.parseDouble(annualSalesInput);
// for loop with +5000 increments from current sales to
target
for (double x = Double.parseDouble(annualSalesInput); x <=
target; x += 5000) {
salesPerson.setAnnualSales(x);
System.out.println(x + "\t" +
salesPerson.getCompensation());
}
validEntry = true;
} catch (NumberFormatException e) {
SalesCommission.showWarning();
}
} catch (IOException e) {
SalesCommission.showWarning();
}
} } /**
*
*
* Static method for returning error message on bad input.
*/
protected static void showWarning() {
System.out.println("Sorry, that doesn't appear to be proper format. Try
again:");
}
}

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* Robin Mathers * @course PRG/420
*/
public class SalesPerson {
//declare variables
double fixedSalary=50000.00;
double incentive = 80;
double salesTarget = 120000;
double accelerationFactor = 1.25;
double percentageCommission = 15;
double totalCommision = 0;
double sales = 0;
//getter and setter methods
public void setAnnualSales(double sales){
this.sales = sales;
}
public double getSalary(){
return this.fixedSalary;
}
public double getCommissionAmount()
{
/** This getCommision() the salesperson sales value and calculate
commission*/
//check if sales target is exceeded
if (sales >+ salesTarget){
totalCommision = (sales * (percentageCommission / 100 *
accelerationFactor));
}
//salesperson has come close to 80 but hasn't exceeded target
if (sales<=salesTarget && sales>=(incentive /100 * salesTarget)){
totalCommision = (percentageCommission * sales / 100);
}
return totalCommision;
}
public double getCompensation(){
/**
getCompensation() will take in sales and calculate the total
compensation of a salesPerson
**/
return getCommissionAmount()+ fixedSalary;
}
}

Answers

(11)
Status NEW Posted 27 Apr 2017 02:04 AM My Price 11.00

-----------

Attachments

file 1493259240-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)