fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. /*/*
  14. *Rachel Sussman
  15. *Prg/420
  16. *5/27/15
  17. *Simple Commission Calculation Program Part 1
  18. */
  19. // This program will calculate the total annual compensation of a salesperson.
  20.  
  21. // This program will calculate the total annual compensation of a salesperson.
  22. // Author - Brad Eyman
  23. import java.util.Scanner;
  24.  
  25. public class commission.java
  26. {
  27.  
  28. // This is the beginning of the main method
  29. public static void main(String[] args)
  30. {
  31.  
  32. // This method displays the salesperson's fixed annual salary
  33. double monthlySalary; // Salesperson's fixed monthly salary
  34. monthlySalary = 10000;
  35. double annualSalary; // Salesperson's fixed annual salary
  36. annualSalary = monthlySalary * 10; // 10 represents months in a ten month employee contract
  37.  
  38. System.out.println("The Salesperson earns a fixed monthly salary of $"
  39. + monthlySalary + ".");
  40. System.out.println("The Salesperson earns a fixed annual salary of $"
  41. + annualSalary + ".");
  42.  
  43. // This method displays the salesperson's commission rate
  44. int commission;
  45. commission = 5;
  46.  
  47. System.out.println("The Salesperson will receive a commission of "
  48. + commission + "%.");
  49.  
  50. // Creates Scanner to collect annual sales input from salesperson
  51. Scanner input = new Scanner(System.in);
  52.  
  53. double annualSales; // Salesperson's annual sales
  54.  
  55. System.out.print("Enter annual sales: ");
  56. annualSales = input.nextDouble();
  57.  
  58. double commissionCalc; // Calculates commission of annual sales
  59. commissionCalc = annualSales * .05;
  60.  
  61. System.out.println("The annual sales of the salesperson is $"
  62. + commissionCalc + " using a 5% commission.");
  63.  
  64. double totalAnnualSum; // Salesperson's total annual compensation
  65. totalAnnualSum = annualSalary + commissionCalc;
  66.  
  67. System.out.println("The total annual compensation of the salesperson "
  68. + "is: $" + totalAnnualSum + ".");
  69.  
  70. } // end main method
  71. } // end class CommissionCalculation1
  72. }
  73. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:23: error: illegal start of expression
import java.util.Scanner;
^
Main.java:23: error: not a statement
import java.util.Scanner;
                ^
Main.java:25: error: illegal start of expression
public class commission.java 
^
Main.java:25: error: '{' expected
public class commission.java 
                       ^
4 errors
stdout
Standard output is empty