Back to the full dot-point answer
Northern IrelandSoftware Systems DevelopmentQuick questions
AS 1 Introduction to Object Oriented Development
Quick questions on Data types, variables, constants and operators - CCEA A-Level Software Systems Development
6short Q&A pairs drawn directly from our worked dot-point answer. For full context and worked exam questions, read the parent dot-point page.
What are data types?Show answer
Choosing the right type matters: money and measurements need a real type, counts and indices need an integer, yes/no flags need a Boolean, and text needs a string. Using the wrong type wastes memory or loses information (for example storing a price as an integer drops the pence).
What is type conversion (casting)?Show answer
Type conversion changes a value from one type to another. Implicit (automatic) conversion, or widening, happens safely when a narrower type fits into a wider one, for example an integer used where a real is expected. Explicit conversion (casting), or narrowing, is requested by the programmer, for example (int) 7.9, and can lose information (the result is 7, the fractional part is discarded).
What are integer division surprises?Show answer
With integer operands, 7 / 2 may give 3, not 3.5. To get a real result, at least one operand must be a real, or you must cast. CCEA tests this with DIV and MOD.
What is q1?Show answer
State a suitable data type for each: a person's age, their height in metres, and whether they are a member. [3 marks]
What is q2?Show answer
Explain one benefit of using a named constant rather than writing the literal value 0.2 directly in code. [2 marks]
What is q3?Show answer
Evaluate (int) (10 / 4) and explain the result. [2 marks]
Have a question we have not covered?
This dot-point answer is short enough that we have not extracted many short questions yet. Read the full dot-point answer or ask Mo, our study assistant, in the chat for follow ups.