COMPUTER SCIENCE CAFÉ
  • WORKBOOKS
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • BLOCKY GAMES
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY
  • WORKBOOKS
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • BLOCKY GAMES
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY
CODING CHALLENGES | VARIABLES AND INPUT
ON THIS PAGE
CHALLENGE 1 | MY FIRST CHAT BOT
​CHALLENGE 2 | WEEKEND WALKING
CHALLENGE 3 | BAKE SALE
Picture
​SUBSCRIBE FOR SAMPLE SOLUTIONS
ALSO IN THIS TOPIC
LEVEL 1 | GETTING STARTED
YOU ARE HERE | LEVEL 2 | VARIABLES AND USER INTERACTION
LEVEL 3 | DATATYPES AND OPERATORS
LEVEL 4 | IF STATEMENTS
LEVEL 5 | LOOPS
​LEVEL 6 | ARRAYS / LISTS
LEVEL 7 | FUNCTIONS
LEVEL 8 | ALGORITHM DESIGN
LEVEL 9 | OOP
LEVEL 10 | EXTERNAL DATA HANDLING
TURTLE CHALLENGES
DEBUGGING AND TRACING​
CHALLENGE SOLUTIONS

Picture
WATCH THIS VIDEO TO HELP YOU WITH THIS SECTION
Picture
CHALLENGE 1 | MY FIRST CHAT BOT
Create a program to do the following:
1: Ask the user their name and store the answer in a variable.
2: Use the users name in a response and ask the user what day it is and save the answer in a variable.
3: Ask the user what the weather is like. Give some prompts for response for example' Rainy', 'Cloudy', 'Sunny', 'Hot', 'Cold'. 
4: Return a statement to the user to wish them a happy day, use all data saved in your variables in the response.
When you run your program it should look something like the output shown below.
EXAMPLE OUTPUT
Hello what is your name? Bob
Hello Bob, what day is it today? Monday
And what is the weather like today? Sunny
Ok Bob, I hope you enjoy your day on this Sunny Monday
Picture
​CHALLENGE 2 | WEEKEND WALKING
Create a program to do the following:
1: Ask the user their name and store the answer in a variable.
2: Ask the user how many kilometers they walked on Saturday and store in a variable.
3: Ask the user how many kilometers they walked on Sunday and store in a variable.
4: Add the kilometers walked on Saturday and Sunday together and store in a new variable.
5: Output to the user, in a sentence, the total kilometer walked.
​
EXAMPLE OUTPUT
Hello what is your name? Bob
Hello Bob, how many kilometers did you walk on Saturday? 10
Ok Bob, how many kilometers did you walk on Sunday? 7
Great walking Bob, that means you walked a total of 17 kilometers this weekend.
Picture
Picture
CHALLENGE 3 | BAKE SALE
A local bake sale wants to sell the following:
1: Pie's at $4 each
2: Muffin's at $3 each
3: Donut's at $2 each
Can you create a program to help them calculate the bill for each customer. 


Create a program to do the following:
1: Ask the customer how many pie's they want to buy.
2: Create a subtotal cost for the total cost of pie's the customer wants.
3: Ask the customer how many Muffin's they want to buy.
4: Create a subtotal cost for the total cost of Muffin's the customer wants.
5: Ask the customer how many Donut's they want to buy.
6: Create a subtotal cost for the total cost of Donut's the customer wants.

7: Add the subtotals and output the total value of the purchase.
Picture
Picture
NAVIGATION
LEVEL 1 | GETTING STARTED
LEVEL 2 | VARIABLES AND USER INTERACTION
LEVEL 3 | DATATYPES AND OPERATORS
LEVEL 4 | IF STATEMENTS
LEVEL 5 | LOOPS
​LEVEL 6 | ARRAYS / LISTS
LEVEL 7 | FUNCTIONS
LEVEL 8 | ALGORITHM DESIGN
LEVEL 9 | OOP
LEVEL 10 | EXTERNAL DATA HANDLING
TURTLE CHALLENGES
DEBUGGING AND TRACING​
CHALLENGE SOLUTIONS
Picture
SUGGESTIONS
We would love to hear from you
SUBSCRIBE 
To enjoy more benefits
We hope you find this site useful. If you notice any errors or would like to contribute material then please contact us.