Question

For Javascript: Employees at Morning Buzz Coffee Shop have been told they’ll get a bonus if they ...

For Javascript:

Employees at Morning Buzz Coffee Shop have been told they’ll get a bonus if they bring in enough pounds of recyclable newspapers. They want a program to calculate the amount they need to bring in each day to make this total, based on the total number of pounds to be collected and the number of days they’ll be bringing in newspapers. The program should ask for these amounts and calculate how many pounds they need to bring in each day to make the total in that number of days. They plan to run the program several times until they find a number of pounds that seems reasonable.


Using pseudocode, develop an algorithm to solve this problem.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
<html>
    <body>
        <div>
            Enter total amount to earn $ <input type = "number" id = "input-total-amount">
            <br>
            Enter number of days to collect <input type = "number" id = "input-days">
            <br>
            Enter bonus earned per pound of newspaper $ <input type = "number" id = "input-bonus-per-pound">
            <br><br>
        </div>
        <button id = "calculate-button" onClick = "main()">Calculate</button>
        <br>
        <div>
            <br>Pounds of newspaper to bring daily 
            <textarea id = "output-box" style = "height : 20px;"></textarea>
        </div>
        <script>
            function main(){
                var amountToEarn = document.getElementById("input-total-amount").value;
                var days = document.getElementById("input-days").value;
                var bonusPerPound = document.getElementById("input-bonus-per-pound").value;
                var totalPoundsToBring = amountToEarn/bonusPerPound;
                var poundsToBringDaily = totalPoundsToBring/days;
                document.getElementById("output-box").value = poundsToBringDaily;
                document.getElementById("output-box").disabled = true;
                document.getElementById("output-box").style.visibility = "visibile";
            }
        </script>
    </body>
</html>

SAMPLE OUTPUT:

Enter total amount to eam S 50 Enter number of days to collect 10 Enter bonus earned per pound of newspaper S 1.5 Calculate P

Add a comment
Know the answer?
Add Answer to:
For Javascript: Employees at Morning Buzz Coffee Shop have been told they’ll get a bonus if they ...
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
  • SYNOPSIS The product manager for coffee development at Kraft Canada must decide whether to introduce the...

    SYNOPSIS The product manager for coffee development at Kraft Canada must decide whether to introduce the company's new line of single-serve coffee pods or to await results from the product's launch in the United States. Key strategic decisions include choosing the target market to focus on and determining the value proposition to emphasize. Important questions are also raised in regard to how the new product should be branded, the flavors to offer, whether Kraft should use traditional distribution channels or...

  • You might be familiar with Crazy Eddy, an owner of the “Crazy Eddy’s” home electronics stores...

    You might be familiar with Crazy Eddy, an owner of the “Crazy Eddy’s” home electronics stores that used to exist when you were younger (though maybe too young to remember). Some of the larger superstores like Best Buy and Circuit City moved in and began squeezing Eddy. As it turned out his tagline, “where the prices are insane,” was quite true, and he was forced out of business. Unbeknownst to many, Eddy was an avid skier, and his desire to...

  • My question is about the case study “ Comparing Apples and Oranges: which group yuelds the...

    My question is about the case study “ Comparing Apples and Oranges: which group yuelds the best profit?” 1) Using the Excel apreadsheet attached to complete the rooms sold and revenue projections based on the above case study. Case Study: "Comparing Apples and Oranges: Which Group Yields the Best Profit?" ​The Diamond Peak Hotel, one of 45 hotels in the Host Marriott management company, was bustling with business this Thursday afternoon as the hour of the daily revenue meeting drew...

  • I have this case study to solve. i want to ask which type of case study...

    I have this case study to solve. i want to ask which type of case study in this like problem, evaluation or decision? if its decision then what are the criterias and all? Stardust Petroleum Sendirian Berhad: how to inculcate the pro-active safety culture? Farzana Quoquab, Nomahaza Mahadi, Taram Satiraksa Wan Abdullah and Jihad Mohammad Coming together is a beginning; keeping together is progress; working together is success. - Henry Ford The beginning Stardust was established in 2013 as a...

  • Read about Cokes strategy in Africa in the article below and discuss the ethics of selling...

    Read about Cokes strategy in Africa in the article below and discuss the ethics of selling soft drinks to very poor people. Is this an issue that a company like Coke should consider? Africa: Coke's Last Frontier Sales are flat in developed countries. For Coke to keep growing, Africa is it By Duane Stanford Piles of trash are burning outside the Mamakamau Shop in Uthiru, a suburb of Nairobi, Kenya. Sewage trickles by in an open trench. Across the street,...

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