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, 3 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 9.00

The Java application should meet these technical requirement

I had a project that I thought I had done correctly, but it will not run.  Can someone help me figure out why?  I took a screenshot of the Java Program and the error I was getting.  I'll also include the .java file to help.  Below is what the program should do.

Write a Java application using an Integrated Development Environment (IDE) (or directly from the command line compiler) that calculates the total annual compensation of a salesperson. Consider the following factors:

  • A salesperson will earn a fixed salary of $50,000.
  • A salesperson will also receive a commission as a sales incentive. Commission is a percentage of the salesperson's annual sales. The current commission is 15% of total sales.
  • The total annual compensation is the fixed salary plus the commission earned.

The Java application should meet these technical requirements:

  • The application should have two or more classes. There should be an application's controlling class (a controlling class is where the main function resides) and another class. Look over future assignments and think about the best way to write the second class so that it will be easily enhanced. Remember in our discussions that in OOP, an object usually represents an entity and all the data that describes it. What can be considered an entity in this assignment?
  • There should be proper documentation in the source code.
  • The application should ask the user to enter annual sales, and it should display the total annual compensation.

 

Prq'eclslll'ks m I: ShlPage Emmi-mm mammal a: EEIEIE
fimeWi‘m -WVIEI'I'IEEEE33L|§%%M¢HIOilv'l-b Ea it JavafipphmhonZ 52 (property nama="java.failunerrur" value="tIue"!> A r
BE Sour-ceFadage-s 53 - I (Java classpach="$lclaaapachitranslated}" classname="$lclafisname}" dir=" {work.dir}“ erF"$lplfiBf‘
E E ]avaappl\ahor127 , 5-1 <jvmarg valua="—Dfile.encuding:${2ncoding} "1)
‘_ @ WWZW 55 (redireccor input:ncuding="${encoding}"' outputencndinr"${encoding}" errorencodinr"$lencodin‘
m le(afles_ _ 56 (jvmarg 1ina="${run.jvmargs}" I)
& mum-5m“ 51' (arg line="${applica:icn.args}" J)
EB , (syspropercysecb-
59 (propercyref prefix="zu.n—sys—prop. ".13-
60 (mapper frnm="'ru.n—sys—prop.*" to="*" type="glnh"/)
6]. - (lsyspropa rt y52t>
62 - <fjava>
63 - <ftarget>

I had a project that I thought I had done correctly, but it will not run.  Can someone help me figure out why?  I took a screenshot of the Java Program and the error I was getting.  I'll also include the .java file to help.  Below is what the program should do.

Write a Java application using an Integrated Development Environment (IDE) (or directly from the command line compiler) that calculates the total annual compensation of a salesperson. Consider the following factors:

  • A salesperson will earn a fixed salary of $50,000.
  • A salesperson will also receive a commission as a sales incentive. Commission is a percentage of the salesperson's annual sales. The current commission is 15% of total sales.
  • The total annual compensation is the fixed salary plus the commission earned.

The Java application should meet these technical requirements:

  • The application should have two or more classes. There should be an application's controlling class (a controlling class is where the main function resides) and another class. Look over future assignments and think about the best way to write the second class so that it will be easily enhanced. Remember in our 

Prq'eclslll'ks m I: ShlPage Emmi-mm mammal a: EEIEIE
fimeWi‘m -WVIEI'I'IEEEE33L|§%%M¢HIOilv'l-b Ea it JavafipphmhonZ 52 (property nama="java.failunerrur" value="tIue"!> A r
BE Sour-ceFadage-s 53 - I (Java classpach="$lclaaapachitranslated}" classname="$lclafisname}" dir=" {work.dir}“ erF"$lplfiBf‘
E E ]avaappl\ahor127 , 5-1 <jvmarg valua="—Dfile.encuding:${2ncoding} "1)
‘_ @ WWZW 55 (redireccor input:ncuding="${encoding}"' outputencndinr"${encoding}" errorencodinr"$lencodin‘
m le(afles_ _ 56 (jvmarg 1ina="${run.jvmargs}" I)
& mum-5m“ 51' (arg line="${applica:icn.args}" J)
EB , (syspropercysecb-
59 (propercyref prefix="zu.n—sys—prop. ".13-
60 (mapper frnm="'ru.n—sys—prop.*" to="*" type="glnh"/)
6]. - (lsyspropa rt y52t>
62 - <fjava>
63 - <ftarget>
6-1 - <fnroject>
65 "
IIIIr'gI‘IoI ii I:
AntTathis v E
A rln
v ' I III—,] ,
$3 Prunect > 69 target > a: Output - salescammissinn {ru nl 8% D p run: Errnr: Cauld nut find at load main class aaleammsaiun.SalesCDmmiasiDn BUILD FAILED ttutal ‘BILEEZ 0 seconds) $.83

6-1 - <fnroject>
65 "
IIIIr'gI‘IoI ii I:
AntTathis v E
A rln
v ' I III—,] ,
$3 Prunect > 69 target > a: Output - salescammissinn {ru nl 8% D p run: Errnr: Cauld nut find at load main class aaleammsaiun.SalesCDmmiasiDn BUILD FAILED ttutal ‘BILEEZ 0 seconds) $.83

/package com.mglaman;
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. annualSalesInput = bufferedReader.readLine(); try {
// If the input cannot be converted to a double, throw
IOException. salesPerson.setAnnualSales(Double.parseDouble(annualSalesInput));
validEntry = true;
} catch (NumberFormatException e) {
SalesCommission.showWarning();
}
} catch (IOException e)
{
SalesCommission.showWarning();
// 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());
}
/** * 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:");
}
}

Attachments:

Answers

(11)
Status NEW Posted 27 Apr 2017 05:04 AM My Price 9.00

-----------

Not Rated(0)