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
Defining Data: Types, Variables and Classes
Arithmetic operators and expressions
- 3 things to know
- AS Unit 1
Overview
The five arithmetic operators, integer against floating point division, the remainder operator and the sign it takes, increment and decrement in prefix and postfix form, and compound assignment.
What you need to know
Answer each one before you reveal it.
int i = 3; int r = i++ + ++i; — what values do r and i hold?
Which five arithmetic operators does Java provide, and what does each do?
Questions from this subtopic
Each one with the model answer underneath.
- 1
Which five arithmetic operators does Java provide, and what does each do?
Model answer
Java provides plus for addition, minus for subtraction, an asterisk for multiplication, a solidus for division and a percent sign for the remainder after division.
- 2
What does the remainder operator return? Give the value of 17 % 5.
Model answer
The remainder operator returns what is left after integer division, so 17 % 5 is 2, because 17 is three fives with 2 remaining.
- 3
How is the remainder operator used to test whether an integer is even?
Model answer
An integer n is even exactly when n % 2 equals 0, because an even number leaves no remainder when divided by two.
- 4
What is the value of −7 % 3 in Java, and why does the result carry that sign?
Model answer
The value is −1, because Java gives the remainder the sign of the left operand: −7 is −2 threes with −1 remaining.
- 5
What is integer division? Give the value of 17 / 5.
Model answer
Integer division divides and discards any fractional part, so 17 / 5 is 3 rather than 3.4.
- 6
What is the value of 9 / 2 * 2 in integer arithmetic, and why?
Model answer
The value is 8, because 9 / 2 is evaluated first as integer division giving 4, and 4 multiplied by 2 is 8; the discarded remainder is never recovered.
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 Defining Data: Types, Variables and Classes, 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.