I need help in turning this pseudocode into a java program that can be executed
ID: 3710840 • Letter: I
Question
I need help in turning this pseudocode into a java program that can be executed in cmd prompt.
ou want to do EDIT IN WORD P Find Normal No Spacing Heading 1 Heading 2 Heading 3 e Replace Styles Editing Paragraph A retail company assigns a s5000 store bonus if monthly sales are more than $100, 000; otherwise a $500 store bonus is awarded. Additionally, they are doing away with the previous day off program and now using a percent of sales increase to determine if employees get individual bonuses. If sales increased by at least 49 then all employees get a $50 bonus. If they do not, then individual bonuses are . Step l: To accommodate the changes to the program, create the additional variables needed. Create a variable named storeAmount to hold the store bonus amount. Create a variable named empAmount to hold the individual bonus amount. Create a variable named saleeincrease to hold the percent of increase. //Declare local variables Declare Real monthlysales Declare Real ampamount.() Declare Real saleaIncreaseo Declare Real-ABR???(-), Step 2: The first module in the program is getSales0. Since this is still required, leave this module as is. This module should be written as follows: //MODULE 1 //this module takes in the required user input Module getsales (Real Ref menthlysalee Display "Enter the total sales for the month." Input nonthlysales End Module Step 3: The second module in the program was isBonus0. Since there are two types of bonuses now, rename this module and the module call to stoteBonuso. Write an if then else statementExplanation / Answer
/*Java does not have passs by refrence , hence code has been modified */
import java.io.*;
import java.util.*;
public class Demo147{
public static double getSales(){
Scanner sc = new Scanner(System.in);
System.out.println("Enter the total sales for the month:");
double a = Double.parseDouble(sc.nextLine());
return a;
}
public static double storeBonus(double m){
double s;
if (m >= 100000)
s = 5000;
else
s = 500;
return s;
}
public static double getIncrease(){
Scanner sc = new Scanner(System.in);
System.out.println("Enter percentage of sales:");
double s = Double.parseDouble(sc.nextLine());
return s;
}
public static double empBonus(double s, double s1){
double e = 0;
if (s >= 0.04 * s1)
e = 50;
else
e = 0;
return e;
}
public static void printBonus(double e, double s){
System.out.println("The store bonus is $" + s);
System.out.println("The employee bonus is $" + e);
}
public static void main(String[] args){
double monthlySales;
double storeAmount;
double empAmount;
double salesIncrease;
monthlySales = getSales();
salesIncrease = getIncrease();
storeAmount = storeBonus(monthlySales);
empAmount = empBonus(salesIncrease, monthlySales);
printBonus(storeAmount, empAmount);
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.