Adjust the given code with the instructions given. It should be an complete diff
ID: 3856992 • Letter: A
Question
Adjust the given code with the instructions given. It should be an complete difference, this is for my java class. Thank you. The code is at the top and the instructions and output is at the bottom!
Pad 11:03 AM 89% 18,111 k* * @(#)RossJOI TPA2 * @author Jonathan Ross *@version 1.00 6/25/2017 3:00 PM *Program Purpose: Code a program that computes sales revenue * to-date to determine the status of the company's *sales revenue and whether a year end bonus is in store for the employees import java.util.*; public class RossJO1TPA2 public static void main(String[largs) Calendar dateTime = Calendar.getinstance();//Get from Calender Scanner input = new ScannerSystem.in);//input Scanner String monthNo -"", String report "TANDEM ENTERPRISES"; double salesRevenue 0.0: double quarterlySales 0.0; double annua!Sales = 0.0; double projectedSales 0.0;Explanation / Answer
/** * @(#)RossJ01TPA2 * @author jonathan Ross * @version 1.00 6/25/2017 3:00PM * Program Purpose : Code to program that computes sales revenue * to-date to determine the status of company's sales revenue and whether a year end bonus is in store for the employees */ import java.util.Calendar; import java.util.Scanner; public class RossJ01TPA2 { static String report = "TANDEM ENTERPRISES"; static Scanner input = new Scanner(System.in);//input scanner static String monthNo=""; /** * Prints the required message of if sales are good till date or lagging behind * @param noQrtrs : number of quarters * @param profitMargin: profit margin */ public static void printMessages(int noQrtrs,double profitMargin) { if(noQrtrs=20) System.out.printf("%nKeep up the GOOD work and a possible year-end bonus!"); else System.out.printf("%nSo far sales are lagging behind projections"); }//End IF noOfQtrs=20) System.out.printf("%nIts been a GOOD year. Thank you for all your hard work!%n"+"%nEmployees qualify for a 5%% year-end bonus!!!"); } } public static String determineMonthNo(int monthCounter) { if(monthCounter==1) { monthNo = "1st"; }//End if 1st month else if(monthCounter==2) { monthNo="2nd"; }//END if 2nd month else if (monthCounter==3) { monthNo="3rd"; }//End of 3rd month return monthNo; } /** * calculates the profit margin * @param annualSales - annual sales till date * @param projectedSales - target projected sales * @param noofQrtrs - number of quarters * @return */ public static double calProfitMargin(double annualSales, double projectedSales, int noofQrtrs) { return (annualSales/projectedSales*noofQrtrs)*100; } /** * Prints the sales revenue * @param noOfQtrs - no of quarters * @param annualSales - annual sales */ public static void printSalesRevenue(int noOfQtrs, double annualSales) { report+=String.format("%n%nTotal Year-to-Date: $%19.2f%n",annualSales); System.out.printf("%s",report); } /** * sets the sales revenue for each month in each quarter * @param month - month number of the quarter * @param quarter - quarter number * @return */ public static double sesetSalesRevenue(String month, int quarter) { System.out.printf("%nEnter the sales revenue for the %s month of quarter %d;",month,quarter+1); return input.nextDouble(); } /** * * @return projected sales given as input */ public static double setProjectedAnnualSales() { System.out.printf("%n What is the projected annual sales?");//prompt for projected sales return input.nextInt(); } /** * * @return number of quarters given as input */ public static int setNoOfQuarters() { System.out.printf("%nEnter the number of quarters(no less than 1 or greater than 4)");//prompt for quarter return input.nextInt(); } public static void main (String[] args) { Calendar dateTime = Calendar.getInstance();//Get from Calender double salesRevenue = 0.0; double quarterlySales = 0.0; double annualSales = 0.0; double projectedSales = 0.0; double profitMargin = 0.0; int monthCounter = 1; int qrtrCounter = 0; int noOfMonths = 3; int noOfQtrs = 0; String qrtrNo=""; projectedSales = setProjectedAnnualSales(); noOfQtrs = setNoOfQuarters(); projectedSales = projectedSales/4; report += String.format("%nSALES REVENUE FOR %d QUARTERS OF %tY%n",noOfQtrs,dateTime); do { quarterlySales=0; monthCounter=1; System.out.println(); for(monthCounter=1;monthCounterRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.