The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
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:
The Java application should meet these technical requirements:
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:
The Java application should meet these technical requirements:
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:");
}
}