CCEA A-Level Software Systems Development CL4
Software and the Development Environment
Defining Data: Types, Variables and Classes
Program Control Structures
Objects, Classes and Data Structures
Exception Handling and Managing Input and Output
Testing an Object Oriented Application
Graphical User Interface Objects and Events
Multiple Forms and Linking to Files
Designing, Testing and Evaluating an Event Driven Application
Reasons for Systems Development and Systems Methodologies
Managing Projects
Testing Strategies
Database Concepts and Entity Relationship Modelling
Normalisation and Structured Query Language
Project Management and the Systems Approach in Practice
Defining Requirements and Documenting the Design
Building a Desktop Solution with a Database
Testing and Evaluating the Solution
Program Control Structures
Count-controlled repetition with FOR
- 3 things to know
- AS Unit 1
Overview
Repetition as a control structure, unconditional repetition and off-by-one error.
What you need to know
Answer each one before you reveal it.
What is repetition as a control structure?
What is meant by unconditional repetition, and which construct normally implements it?
Questions from this subtopic
Each one with the model answer underneath.
- 1
What is repetition as a control structure?
Model answer
Repetition is the control structure that causes a block of statements to be executed more than once, either a set number of times or until a condition changes.
- 2
What is meant by unconditional repetition, and which construct normally implements it?
Model answer
Unconditional repetition repeats a block a fixed number of times settled before the loop begins rather than by testing the data, and a counted FOR loop normally implements it.
- 3
Which three parts does a Java for header have, and what is the purpose of each?
Model answer
A for header holds an initialisation that sets the counter, a condition tested before every pass, and an update applied at the end of each pass.
- 4
for (int i = 1; i <= 5; i++) { System.out.print(i + " "); } — what does this fragment print?
Model answer
The counter takes the values 1, 2, 3, 4 and 5 in turn and each is printed, so the output is 1 2 3 4 5; the loop ends when the counter reaches 6 and the condition fails.
- 5
How many times does the body of for (int i = 0; i < 10; i++) execute?
Model answer
The body executes ten times, for counter values 0 through to 9 inclusive.
- 6
How many times does the body of for (int i = 1; i < 10; i++) execute?
Model answer
The body executes nine times, for counter values 1 through to 9 inclusive.
Other ways to work this
The same content, four other ways.
What is inside Levo
Six ways to work the same material.
Every question in Program Control Structures, on a schedule.
Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.
Or £46 a year, about £3.83 a month. Cancel anytime.