Question

I need help solving these 2 problems using JavaScript coding 1. A sales agent is paid...

I need help solving these 2 problems using JavaScript coding

1. A sales agent is paid commission on sales. If she sells 200 products per month, she receives a commission of 10%. If she sells more than 200 products but less than 350, she receives a commission of 15 %. If she sells more than 350 products per month, she receives a commission of 20%. Using pseudocode, create an algorithm for the sales agent.

  1. Develop a JavaScript program based on the algorithm you created in question 1
0 0
Add a comment Improve this question Transcribed image text
Answer #1

algorithm using pseudocode algorithm for the sales agent :

input numberOfProducts

if numberOfProducts <= 200 then commission 10%

else if numberOfProducts > 200 and numberOfProducts <=350 then commission 15%

else if numberOfProducts > 350 then commission 20%

print commission

Program :

commission.html :

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <!-- title for web page -->

    <title>Commission percentage</title>

</head>

<body>

    <!-- <script> is used for javascript -->

        <script>

        //asking user number of products

        var numberOfProducts=parseInt(prompt("Enter number of products.","Products"));

        var commission;//variable used to store commission      

        //checking products

        if(numberOfProducts<=200)

        {

            //if numberOfProducts is less then or equal to 200 then

            commission=10;//set commission

        }

        else if(numberOfProducts>200 && numberOfProducts<=350)

        {

            //if numberOfProducts is greater than 200 and less then or equal to 350 then

            commission=15;//set commission

        }

        else if(numberOfProducts>350)

        {

            //if numberOfProducts is greater than 350 then

            commission=20;//set commission

        }

        //print commission

        console.log("Commission percentage is "+commission+"%");        

        </script>

</body>

</html>

===========================

Screen 1:Screen asking number of products

Screen 2:Screen showing commission percentage

Add a comment
Know the answer?
Add Answer to:
I need help solving these 2 problems using JavaScript coding 1. A sales agent is paid...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I need help solving these problems using JavaScript coding i want to know the proper codes...

    I need help solving these problems using JavaScript coding i want to know the proper codes for this problem using Javascript Need help solving these two problems Create a pseudocode program that creates a form and asks the user to enter the date in the format mm/dd/yy. Validate the form to ensure the date was entered correctly. Convert the pseudocode in question one to JavaScript and test your program

  • Need any help I can get solving this problem. I just started coding less than a...

    Need any help I can get solving this problem. I just started coding less than a month ago. A) Woody Furniture Sales The Woody Furniture Company sells several types of styles of chairs. Write a program that will take from the keyboard input • name of a chair style, • number of chairs sold of that style, • price of each chair of that style. Do this for three chairs (do not use loops i.e. you will need three chair...

  • Can I get help with in 1 hour or less Please Limited Resources Maria Pajet, a...

    Can I get help with in 1 hour or less Please Limited Resources Maria Pajet, a regional sales representative for UniTec Systems, Inc., has been working about 80 hours per week calling on a total of 123 regular customers each month. Because of family and health considerations, she has decided to reduce her hours to a maximum of 160 per month. Unfortunately, this cutback will require Maria to turn away some of her regular customers or, at least, serve them...

  • The following form will be used to determine the sales commission of employees. Using Visual Basic...

    The following form will be used to determine the sales commission of employees. Using Visual Basic Studio, build the form with these features:  The checkbox “Target Met” must be disabled.  The title of the form should appear as “Sales Commissions” Write the code to do the following: After entering the totals sales, the checkbox will automatically be checked if the average sales per month was $1,500 or more. Note: The average sales per month can be calculated by...

  • I only need help with requirements 2 and 3, not 1 and 4. I can't figure...

    I only need help with requirements 2 and 3, not 1 and 4. I can't figure out the breakeven points. Thank you! Pittman Company is a small but growing manufacturer of telecommunications equipment. The company has no sales force of its own; rather, it relies completely on independent sales agents to market its products. These agents are paid a sales commission of 15% for all items sold. Barbara Cheney, Pittman's controller, has just prepared the company's budgeted income statement for...

  • I need help solving these questions,please don’t know how to solve it by using matlab.!

    i need help solving these questions,please don’t know how to solve it by using matlab.! Solve the following questions Ol: You are required to develop a script to calculate the volume of a pyramid, which is 1/3 *base *height, where the base is length *width. Prompt the user to enter values for the length, width, and height, and then calculate the volume of the pyramid. When the user enters each value, he or she will then also be prompted to...

  • Hi, I need help for solving Linux question. . 1.Using the proper text editor, create a...

    Hi, I need help for solving Linux question. . 1.Using the proper text editor, create a shell file called by (your name), your enrollment number, your program and the courses you study. Use the appropriate variables and display the above to the standard output (screen). . 2. Write A Shell Script to perform the following: Display the files and directories Print the date in 24 hour format Display the System id Display the current working directory Print the status of...

  • I need help solving theses problems please and thank you. 1. When you drop a ball...

    I need help solving theses problems please and thank you. 1. When you drop a ball it accelerates downward at 9.8 m/s. If you instead throw it downward, then its acceleration immediately after leaving your hand, assuming no air resistance, is A. 9.8 m/s2 B. More than 9.8 m/s C. Less than 9.8 m/s D. Cannot say, unless the speed of the throw is given. 2. A heavy rock and a light rock in free fall (zero air resistance) have...

  • NEED SOLUTION TO THI SCASE STUDY ABC satellite, a satellite television company, sells satellite television service contr...

    NEED SOLUTION TO THI SCASE STUDY ABC satellite, a satellite television company, sells satellite television service contracts to customers, usually for a 24-month period. ABC satellite is a fast-growing, high-paced company created by aggressive salesmen. The company's success has made its owners very wealthy, many of them live a lavish life style and drive luxury cars to work. The retention division of this company is responsible for contacting customers nearing the end of his/her contract and convincing the customer to...

  • You need not run Python programs on a computer in solving the following problems. Place your...

    You need not run Python programs on a computer in solving the following problems. Place your answers into separate "text" files using the names indicated on each problem. Please create your text files using the same text editor that you use for your .py files. Answer submitted in another file format such as .doc, .pages, .rtf, or.pdf will lose least one point per problem! [1] 3 points Use file math.txt What is the precise output from the following code? bar...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT