I need to complete in javascriptA retail company assigns a 5
I need to complete in javascript-A retail company assigns a $5000 store bonus if monthly sales are $100,000 or more. Additionally, if their sales are 125% or more of their monthly goal of $90,000, then all employees will receive a message stating that they will get a day off.
Solution
Step 1: This program is easiest when solved using just one variable. Declare the variables that you will need in the program, using the proper data type and documenting the purpose. Depending on your programming style, you may find additional variables are useful. If that is the case, adjust your program as necessary.
Variable Name
Purpose
monthlySales
Stores the monthly sales
Step 2: Given the major task involved in this program, what modules might you consider including? Also describe the purpose of the module.
Module Name
Purpose
Module getSales ()
Allows the user to enter the monthly sales.
module isBonus ()
This module will determine if a bonus should be awarded.
module dayOff ()
This module will determine if a day off should be awarded.
Step 3: Complete the pseudocode by writing the missing lines. When writing your modules and making calls, be sure to pass necessary variables as arguments and accept them as reference parameters if they need to be modified in the module. (Reference: Writing a Decision Structure in Pseudocode, page 118).
Module main ()
//Declare local variables
Declare Real monthlySales
//Function calls
Call getSales(monthlySales)
Call isBonus
Call dayOff
End Module
//this module takes in the required user input
Module getSales(Real Ref monthlySales)
Display “Enter the total sales for the month.”
Input monthlySales
End Module
//this module will determine if a bonus is awarded
Module _____isBonus(Real monthlySales)
If monthlySales >=100000 Then
Print “You get a bonus of $5,000!!!”
End If
End Module
//this module will determine if all employees get a day
//off. If sales are greater than or equal to 112500, then
//they get a day off.
Module dayOff ( Real monthlySale)
If monthlySales >=90000 then
Print “you get the day off!!!”
End If
End Module And the
function main()
//Declare local variables
var real monthlySales;
//Function calls
{
monthlySales = getSales();
bonusMoney = getBonus();
dayOff = getdayOff();
}
//this module takes in the required user input
function getSales(monthlySales)
{
return prompt(\"Enter the total sales for the month.\");
}
//this module will determine if a bonus is awarded. If
//sales are greater than or equal to 100000, then they
//get a 5000 bonus
function getBonus(Real Ref monthlySales)
{
if monthlySales >=100000 then
println ?You get a bonus of $5,000!!!?;
}
//this module will determine if all employees get a day
//off. If sales are greater than or equal to 125% of $90000,
//then they get a day off.
function getDayoff(Real Ref monthlySales)
{
if monthlySales >=112500 then
println ? You get a bonus of $5,000!!!?;
println ?All employees get one day off!!!?;
| Variable Name | Purpose |
| monthlySales | Stores the monthly sales |


