Ask Experts Questions for FREE Help !
Ask
    kevinvigg617's Avatar
    kevinvigg617 Posts: 2, Reputation: 1
    New Member
     
    #1

    Nov 3, 2013, 06:46 PM
    Java script code error
    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 ()
    //Declare local variables
    Var real monthlySales;

    {
    GetSales(monthlySales)
    GetBonus (bonusMoney)
    GetDayoff (dayOff)
    }

    //this module takes in the required user input
    {
    Function getSales(Real Ref monthlySales)
    Display “Enter the total sales for the month.”;
    End function
    }

    //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!!!”;
    End If
    End function
    }

    //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!!!”;
    End If
    End function
    }
    End main()
    kevinvigg617's Avatar
    kevinvigg617 Posts: 2, Reputation: 1
    New Member
     
    #2

    Nov 3, 2013, 07:12 PM
    Revised code and all I get is in the display window is
    ...

    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();

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Java Script [ 1 Answers ]

Have recently had trouble downloading, message appears having trouble because Java Script is not working correctl on this PC. I went into program files, and found two Java's listed jre1,50 and jre 6, 68.9 and 75.6 mb respectivy, Should I have two, and what can I do ? Rony 4431

IE script error in the script on this page res://ieframe.dll/preview.dlg [ 1 Answers ]

IE script error in the script on this page res://ieframe.dll/preview.dlg

Calling Java Script Function in C# code [ 1 Answers ]

How to call a java script function in c# code.


View more questions Search