Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

This program was designed using NetBeans IDE. The program is intended to calculate total annual compensation of a salesperson. Below is the code that was used to develop the program with the reasons each was used. This program was then tested in NetBeans and ran in NetBeans to determine if the program runs correctly after being built. The program was successfully ran in NetBeans and also in Windows command prompt as shown in the screen shots.

CODE

/*

 * 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.

 */

packagecommissioncalculation;

// This program will calculate the total annual compensation of a salesperson.

importjava.util.Scanner;

/**

 *

 * @author Michael Formet

 */

public class CommissionCalculation

{

    /**

     * @paramargs the command line arguments

     */

    // This is the beginning of the main method

public static void main(String[] args)

    {

          // always print your last name as the first output of your program

System.out.println("Formet");

        Scanner input = new Scanner(System.in);

        // This method displays the salesperson's fixed annual salary

doublemonthlySalary= 30000; // Salesperson's fixed monthly salary

doubleannualSalary= monthlySalary * 12; // Salesperson's fixed annual salary , 12 represents months in a year

System.out.println("The Salesperson earns a fixed monthly salary of $"+ monthlySalary + ".");

System.out.println("The Salesperson earns a fixed annual salary of $"+ annualSalary + ".");

        // This method displays the salesperson's commission rate

int commission= 5;

System.out.println("The Salesperson will receive a commission of "+ commission + "%.");

        // Creates Scanner to collect annual sales input from salesperson

doubleannualSales; // Salesperson's annual sales

System.out.print("Enter annual sales: ");

annualSales = input.nextDouble();

doublecommissionCalc; // Calculates commission of annual sales

doublepercentCalc = commission/100.0; // Makes commission calculable

commissionCalc = annualSales * percentCalc;

System.out.println("The annual sales of the salesperson is $"

                          + commissionCalc + " using a " + commission

                          + "% commission.");

doubletotalAnnualSum; // Salesperson's total annual compensation

totalAnnualSum = annualSalary + commissionCalc;

System.out.println("The total annual compensation of the salesperson "

                         + "is: $" + totalAnnualSum + ".");

    } // end main method

}

Attachment:- CommissionCalculation.rar

Java, Programming

  • Category:- Java
  • Reference No.:- M91793650
  • Price:- $25

Priced at Now at $25, Verified Solution

Have any Question?


Related Questions in Java

Assessment instructionsin this assessment you will complete

Assessment Instructions In this assessment, you will complete the programming of two Java class methods in a console application that registers students for courses in a term of study. The application is written using th ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Solving 2nd degree equationsbull write the following java

Solving 2nd degree equations • Write the following Java methods • boolean real-sols(double a, double b, double c): it returns true if the 2nd degree equation ax2 + bx + c has real solutions • double solution1(double a, d ...

Assessment instructionsin this assessment you will design

Assessment Instructions In this assessment, you will design and code a simple Java application that defines a class, instantiate the class into a number of objects, and prints out the attributes of these objects in a spe ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Assignment - method in our madnessthe emphasis for this

Assignment - "Method in our Madness" The emphasis for this assignment is methods with parameters. In preparation for this assignment, create a folder called Assign_3 for the DrJava projects for the assignment. A Cityscap ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As