Computer Science 9618/23 — October/November 2022
Cambridge AS Level · Fundamental Problem-solving and Programming Skills · worked solutions for every part, with the mark scheme
Topics Data Types and Structures · Software Development · Algorithm Design and Problem-solving · Programming
Refer to the insert for the list of pseudocode functions and operators.
A program is required for a shopping website.
Part of the program requires four variables. The following table describes the use of each variable.
Complete the table by adding the most appropriate data type for each variable.
| Variable use | Data type |
|---|---|
| Store the number of days in the current month | |
| Store the first letter of the customer's first name | |
| Store an indication of whether a year is a leap year | |
| Store the average amount spent per customer visit |
Answer
| Variable use | Data type |
|---|---|
| Store the number of days in the current month | INTEGER |
| Store the first letter of the customer's first name | CHAR |
| Store an indication of whether a year is a leap year | BOOLEAN |
| Store the average amount spent per customer visit | REAL |
INTEGER, CHAR, BOOLEAN, REAL
Background Concept
A data type tells the program what kind of value a variable will store. Choosing the correct data type matters because it affects how the value is stored, what operations can be done with it, and whether the variable properly matches its intended use.
Common basic data types in this syllabus include:
INTEGERfor whole numbersREALfor numbers that may contain a fractional partCHARfor a single characterBOOLEANfor a value that is only true or false
A good way to choose a data type is to ask:
- Is the value numeric or non-numeric?
- If numeric, can it have decimals?
- If text, is it a single character or a full string?
- Is it really just a yes/no or true/false condition?
Understanding the Question
The question gives four descriptions of how variables will be used in a shopping website program. You are not writing code here. You are matching each use to the most appropriate data type.
The key is to focus on the nature of the data itself:
- number of days in a month
- first letter of a first name
- whether a year is leap or not
- average amount spent
Each description strongly suggests one standard type.
Approach
Go through each variable use one at a time:
- Decide whether the value is a number, a character, or a logical true/false value.
- If it is a number, decide whether it must be whole or may include decimals.
- Choose the most specific correct type.
This avoids common mistakes such as using STRING instead of CHAR, or INTEGER instead of REAL.
Step-by-Step Reasoning
- Number of days in the current month: this is a whole number such as 28, 30 or 31. It does not need decimal places, so
INTEGERis correct. - First letter of the customer's first name: this is exactly one character, such as
AorM. A single character should be stored asCHAR. - Whether a year is a leap year: this is a yes/no condition. A year either is a leap year or it is not. That makes
BOOLEANthe correct choice. - Average amount spent per customer visit: an average can include a fractional part, for example 12.50 or 23.75. That means
REALis needed rather thanINTEGER.
So the completed table is:
INTEGERCHARBOOLEANREAL
Key Takeaways
- Use
INTEGERfor whole numbers. - Use
REALwhen decimal values may occur. - Use
CHARfor one character only. - Use
BOOLEANfor true/false conditions. - Always choose the type that best matches the meaning of the data, not just its appearance.
Common Mistakes
- Writing
REALfor the number of days in a month. This is wrong because days are counted in whole numbers. - Writing
STRINGfor the first letter. This is less appropriate because the question asks for a single letter, soCHARis the best choice. - Writing
INTEGERfor leap year status. That would force you to encode true/false as numbers, which is less appropriate thanBOOLEAN. - Writing
INTEGERfor average amount spent. An average can contain decimals, soREALis needed.
Things to Be Careful About
- Read the wording precisely: "first letter" means one character, not a whole name.
- "Average" is a strong clue that a fractional result is possible.
- "Indication of whether" usually signals a
BOOLEANanswer. - In exam questions like this, choose the most appropriate type, not just one that could technically work.
The designer considers the use of a development life cycle to split the development of the website into several stages.
State one benefit of a development life cycle when developing the website.
...........................................................................................................................................
Answer
- Development is split into stages, so progress can be planned and monitored more easily.
Development is split into stages, so progress can be planned and monitored more easily.
Background Concept
A development life cycle is a structured way of building software by dividing the work into stages such as analysis, design, coding, testing, implementation and maintenance. Instead of treating development as one large task, the project is managed step by step.
The main purpose of a life cycle is to make software development more organised and controllable. It helps developers, managers and users know what should happen next and what outputs should be produced at each stage.
Understanding the Question
This part asks for just one benefit of using a development life cycle when creating the shopping website. Because it is only one mark, a short, clear benefit is enough.
The question is about why using stages is useful, not about naming the stages themselves.
Approach
Think of what a life cycle improves during a project. Typical acceptable ideas include:
- easier planning
- easier monitoring of progress
- better documentation
- easier testing and review
- clearer structure for the team
For a one-mark answer, choose one benefit and state it directly.
Step-by-Step Reasoning
A strong answer is that the life cycle splits the work into stages. Once work is split into stages:
- deadlines can be set for each stage
- progress can be checked against those stages
- problems can be noticed earlier if a stage is delayed
So the benefit is that the project becomes easier to plan and monitor.
Key Takeaways
- A development life cycle provides structure.
- Its benefits are usually about planning, control, documentation and quality.
- For a one-mark "state" question, one clear point is enough.
Common Mistakes
- Describing a stage instead of giving a benefit. For example, saying "analysis happens first" does not answer the question.
- Giving a vague answer such as "it is better" without saying why.
- Writing several weak ideas instead of one precise benefit.
Things to Be Careful About
- The command word is "State", so keep the answer short and direct.
- Make sure the point is actually a benefit of using the life cycle, not just a feature of websites.
- Avoid overexplaining in a one-mark question; clarity is more valuable than length.
Analysis is one stage of a development life cycle.
State one document that may be produced from the analysis stage of the website project.
...........................................................................................................................................
Answer
- Requirements specification
Requirements specification
Background Concept
The analysis stage of the program development life cycle is where the problem is investigated and the user's needs are identified. The aim is to understand what the system must do before deciding how to build it.
A key output of analysis is documentation that records these requirements clearly. This becomes a reference for later stages such as design and testing.
Understanding the Question
The question asks for one document that may be produced from the analysis stage of the website project. It is not asking for a stage, a task, or a benefit. It specifically wants a document.
A standard answer is a requirements specification, which lists what the user needs the system to do.
Approach
Think of what is written down during analysis. The most common answer is the requirements specification because analysis is focused on identifying and recording requirements.
Step-by-Step Reasoning
During analysis, developers gather information from the user or client about:
- what the website must do
- what inputs and outputs are needed
- any restrictions or performance needs
These details are usually written into a requirements specification document. That document is then used in later stages to guide the design and to check whether the finished system meets the original needs.
Key Takeaways
- Analysis is about understanding the problem and user requirements.
- A common output from analysis is the requirements specification.
- In life-cycle questions, remember both the purpose of each stage and the documents it produces.
Common Mistakes
- Naming a later-stage document, such as test plan or program code, instead of an analysis document.
- Giving a process instead of a document, for example "interviewing users".
- Writing just "specification" without being clear enough when a more precise term is expected.
Things to Be Careful About
- The question says "may be produced", so one valid document is enough.
- Keep the answer as the document name, not a long description of the whole analysis stage.
- Do not confuse analysis with design: design documents describe how the system will be built, while analysis documents describe what is needed.
The program will be developed using the Rapid Application Development (RAD) life cycle.
State one principle of this life cycle.
...........................................................................................................................................
Answer
- Uses iterative development with prototypes and frequent user feedback.
Uses iterative development with prototypes and frequent user feedback.
Background Concept
Rapid Application Development (RAD) is a software development life cycle that focuses on producing working versions of a system quickly and improving them through repeated refinement. It is different from a strict linear model because development does not simply move once through a fixed sequence.
Common RAD principles include:
- iterative development
- prototyping
- frequent user involvement
- fast delivery of working versions
Understanding the Question
This part asks for one principle of RAD. Because it is one mark, you only need one clear identifying feature.
The phrase "principle of this life cycle" means a core idea that RAD is based on.
Approach
Choose one strong feature that clearly distinguishes RAD, such as:
- building prototypes
- involving users frequently
- developing in iterations
A concise statement combining these is also acceptable.
Step-by-Step Reasoning
RAD works by creating an early working version of the system, showing it to users, collecting feedback, and then improving it in the next cycle. That means it is iterative and often based on prototypes with frequent user feedback.
Any one of those ideas would identify RAD correctly. A strong answer combines them neatly.
Key Takeaways
- RAD is based on speed, iteration and user feedback.
- Prototypes are central to RAD.
- One clear defining feature is enough for a one-mark answer.
Common Mistakes
- Saying only "it is fast". That is true, but it is weaker than naming the actual principle that makes it fast.
- Describing waterfall instead, such as saying each stage is completed only once before the next begins.
- Giving a benefit instead of a principle.
Things to Be Careful About
- Keep the answer focused on what RAD is based on, not whether it is good or bad.
- Make sure the feature really belongs to RAD and is not just a general fact about software development.
- For one mark, one precise principle is better than several vague phrases.
Give two benefits and one drawback of its use compared to the waterfall life cycle.
Benefit 1 ............................................................................................................................
Benefit 2 ............................................................................................................................
Drawback ..........................................................................................................................
Answer
- Benefit 1: Working versions can be produced more quickly.
- Benefit 2: Frequent user feedback allows changes to be made early, so the system is more likely to meet user requirements.
- Drawback: It requires continual user involvement, which may be difficult to obtain.
Benefits: quicker production of working versions; early user feedback allows changes. Drawback: requires continual user involvement.
Background Concept
RAD and waterfall are two different software development models.
- Waterfall is linear: one stage is completed before the next begins.
- RAD is iterative: prototypes are built quickly, reviewed, and improved repeatedly.
Because of this difference, RAD tends to emphasise speed and user feedback, while waterfall emphasises formal structure and clear stage completion.
Understanding the Question
This question asks for two benefits and one drawback of using RAD compared to waterfall. That comparison matters: you should think about what RAD does better than waterfall, and what trade-off comes with it.
Since the command says give two benefits and one drawback, your answer should contain exactly those three clear points.
Approach
Compare the models in terms of:
- development speed
- ability to respond to feedback
- practical limitations of RAD
Strong benefits usually come from iteration and prototyping. Strong drawbacks usually come from the extra demands that RAD places on users, coordination or documentation.
Step-by-Step Reasoning
Benefit 1: faster production of working versions
RAD focuses on quick development of prototypes and partial working systems. Compared with waterfall, where much more time may be spent finishing earlier stages before a working system appears, RAD can produce something usable sooner.
Benefit 2: feedback and changes happen earlier
Because users see prototypes early, they can comment sooner. If something is wrong or missing, it can be changed in the next iteration. In waterfall, problems may be noticed later, after more of the system has already been developed.
Drawback: continual user involvement is needed
RAD depends heavily on feedback from users. If users are unavailable, too busy, or inconsistent in what they ask for, the process becomes harder to manage. This is a common drawback compared with waterfall, which can operate with less frequent user contact once requirements are documented.
Key Takeaways
- RAD is usually better for speed and flexibility.
- Waterfall is usually more rigid and sequential.
- Comparing models means linking each point directly to how the model works.
- Benefits of RAD usually come from iteration and user feedback.
Common Mistakes
- Giving features of RAD instead of benefits compared with waterfall.
- Repeating the same idea twice, for example saying "faster" and "quicker" as two separate benefits.
- Giving a drawback that is actually a benefit.
- Forgetting that the comparison is with waterfall.
Things to Be Careful About
- Make sure the two benefits are distinct.
- A valid drawback should be something practical, not just a vague negative statement.
- Keep each point short and focused because the mark allocation is only three marks.
- If you mention user feedback as a benefit, explain why it helps: it allows early changes and improves fit to requirements.
Adaptive maintenance needs to be carried out on the website program.
Give two reasons why adaptive maintenance may be required.
1 ................................................................................................................................................
2 ................................................................................................................................................
Answer
- The website program must be changed to work with new hardware, an updated operating system or different web browsers.
- The website program must be changed to work with a new external system, such as a payment gateway or database.
Changes in hardware/OS/browser; changes to external systems such as payment gateway or database.
Background Concept
Maintenance is work done on software after it has been developed and put into use. Different types of maintenance exist for different reasons.
Adaptive maintenance means changing a program so that it continues to work in a changed environment. The key idea is that the environment around the program has changed, so the program must adapt.
This is different from:
- corrective maintenance: fixing errors
- perfective maintenance: improving performance or usability
Adaptive maintenance is about compatibility with new conditions.
Understanding the Question
The question says that adaptive maintenance is needed on the website program and asks for two reasons why this may be required. So you need two examples of environmental change that would force the website software to be amended.
Because the context is a website, good answers often involve browsers, operating systems, hardware platforms, databases, or external services such as payment systems.
Approach
Think: what outside changes could happen even if the original program has no bug?
Two strong categories are:
- changes in the platform the program runs on
- changes in other systems the website must work with
Those are classic adaptive-maintenance triggers.
Step-by-Step Reasoning
Reason 1: change in platform or operating environment
If the website must run correctly with:
- a new operating system
- updated browser versions
- different hardware or devices
then code may need to be changed so it remains compatible. This is adaptive maintenance because the environment changed, not because the program logic was originally wrong.
Reason 2: change in an external system or interface
A shopping website often connects to other systems such as:
- payment gateways
- databases
- stock systems
- delivery or account services
If one of these systems changes its interface or requirements, the website program may need modification to continue working with it. Again, this is adaptation to a changed environment.
Key Takeaways
- Adaptive maintenance is caused by environmental change.
- It is not mainly about fixing bugs.
- Typical examples include hardware, OS, browser, network or interface changes.
- External dependencies are a common source of adaptive maintenance.
Common Mistakes
- Giving bug fixes as the answer. Fixing errors is corrective maintenance, not adaptive.
- Giving vague improvements such as "make it better". That is closer to perfective maintenance.
- Repeating the same reason twice in slightly different words.
Things to Be Careful About
- Make sure each reason is clearly about adapting to change.
- In website questions, keep answers realistic to web systems, such as browsers, servers, APIs or payment services.
- Do not confuse changes in user requirements with correction of faults.
- Two distinct reasons are needed, so separate platform changes from external-system changes where possible.
The rest of this paper
6 more questions- Q2Algorithm Design and Problem-solving3M
- Q3Algorithm Design and Problem-solving5M
- Q4Data Types and Structures10M
- Q5Programming · Data Types and Structures · Algorithm Design and Problem-solving · Software Development17M
- Q6Software Development · Programming11M
- Q7Data Types and Structures · Programming17M