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 4

IB Computer Science Question 1

You are going to write a program that asks the user for some positive integers. The program will start by asking the user to enter in how many numbers they want to enter. The program should then ask for all the numbers and then output the division between the biggest number entered and the smallest number entered.

IB Computer Science Question 2

Bill and Nick are playing a game in gym class. The teacher tells both Nick and Bill to walk forward a certain number of steps and then walk backward a different amount of steps.

  • Let’s call the amount of steps he told Nick to walk forward A and the amount of steps for him to walk backwards B
  • Let’s call the amount of steps he told Bill to walk forward C and the amount of steps for him to walk backwards D
  • B will always be less than A and D will always be less than C, so the boys will always end up moving forward

After they each take a certain number of steps, which we will call S, the teacher will blow the whistle and the boys will stop.

Write a program that inputs A,B,C,D,S and outputs their motion along with who is further from the starting point. Output tied if they are the same distance.

Sample Input
• A = 4, B = 2, C = 5, D = 3, S = 13

Sample Output
Nick
F F F F B B F F F F B B F = 5 paces from the start
Bill
F F F F F B B B F F F F F = 7 paces from the start
Bill is Ahead after 13 steps
Mastery Question – STEPS

IB Computer Science Question 3

Write a program that asks for the side length of an Isosceles Triangle and then draws 2 of them side by side on the screen. There should be 2 spaces between the base of the triangles.

 

IB Computer Science Question 4

You are going to display a bar graph with 5 bars.
Ask for each of the values in the bar graph and then using the symbol of your choice, draw the correct number of symbols horizontally across your screen. The maximum number that the user is going to enter will be 30.
If the user entered 3, 1, 6, 2, 5, your output might look like

IB Computer Science Question 5

You are going to write a program to create simple math questions using the addition, subtraction, multiplication (NOT DIVISION) of random integers.


Your program should generate the random math question, and ask for the answer.

  • It should keep asking for an answer as long as the user doesn’t get it correct.
  • Limit them to 5 tries and if they don’t answer correctly give them the answer.

After getting it correct or running out of tries, ask the user if they wish to continue playing the game.

  • If they wish to continue then ask another random question and repeat the process above
  • If they do not wish to continue display their score. “you took X tries to answer Y questions correctly”

IB Computer Science Question 6

Write a program that asks the user for an integer and then prints the pattern below depending on the integer entered

IB Computer Science Nested Loop Arrow Tip

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