CS FOR THE LEARNING VILLAGE
  • home
    • PK-1
    • 2-4
    • 5-8
  • who?
  • what?
    • curriculum
    • social media
    • blog
    • SPARK! CS
    • summer SPARK!
  • where?
  • home
    • PK-1
    • 2-4
    • 5-8
  • who?
  • what?
    • curriculum
    • social media
    • blog
    • SPARK! CS
    • summer SPARK!
  • where?
Search

  • Highlight the code below & copy it.
  • Paste it into Bitsbox.
  • Run code. What does it do?
    • ​How much money do you raise by selling 4 cups of lemonade?
    • How much money do you raise by selling 50 cups of lemonade?
  • Supplies cost $45/week. How will you need to update the answer equation to show only profit? Assuming price is still $1.25/cup:
    • ​How many cups of lemonade must you sell to break even? (In other words, how many cups of lemonade must you sell to offset the cost of supplies?)
    • What will your profit be if you sell 50 cups of lemonade?
    • The $45.00 in supplies allows you to make 135 cups of lemonade. What is your maximum profit this week?
    • How many cups do you have to sell per week to break even?
  • Update code, so that it prompts user to input price.
    • How many cups do you need to sell to break even at $0.75/cup?
    • What price do you need to charge to earn a profit of at least $25?
  • Try out a different fill & sound. 
  • Try moving message around the screen. For example, for message =, the 100, 200 are x, y. The far left-hand corner of screen is 0, 0.

fill('lemonclock')
message = text('FUNction', 380, 500, 'white', 50)
delay (calculate, 1200)

function calculate() {
  price = 1.25
  cups = prompt ('How many cups?')
  cupsf = parseFloat(cups)
  answer = price * cupsf 
  message.change('$' + answer)
  sound('chaching')
}
powered by
Picture
Picture
  • home
    • PK-1
    • 2-4
    • 5-8
  • who?
  • what?
    • curriculum
    • social media
    • blog
    • SPARK! CS
    • summer SPARK!
  • where?