IB Computer Science Unit 1
IB Computer Science Unit 2
IB Computer Science Unit 3
IB Computer Science Unit 4
IB Computer Science Unit 5
IB Computer Science Unit 6

IB Computer Science Practice Java Evaluation 3

IB Computer Science Question 1

You are going to create a guessing game Graphical User Interface, where the computer picks a random number between 1 and 100 and lets you keep guessing until you get it right.

Your program should have an input field for the user guess and a button to accept the guess into the program. Once the button is clicked output the following

  •  If the guess matches the target, display “You Got It”
  • If the guess is higher than the target, display “Too High”
  • If the guess is lower than the target, display “Too Low”

Your program should also give hints to user to help them out

  •  Freezing -> Guess was more than 50 away
  • Cold -> More than 25 away but less than 50
  • Cool -> More than 15 away but less than 25
  • Warm -> More than 10 away but less than 15
  • Hot -> More than 5 away but less than 10
  • Boiling -> Between 1 and 4 away

For your program to work correctly, you will not be able to write the code to generate the random number in the “Button”.

If you do then it will create another random number every time the button is clicked which isn’t what you want. You want it to only be generated one time at the start of the program.

You can accomplish this by creating a global variable at the top of your program and then that variable will be able to been seen by your button click event but will only execute once.

IB Computer Science Evaluation 3 Q1

IB Computer Science Question 2

Write a program that checks if a given point is within a circle of a given radius and center

Your program should have as inputs

  • The x and y coordinates of the point to test
  • The x and y coordinate of the center of the circle
  • The radius of the circle

Your program should output the following

  • A simple message of “In the Circle” or “Not in the Circle”.
  • The quadrant of the test point and the quadrant of the circle

Use a Graphical User Interface for this problem.

IB Computer Science Question 3

Write the program to have a player play against the computer in a game of Rock Paper Scissors Lizard Spock

IB Computer Science Rock Paper Scissors Lizard Spock

DO NOT WRITE A GUI FOR THIS PROGRAM, USE TEXT BASED INPUT AND OUTPUT

Have the user enter their choice.

Make the computer randomly generate their choice (Hint Use Random #’s and assign the random number to a game choice) and display it to the screen

Output the proper result of the game depending on the player and computer choices

IB Computer Science Question 4

The Saffir-Simpson Hurricane Scale provides a rating (a category) depending on the current intensity of a hurricane. Create a hurricane Graphical User Interface that prompts the user to enter the hurricane category and then displays the wind speed according to the chart below

Your program should be able to handle if the user enters a category number that is not between 1 and 5 and display an appropriate message

IB Computer Science Question 5

Write a program that asks the user to enter 3 numbers from the keyboard and displays the numbers from smallest to largest.

Your program can only use if or if – else statements (If you know something about loops, you can’t use them in this solution)

There is no need for a graphical user interface for this program.

Looking to Learn More about Computer Science and Coding?

Check out our programing in python courses that focus on high school level coding.  

  • Grade 11 Computer Science ICS3U
  • Grade 12 Computer Science ICS4U

These courses are complete with interactive coding lessons, teacher led videos, and more practice questions with complete solutions

Return To International Baccalaureate Computer Science Main Page