I am trying to do a homework assignment and I am having issues getting the code to work. Here is the task and then my code so far. Any help would be appreciated.
Task: 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.
function Main() var real monthlySales; { bonusMoney = getBonus(); dayoff = getdayOff(); getSales = monthySales(); }
function getSales(Real Ref monthlySales) { return prompt("Enter the total sales for the month."); end function }
function getBonus(Real Ref monthlySales) { If monthlySales >=100000 Then Println ?You get a bonus of $5,000!!!?; End If End function }
function GetDayoff(Real Ref monthlySales) { if monthlySales >=112500 Then Println ? You get a bonus of $5,000!!!?; Println ?All employees get one day off!!!?; End If End function
Main();
When I run this in the display window all I get is
Question
kevinv
Task:
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.
function Main()
var real monthlySales;
{
bonusMoney = getBonus();
dayoff = getdayOff();
getSales = monthySales();
}
function getSales(Real Ref monthlySales)
{
return prompt("Enter the total sales for the month.");
end function
}
function getBonus(Real Ref monthlySales)
{
If monthlySales >=100000 Then
Println ?You get a bonus of $5,000!!!?;
End If
End function
}
function GetDayoff(Real Ref monthlySales)
{
if monthlySales >=112500 Then
Println ? You get a bonus of $5,000!!!?;
Println ?All employees get one day off!!!?;
End If
End function
Main();
When I run this in the display window all I get is
Link to comment
Share on other sites
8 answers to this question
Recommended Posts