Year 8 Computer Science: String Manipulation

Computer Science
Year 8
11 questions
~22 mins
0 views0 downloads

About This Worksheet

This worksheet focuses on understanding and manipulating strings in programming. Complete the tasks to demonstrate your knowledge of string operations.

Worksheet Preview

Full preview • 11 questions

Year 8 Computer Science: String Manipulation

Subject: Computer ScienceGrade: Year 8
Name:
Date:
TeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizzTeachWhizz

Untitled Worksheet

Grade Year 8
A

Questions

This worksheet focuses on understanding and manipulating strings in programming. Complete the tasks to demonstrate your knowledge of string operations.

Answer all questions in the spaces provided.
1.
Write a line of code in your preferred programming language that creates a string variable called 'greeting' with the value 'Hello, World!'.
[3 marks]
2.
Given the string 'Programming', write a method or function call that returns the substring 'gram'.
[4 marks]
3.
What will be the output of the following string operation? If the string is 'Computer', what is the result of 'Computer'.lower()?
[2 marks]
4.
Explain what the following code does: string = 'Hello'; string = string + ' there!'.
[3 marks]
5.
Write a small program snippet that checks if the string 'data' contains the letter 'a'.
[3 marks]
6.
Describe how to reverse the string 'Python' using string slicing.
[4 marks]
7.
A string variable contains the text 'Mississippi'. Write a method to find out how many times the letter 's' appears in it.
[4 marks]
8.
Complete the following truth table for the AND logic gate: | Input A | Input B | Output | |---------|---------|---------| | 0 | 0 | ? | | 0 | 1 | ? | | 1 | 0 | ? | | 1 | 1 | ? |
[6 marks]
ABOutput
00
01
10
11
9.
Sketch a simple flowchart that describes the process of checking if a number is even. Use decision symbols and process symbols, and leave space for the drawing.
[8 marks]
Drawing / Sketch space
10.
Describe how you would remove the first character from a string called 'name' in your programming language.
[3 marks]
11.
Write a brief explanation of what string concatenation means.
[3 marks]

Quick Actions

What is Remix?

Create a new worksheet based on this one. Change the grade level, topic, number of questions, or difficulty - then generate a fresh version.

  • • Change grade level (Grade 6 → Grade 7)
  • • Swap topics (Harry Potter → Macbeth)
  • • Add more questions (10 → 15)
  • • Adjust difficulty

Details

Created
1/2/2026
Updated
1/2/2026
Type
worksheet