An original Thinka practice paper modelled on the structure and difficulty of the Jun 2023 Cambridge OCR GCSE Computer Science - J277 paper. Not affiliated with or reproduced from Cambridge.
部分 J277/01 Computer Systems
Answer all questions. Calculators are not allowed. Assessment covers Computer Systems theory.
26 題目 · 80 分
題目 1 · theory_short
2.5 分
Explain the difference between the role of the Memory Address Register (MAR) and the Memory Data Register (MDR) during the Fetch-Decode-Execute cycle.
查看答案詳解收起答案詳解
解題
During the fetch stage, the CPU uses these registers to access RAM. First, the address of the next instruction is copied from the Program Counter to the MAR. The CPU then reads the contents of that memory location. The data from that location is transferred along the data bus and stored in the MDR. Thus, the MAR is for locations, and the MDR is for values.
評分準則
1 mark for explaining the role of the MAR (holds the memory address of the instruction/data being accessed). 1 mark for explaining the role of the MDR (holds the actual data/instruction being transferred). 0.5 marks for stating how they work together during the fetch cycle (e.g., the address in MAR is used to locate the data that is then copied into the MDR).
題目 2 · theory_short
2.5 分
Give two reasons why a solid-state drive (SSD) is more suitable than a magnetic hard disk drive (HDD) for a student's portable laptop.
查看答案詳解收起答案詳解
解題
SSDs use flash memory chips rather than spinning magnetic platters. This physical difference means that there are no read/write heads to bounce or fail when the laptop is moved. Additionally, flash memory requires less electrical power to operate than an electric spindle motor, directly translating to superior battery life.
評分準則
1 mark for identifying the first advantage (e.g., shock-resistant/no moving parts). 1 mark for identifying the second advantage (e.g., lower power consumption/lighter weight). 0.5 marks for linking either advantage explicitly to the context of portability (e.g., preventing damage when moving, or extending battery life on the go).
題目 3 · theory_short
2.5 分
A school computer is connected to the local area network (LAN). State the differences between the computer's MAC address and its IP address.
查看答案詳解收起答案詳解
解題
Every device has a unique Media Access Control (MAC) address embedded in its hardware. This is used for routing packets on the local physical network (Data Link Layer). In contrast, an Internet Protocol (IP) address is assigned by the router/DHCP server when the device connects to a network. This allows routing across global interconnected networks (Network Layer).
評分準則
1 mark for explaining MAC address uniqueness and permanent manufacturer configuration. 1 mark for explaining IP address assignment/logical nature and network dependence. 0.5 marks for identifying a structural difference (e.g., MAC is represented in hexadecimal, whereas IP addresses (IPv4) are usually represented in denary/dotted-decimal format).
題目 4 · theory_short
2.5 分
Explain how the Operating System (OS) uses device drivers to manage peripherals.
查看答案詳解收起答案詳解
解題
Because there are thousands of hardware manufacturers, an OS cannot have built-in code for every printer, scanner, or mouse. Instead, the OS provides a standard protocol. The manufacturer writes a driver that receives these standardized system requests and converts them into the precise low-level hardware signals required by that specific device model.
評分準則
1 mark for stating that a device driver is a translation program/software interface. 1 mark for explaining that it translates OS commands into device-specific signals. 0.5 marks for explaining that this architecture allows the OS to support new peripherals without having to rewrite the core OS code.
題目 5 · theory_short
2.5 分
A gym collects personal details from its members. Explain how the gym can comply with the Data Protection Act 2018 regarding how they store and manage this data.
查看答案詳解收起答案詳解
解題
Under the Data Protection Act 2018 (which incorporates GDPR), organizations must follow strict principles. To meet the 'security' principle, the gym must implement technical controls like database encryption and access privileges. To meet the 'retention' principle, they must securely destroy or anonymize the data once the contract has expired and there is no legal reason to hold it.
評分準則
1 mark for identifying a relevant principle/requirement under the DPA 2018 (e.g., keeping data secure/accurate, or data minimisation). 1 mark for explaining how the gym implements this technically or operationally (e.g., using strong encryption, user permissions, or scheduled purging). 0.5 marks for explaining why this protects the data subjects (e.g., prevents identity theft if a data breach occurs).
題目 6 · theory_short
2.5 分
Describe how a phishing attack is typically carried out and state its primary objective.
查看答案詳解收起答案詳解
解題
Phishing is a form of social engineering. Attackers send out mass communications designed to mimic trusted brands. They often use urgent language to pressure the victim into acting quickly. The links within the message lead to a cloned login page, harvesting usernames, passwords, or credit card numbers when entered.
評分準則
1 mark for describing the medium/facade (e.g., emails/messages imitating legitimate businesses). 1 mark for describing the human interaction (e.g., tricking users into clicking links or downloading attachments). 0.5 marks for identifying the threat actor's goal (e.g., stealing login credentials or financial details).
題目 7 · theory_short
2.5 分
Describe the purpose of ROM (Read Only Memory) in a desktop computer.
查看答案詳解收起答案詳解
解題
When a computer is off, RAM is completely empty. The CPU needs instructions immediately upon power-up to know how to interact with the storage drives and load the operating system. Because ROM is non-volatile, it retains this startup firmware permanently, even when the power is completely disconnected.
評分準則
1 mark for stating that ROM stores the startup/bootloader instructions (BIOS). 1 mark for explaining that ROM is non-volatile and cannot have its contents accidentally modified. 0.5 marks for explaining why this is crucial (e.g., so the bootup code is permanent and immediately executable upon powering up).
題目 8 · theory_short
2.5 分
A modern washing machine contains an embedded system. Identify two characteristics of an embedded system that make it different from a general-purpose computer.
查看答案詳解收起答案詳解
解題
Unlike general-purpose PCs which run a wide variety of software (web browsers, office suites, games), an embedded system has a specialized microprocessor built into a larger physical machine. Its software is fixed, stored on ROM, and dedicated entirely to controlling the physical sensors and actuators of that specific device.
評分準則
1 mark for stating it is designed for a single/specific dedicated control task. 1 mark for stating it is physically built into a larger mechanical/electrical device. 0.5 marks for explaining how this differs from a general-purpose PC (e.g., it does not allow the end-user to install external third-party software).
題目 9 · theory_short
2.5 分
Explain how increasing the clock speed of a CPU affects its performance, and describe one reason why a user might not notice a performance improvement after upgrading to a CPU with a faster clock speed.
查看答案詳解收起答案詳解
解題
Increasing the clock speed means the CPU can perform more Fetch-Decode-Execute (FDE) cycles per second, which increases the speed at which instructions are processed (1.5 marks). However, a user might not notice this improvement if there is a system bottleneck elsewhere, such as slow RAM, slow secondary storage, or if the applications being run do not require significant CPU processing power (1 mark).
評分準則
1.5 marks: Clear explanation of how clock speed increases processing speed (e.g., mentions more Fetch-Decode-Execute cycles per second / Hz). 1 mark: Identifies a valid reason why the improvement might not be noticed (e.g., system bottlenecks like RAM/HDD, or GPU/network limitations).
題目 10 · theory_short
2.5 分
A wildlife photographer uses a rugged digital camera to take high-resolution photos in remote outdoor locations. State whether solid-state storage or magnetic storage is more suitable for the camera's memory card, and explain two reasons for your choice.
查看答案詳解收起答案詳解
解題
Solid-state storage is more suitable (0.5 marks). Reason 1: Solid-state media has no moving parts, making it highly durable and resistant to physical shocks, which is ideal for outdoor/rugged use (1 mark). Reason 2: Solid-state storage is very compact and lightweight, making it suitable for portable devices like digital cameras (1 mark).
評分準則
0.5 marks: Correctly identifying Solid-state storage. 1 mark: Valid explanation of physical durability (no moving parts / shock resistance). 1 mark: Valid explanation of portability / small physical size / fast write speed for high-resolution photos.
題目 11 · theory_short
2.5 分
Describe the differences between RAM (Random Access Memory) and ROM (Read Only Memory) in terms of their volatility and how their contents can be modified.
查看答案詳解收起答案詳解
解題
RAM is volatile, meaning its contents are lost when power is turned off, whereas ROM is non-volatile and retains its data even without power (1 mark). RAM can be both read from and written to during normal operation, allowing temporary storage of running programs, whereas ROM can normally only be read from and contains startup instructions (bootstrap) that cannot be easily written to or modified (1.5 marks).
評分準則
1 mark: Clear comparison of volatility (RAM is volatile vs ROM is non-volatile). 1.5 marks: Clear comparison of read/write capabilities (RAM is read/write, ROM is read-only / write-protected under normal operation).
題目 12 · theory_short
2.5 分
Explain the main differences between an IP address and a MAC address in a computer network, including how they are assigned and their primary purpose.
查看答案詳解收起答案詳解
解題
A MAC address is a permanent hardware address configured into the Network Interface Card (NIC) by the manufacturer and cannot be changed, whereas an IP address is a logical address assigned by software or network routers (DHCP) which can change depending on the network the device is connected to (1.5 marks). Furthermore, MAC addresses are used for identifying devices within a local network (LAN), whereas IP addresses are used to identify devices and route data packets across different networks, such as the Internet (1 mark).
評分準則
1.5 marks: Explains the assignment difference (MAC is permanent/hardware/manufacturer-assigned; IP is dynamic/logical/network-assigned). 1 mark: Explains the functional difference (MAC used for local/LAN delivery; IP used for global routing/WAN).
題目 13 · theory_short
2.5 分
A local business is setting up a wireless network for its staff and wants to secure it. Describe how penetration testing (pen testing) can help secure their network, and identify one specific security measure they should implement on their wireless access point.
查看答案詳解收起答案詳解
解題
Penetration testing involves simulating a cyberattack against the business's own network under controlled conditions (0.5 marks) to identify security weaknesses and vulnerabilities before malicious attackers can exploit them (1 mark). A key security measure to implement on their wireless access point is strong encryption, such as WPA2 or WPA3, to prevent unauthorized users from eavesdropping on data transmissions (1 mark).
評分準則
0.5 marks: Defines penetration testing as authorized simulated attacks. 1 mark: Explains the goal of pen testing (discovering and fixing vulnerabilities before exploit). 1 mark: Identifies a valid wireless security measure (e.g., WPA2/WPA3 encryption, disabling SSID broadcast, MAC address filtering).
題目 14 · theory_short
2.5 分
Explain how an operating system uses virtual memory when a computer's physical RAM becomes full, and describe one potential drawback of relying heavily on virtual memory.
查看答案詳解收起答案詳解
解題
When RAM is full, the operating system allocates a portion of secondary storage (like a hard drive or SSD) to act as temporary RAM. It copies inactive pages or data from RAM to this virtual memory space to free up physical memory for active processes (1.5 marks). A major drawback of relying heavily on virtual memory is disk thrashing or slow system performance, because transferring data between secondary storage and RAM is much slower than accessing physical RAM directly (1 mark).
評分準則
1.5 marks: Explains the mechanism of virtual memory (identifies RAM being full, moving inactive processes/pages to secondary storage to free up RAM). 1 mark: Identifies a drawback (disk thrashing / slow performance / high read-write overhead compared to RAM).
題目 15 · theory_short
2.5 分
A school wants to dispose of 50 old desktop computers. Explain one environmental issue associated with improper disposal of these computers, and describe one action the school could take to minimize their environmental impact.
查看答案詳解收起答案詳解
解題
Improper disposal of computer hardware leads to electronic waste (e-waste) in landfills, where toxic chemicals and heavy metals (such as lead, mercury, or cadmium) can leach into the surrounding soil and groundwater, causing environmental pollution and health hazards (1.5 marks). To minimize this impact, the school can donate the working computers to local charities/community groups, or send them to a certified e-waste recycling facility where valuable materials can be safely extracted and reused (1 mark).
評分準則
1.5 marks: Identifies and explains an environmental issue (e-waste, toxic leakage into landfills, resource depletion). 1 mark: Proposes a valid, realistic action (donation, recycling, selling for refurbishment).
題目 16 · theory_short
2.5 分
A software developer wants to compress the source code files of an application before sharing them online. State whether they should use lossy or lossless compression, and justify your choice with reference to the characteristics of the data being compressed.
查看答案詳解收起答案詳解
解題
They must use lossless compression (0.5 marks). Lossy compression permanently discards some data to reduce file size. For source code files, every character, symbol, and keyword is critical; if any data is lost or altered, the code will become corrupt, syntax errors will occur, and the program will fail to compile or run (1 mark). Lossless compression reduces file size by reorganizing data without losing any information, allowing the original source code to be reconstructed exactly (1 mark).
評分準則
0.5 marks: Selects lossless compression. 1 mark: Explains the consequence of using lossy compression on source code (data loss leads to corruption, compilation/syntax errors). 1 mark: Explains the mechanism of lossless compression (allows perfect, bit-for-bit reconstruction of the original file).
題目 17 · theory_short
3 分
Describe the specific role of the Program Counter (PC) register during the fetch stage of the fetch-decode-execute cycle.
查看答案詳解收起答案詳解
解題
1 mark: Identify that the PC holds the memory address of the next instruction to be fetched. 1 mark: State that this address is copied to the Memory Address Register (MAR). 1 mark: State that the PC is then incremented (by 1) to point to the subsequent instruction.
評分準則
Award up to 3 marks: - 1 mark for stating that it stores/holds the memory address of the next instruction (to be fetched/executed). - 1 mark for stating that the address is copied/passed to the MAR. - 1 mark for stating that the PC is incremented (by one / to point to the next instruction).
題目 18 · theory_short
2 分
A sports photographer uses a digital camera to take high-speed action shots. State which type of secondary storage (magnetic, optical, or solid-state) is most appropriate for the storage medium inside the camera, and explain one reason why.
查看答案詳解收起答案詳解
解題
1 mark: Identify solid-state as the correct storage type. 1 mark: Provide a valid justification linked to the photographer context (e.g., durability / no moving parts to withstand movement, or fast write speeds to save high-speed photos rapidly).
評分準則
Award up to 2 marks: - 1 mark for identifying solid-state (accept solid state, SSD, SD card, flash memory). - 1 mark for explanation: - Durability/robustness (no moving parts, so does not get damaged when moved / dropped). - Fast write speeds (essential for saving burst/action shots in rapid succession). - Portability/small size (fits easily inside a compact camera). Do not accept: 'large capacity' or 'cheap' on their own as they do not specifically fit the high-speed/portable context.
題目 19 · theory_short
3 分
An Ethernet network contains multiple devices. Explain the difference between a MAC address and an IP address in a network.
查看答案詳解收起答案詳解
解題
1 mark: Explain that a MAC address is a permanent/physical address assigned to hardware/NIC by the manufacturer and cannot be changed. 1 mark: Explain that an IP address is a logical/temporary address assigned to a device on a network that can change. 1 mark: Contrast their usage (e.g., MAC addresses direct data within a local network/LAN, while IP addresses route data across different networks/WAN/Internet).
評分準則
Award up to 3 marks: - 1 mark: MAC address is a physical/hardware address that is permanent / hardcoded / cannot be changed. - 1 mark: IP address is a logical address that is dynamic / assigned by the network / can change. - 1 mark: MAC addresses are used for device-to-device communication within the local network (LAN), whereas IP addresses are used for routing data packets across wide area networks (WAN / Internet).
題目 20 · theory_short
2 分
An e-commerce website uses an input form for customer reviews. Explain how a SQL injection attack could be carried out on this form, and describe the potential impact on the database.
查看答案詳解收起答案詳解
解題
1 mark: Explain the method of the attack (entering database commands / malicious SQL code directly into the user input fields of a website form). 1 mark: Explain the impact on the database (unauthorized access, viewing, stealing, altering, or deleting database records).
評分準則
Award up to 2 marks: - 1 mark for method: Attacker enters/injects malicious SQL queries/code into an input text box/field. - 1 mark for impact: To access, modify, copy, or delete database contents / bypass security/login systems.
題目 21 · theory_short
3 分
Explain how the operating system manages memory using virtual memory when the physical RAM is full.
查看答案詳解收起答案詳解
解題
1 mark: State that a portion of secondary storage (hard disk/SSD) is allocated to act as temporary RAM. 1 mark: Explain that currently inactive data/pages are transferred from RAM to virtual memory to free up RAM capacity. 1 mark: Explain that when the transferred data is required again, it is swapped back into the physical RAM (and other data is swapped out).
評分準則
Award up to 3 marks: - 1 mark: An area of secondary storage / hard drive / SSD is partitioned/used as temporary RAM extension. - 1 mark: Unused / inactive pages / blocks of data are moved from RAM to virtual memory to free up space in physical RAM. - 1 mark: When the data is needed, it must be swapped back into RAM (overwriting or swapping out other data).
題目 22 · theory_short
2 分
A software developer is deciding whether to release their new application under an open-source license or a proprietary license. State one benefit to the developer of using an open-source license, and one benefit of using a proprietary license.
查看答案詳解收起答案詳解
解題
1 mark: Identify a valid benefit of open source for the developer (e.g., community support, rapid bug fixing, wider distribution). 1 mark: Identify a valid benefit of proprietary for the developer (e.g., ability to monetize/charge for licenses, protection of intellectual property/code).
評分準則
Award up to 2 marks: - 1 mark for open-source benefit, e.g.: - Other programmers can debug / inspect / improve the code for free. - Code can be adapted and developed further by the community. - Faster release of updates and patches. - Reaches a wider audience / highly accessible because it is usually free. - 1 mark for proprietary benefit, e.g.: - Developer can charge users / sell licenses to generate profit. - The source code is secure / hidden, preventing competitors from copying features. - The developer maintains full control over all official releases and updates.
題目 23 · extended_response
8 分
A logistics company is planning to replace its fleet of traditional delivery vans and human drivers with fully autonomous (self-driving) aerial delivery drones in a major city.
Discuss the ethical, legal, cultural, and environmental impacts of this decision.
In your answer, you should refer to: - The impact on employees and the local community - Legal and data protection considerations - Environmental benefits and drawbacks
查看答案詳解收起答案詳解
解題
### Sample High-Level Points:
* **Ethical Impacts:** * *Negative:* Significant job losses for delivery drivers, leading to financial hardship and structural unemployment. * *Negative/Positive:* Safety concerns if a drone malfunctions and falls, potentially injuring citizens. Conversely, reducing delivery vans on roads might decrease vehicle-related traffic accidents.
* **Legal Impacts:** * *Privacy & Data Protection:* Drones must use cameras and sensors to navigate. This may record members of the public or private properties without consent, risking violations of the Data Protection Act (DPA) 2018 / GDPR. * *Liability:* If a drone crashes or damages property, legal frameworks must determine who is responsible (the drone manufacturer, the software programmer, or the logistics company). * *Aviation Regulations:* Compliance with airspace laws and restricted flight zones.
* **Cultural Impacts:** * *Convenience:* Customers receive faster, 24/7 deliveries, increasing expectations of immediate service. * *Social Isolation:* Reduction of human-to-human interaction (e.g., elderly residents who look forward to interacting with delivery drivers). * *Noise/Visual Pollution:* Constant presence of drones overhead changing the peace and aesthetic of residential neighborhoods.
* **Environmental Impacts:** * *Positive:* Drones are electric and produce zero direct emissions, reducing air pollution and the carbon footprint compared to petrol/diesel delivery vans. * *Negative:* Increased demand on power grids to charge drone fleets (which may use non-renewable energy sources). Manufacturing and eventually disposing of drone batteries contributes to e-waste.
評分準則
This is an extended-response question assessed using a level-of-response grid:
* **Level 3 (7-8 marks):** * Detailed, balanced, and coherent discussion covering at least three impact areas (ethical, legal, cultural, environmental). * Clear breadth and depth of understanding with appropriate technical terminology used throughout. * Explicitly addresses the scenario (drones replacing human delivery drivers).
* **Level 2 (4-6 marks):** * A reasonable discussion covering at least two impact areas, or a one-sided discussion of several. * Some structure and attempt at balanced arguments, using some technical terms correctly. * Partially links points to the drone scenario.
* **Level 1 (1-3 marks):** * Superficial or generalized points made, mostly focusing on only one impact area. * Information is basic, unstructured, and lacks technical terminology. * Little or no relevance to the drone scenario.
* **0 marks:** No rewardable content.
題目 24 · structured_scenario
5 分
Apex Design is a small architecture firm with 5 computers. They currently use a star network topology where all devices are connected to a central switch. The firm is considering upgrading to a full mesh network topology to improve network reliability. (a) Explain how the central switch routes data packets in this star network topology. [2] (b) Explain one advantage and two disadvantages of upgrading Apex Design's network to a full mesh topology. [3]
查看答案詳解收起答案詳解
解題
Part (a): The central switch receives a data packet, inspects its destination MAC address, and forwards it directly to the corresponding port. Part (b): An advantage is the high redundancy and lack of a single point of failure. Disadvantages include the high cost of installation (cabling/hardware) and the complexity of managing and expanding a mesh configuration.
評分準則
Part (a) [Max 2 marks]: - 1 mark for stating that the switch receives packets and reads the destination MAC address. - 1 mark for explaining that it forwards the packet only to the specific destination device. Part (b) [Max 3 marks]: - 1 mark for a valid advantage (e.g., high reliability, redundancy, no single point of failure). - 1 mark each for up to two valid disadvantages (e.g., high cost of cabling/ports, complex configuration/administration, difficulty in scaling).
題目 25 · structured_scenario
6 分
Mia is a digital illustrator who uses a computer with 8 GB of RAM. While working on a large digital poster with multiple software programs open, her computer becomes very slow and unresponsive, and her hard drive light is constantly flashing. (a) Explain why the computer's performance has decreased, making reference to how RAM and virtual memory are being used in this situation. [4] (b) State two benefits of Mia upgrading her computer to 16 GB of RAM. [2]
查看答案詳解收起答案詳解
解題
Part (a): The physical RAM is completely full. The OS uses secondary storage as virtual memory to hold inactive pages. Constant swapping between RAM and HDD (disk thrashing) occurs. HDD read/write speeds are significantly slower than RAM, causing the bottleneck. Part (b): Upgrading to 16 GB of RAM allows more memory-intensive processes to run concurrently and reduces/prevents disk thrashing.
評分準則
Part (a) [Max 4 marks]: - 1 mark for noting RAM is full/exceeded. - 1 mark for identifying that the OS uses secondary storage (HDD) as virtual memory. - 1 mark for explaining the swapping/paging of data between RAM and virtual memory. - 1 mark for identifying that HDD read/write speed is much slower than RAM, leading to a performance drop. Part (b) [Max 2 marks]: - 1 mark per valid benefit (up to 2), such as: improved multitasking ability, reduction/elimination of virtual memory use, faster overall program execution during high load, smoother UI response.
題目 26 · structured_scenario
6 分
A local council is replacing 100 older desktop computers in its public libraries. They are deciding between buying new standalone desktop PCs or adopting a thin-client network model where simple terminals connect to a powerful central server. (a) Explain two environmental benefits of choosing a thin-client and server setup rather than 100 individual desktop PCs. [2] (b) Describe one environmental issue associated with the disposal of the 100 older desktop computers, and how the council can mitigate this issue. [2] (c) Explain two ethical concerns that might arise from centralizing all library users' activities and data onto a single server. [2]
查看答案詳解收起答案詳解
解題
Part (a): Thin-clients have lower power requirements and fewer physical components than standard PCs, reducing both operational energy usage and physical manufacturing impact. Part (b): Landfill disposal of computer parts leads to heavy metal contamination. Mitigation includes recycling via licensed recyclers or refurbishing. Part (c): Centralized storage concentrates sensitive user data, creating a single point of failure for hacking/privacy breaches and enabling easier user tracking.
評分準則
Part (a) [Max 2 marks]: - 1 mark per valid environmental benefit (up to 2) (e.g., lower power consumption, fewer raw materials needed to produce them, less heat generation requiring less cooling, longer lifecycle of terminals). Part (b) [Max 2 marks]: - 1 mark for a valid environmental disposal issue (e.g., toxic chemicals/e-waste in landfills, pollution from shipping waste to developing countries). - 1 mark for a valid mitigation strategy (e.g., safe recycling schemes, refurbishing/donating). Part (c) [Max 2 marks]: - 1 mark per valid ethical concern (up to 2) (e.g., privacy concerns due to centralized logs of user web browsing, single point of target for cyber attacks/data theft, potential misuse of access by system administrators).
J277/02 甲部
Answer all questions in Section A. Covers general computational thinking, algorithms and programming techniques.
13 題目 · 50 分
題目 1 · algorithm_design
5 分
A library wants to automate the calculation of late fees for overdue books. Write an algorithm in pseudocode or OCR Exam Reference Language that: - Prompts the user to input the number of days a book is overdue. - Calculates the late fee based on the following rules: - If the book is not overdue (0 days or fewer), the fee is £0.00. - For the first 7 days overdue, the fee is £0.20 per day. - For any additional days beyond 7, the fee is £0.50 per day (for those extra days). - The maximum total fee charged is capped at £10.00. - Outputs the final calculated late fee.
查看答案詳解收起答案詳解
解題
To solve this problem, we need to: 1. Get the number of days overdue from the user as an integer. 2. Initialize a variable to store the fee. 3. Check if days is less than or equal to 0. If so, set the fee to 0. 4. Check if days is between 1 and 7. If so, multiply the days by 0.20. 5. If days is greater than 7, calculate the fee as 7 days at £0.20 plus the remaining days at £0.50. 6. Check if the calculated fee is greater than £10.00. If so, set the fee to 10.00. 7. Print the final fee.
Example OCR Exam Reference Language code: ``` daysOverdue = input("Enter days overdue: ") if daysOverdue <= 0 then fee = 0.0 elseif daysOverdue <= 7 then fee = daysOverdue * 0.20 else fee = (7 * 0.20) + ((daysOverdue - 7) * 0.50) endif if fee > 10.00 then fee = 10.00 endif print("Total fee: " + fee) ```
評分準則
Marks are awarded as follows: - 1 mark for prompting and taking input for the number of days overdue. - 1 mark for correctly checking if days are 7 or fewer and calculating the fee (e.g. days * 0.20 or equivalent). - 1 mark for correctly calculating the fee for days exceeding 7 (e.g. 1.40 + (days - 7) * 0.50). - 1 mark for checking if the total fee exceeds 10.00 and capping it at 10.00. - 1 mark for outputting the calculated fee.
Acceptable alternatives: - Use of nested if statements or flat if / else blocks if logically sound. - Variable names do not have to match exactly but must be used consistently. - Explicit cast to integer (e.g. cast(input(), "int")) is not strictly required but accepted.
題目 2 · algorithm_design
5 分
An algorithm is required to check the security of a user's password. Write an algorithm in pseudocode or OCR Exam Reference Language that: - Prompts the user to input their password. - Checks if the password meets BOTH of the following conditions: - It is at least 8 characters long. - It contains at least one exclamation mark ('!') character. - Outputs 'Secure' if both conditions are met, otherwise outputs 'Not secure'.
查看答案詳解收起答案詳解
解題
To solve this problem: 1. Input the password as a string. 2. Use a boolean flag hasExclamation initialized to false. 3. Loop through each character of the password string from index 0 to length - 1. 4. If a character is equal to '!', set hasExclamation to true. 5. Check if the length of the password is greater than or equal to 8 AND hasExclamation is true. 6. Output 'Secure' if the condition is true; otherwise output 'Not secure'.
Example OCR Exam Reference Language code: ``` password = input("Enter password: ") hasExclamation = false for i = 0 to password.length - 1 if password[i] == "!" then hasExclamation = true endif next i if password.length >= 8 and hasExclamation == true then print("Secure") else print("Not secure") endif ```
評分準則
Marks are awarded as follows: - 1 mark for inputting the password. - 1 mark for checking if the password length is at least 8 characters. - 1 mark for using a loop to iterate through the characters of the password string (or using a built-in search method/substring check). - 1 mark for checking if individual character is '!' and updating a boolean flag or counter. - 1 mark for outputting 'Secure' if both conditions are met, and 'Not secure' otherwise.
Acceptable alternatives: - Accept use of substring functions, e.g., password.substring(i, 1). - Accept intuitive string membership check if clear (e.g., if "!" in password). - Allow any standard loop structure (while, for, repeat-until).
題目 3 · algorithm_design
5 分
A smart thermostat controls a heater based on the target temperature set by the user and the current measured room temperature. Write an algorithm in pseudocode or OCR Exam Reference Language that: - Prompts the user to input the target temperature and current temperature (which may contain decimals). - Determines the state of the heater according to these rules: - If the current temperature is more than 2 degrees below the target, set the heater to 'HIGH'. - If the current temperature is between 0.1 and 2 degrees (inclusive) below the target, set the heater to 'LOW'. - If the current temperature is equal to or higher than the target, set the heater to 'OFF'. - Outputs the state of the heater.
查看答案詳解收起答案詳解
解題
To solve this problem: 1. Prompt and input the two temperatures (target and current) and store them as real numbers. 2. Calculate the difference: difference = targetTemp - currentTemp. 3. If difference > 2, then output 'HIGH'. 4. Else if difference > 0 (which covers up to 2 inclusive, since the first condition handles > 2), then output 'LOW'. 5. Else (meaning difference <= 0, or current temperature is equal to or greater than target), output 'OFF'.
Example OCR Exam Reference Language code: ``` targetTemp = real(input("Enter target temperature: ")) currentTemp = real(input("Enter current temperature: ")) difference = targetTemp - currentTemp if difference > 2 then print("HIGH") elseif difference > 0 then print("LOW") else print("OFF") endif ```
評分準則
Marks are awarded as follows: - 1 mark for inputting both temperatures (target and current). - 1 mark for calculating the difference or expressing equivalent comparative logic. - 1 mark for checking if the current temperature is more than 2 degrees below the target (e.g. difference > 2 or current < target - 2) and setting/printing state 'HIGH'. - 1 mark for checking the range where current temperature is between 0.1 and 2 degrees below target (e.g. difference > 0 and difference <= 2 or equivalent) and setting/printing state 'LOW'. - 1 mark for checking if current temperature is equal to or greater than the target and setting/printing state 'OFF'.
Acceptable alternatives: - Order of selection statements may vary as long as the logic is correct. - Casting with real() is good practice for decimal values, but full marks can be awarded without explicit cast if logic is flawless.
題目 4 · logic_trace
4 分
An algorithm is written to count how many odd numbers are stored in a small array of integers.
The algorithm is represented by the following pseudocode: ``` numbers = [15, 22, 9, 31] count = 0 odds = 0 while count < 4 if numbers[count] MOD 2 != 0 then odds = odds + 1 endif count = count + 1 endwhile ```
Complete the trace table below for this algorithm.
Let's trace the algorithm step-by-step: - **Initial state**: `count = 0`, `odds = 0`. - **Iteration 1**: `count` is 0, which is less than 4. `numbers[0]` is 15. Since 15 MOD 2 is 1 (not 0), `odds` becomes 1. `count` increments to 1. - **Iteration 2**: `count` is 1. `numbers[1]` is 22. 22 MOD 2 is 0, so `odds` remains 1. `count` increments to 2. - **Iteration 3**: `count` is 2. `numbers[2]` is 9. 9 MOD 2 is 1, so `odds` becomes 2. `count` increments to 3. - **Iteration 4**: `count` is 3. `numbers[3]` is 31. 31 MOD 2 is 1, so `odds` becomes 3. `count` increments to 4. - **End**: `count` is 4, so the condition `count < 4` is false. The loop terminates.
評分準則
Award up to 4 marks as follows: - 1 mark for the row where `count` is 0 (`numbers[0] = 15`, `odds = 1`). - 1 mark for the row where `count` is 1 (`numbers[1] = 22`, `odds = 1`). - 1 mark for the row where `count` is 2 (`numbers[2] = 9`, `odds = 2`). - 1 mark for the final rows where `count` progresses to 3 and 4, ending with `odds = 3`.
題目 5 · logic_trace
4 分
An algorithm is designed to calculate the sum of positive integers in an array, stopping early if a negative number is encountered.
The algorithm is represented by the following pseudocode: ``` values = [12, 5, -1, 8] i = 0 total = 0 while i < 4 and values[i] >= 0 total = total + values[i] i = i + 1 endwhile ```
Complete the trace table below for this algorithm.
- **Initial state**: `i = 0`, `total = 0`. Since `i < 4` (0 < 4) and `values[0] >= 0` (12 >= 0) are true, the loop starts. - **First check**: `values[0]` is 12. `total` is updated to `0 + 12 = 12`. `i` is incremented to 1. - **Second check**: `values[1]` is 5. Since `1 < 4` and `5 >= 0`, `total` is updated to `12 + 5 = 17`. `i` is incremented to 2. - **Third check**: `values[2]` is -1. Since `-1 >= 0` is false, the loop condition fails. The loop terminates immediately.
評分準則
Award up to 4 marks as follows: - 1 mark for correctly identifying `values[0]` is 12. - 1 mark for correctly updating `total` to 12 when `i` increments to 1. - 1 mark for correctly updating `total` to 17 when `i` increments to 2. - 1 mark for indicating that the loop terminates at `values[2] = -1` without adding it to the total.
題目 6 · logic_trace
4 分
The following algorithm performs division by repeated subtraction, determining how many times a divisor fits into a number.
``` num = 17 divisor = 5 quotient = 0 while num >= divisor num = num - divisor quotient = quotient + 1 endwhile ```
Complete the trace table below for this algorithm.
Award up to 4 marks as follows: - 1 mark for the correct first row of updates (`num = 12`, `divisor = 5`, `quotient = 1`). - 1 mark for the correct second row of updates (`num = 7`, `divisor = 5`, `quotient = 2`). - 1 mark for the correct final row of updates (`num = 2`, `divisor = 5`, `quotient = 3`). - 1 mark for terminating the table at the correct point (not performing another step where `num` becomes negative).
題目 7 · logic_trace
4 分
An algorithm is designed to find the maximum value in a small list of items.
``` items = [4, 11, 7, 15] maxVal = items[0] index = 1 while index < 4 if items[index] > maxVal then maxVal = items[index] endif index = index + 1 endwhile ```
- **Initial state**: `maxVal = items[0] = 4`, `index = 1`. - **Iteration 1**: `index = 1`, `items[1] = 11`. Since `11 > 4`, `maxVal` updates to 11. `index` increments to 2. - **Iteration 2**: `index = 2`, `items[2] = 7`. Since `7 > 11` is false, `maxVal` remains 11. `index` increments to 3. - **Iteration 3**: `index = 3`, `items[3] = 15`. Since `15 > 11`, `maxVal` updates to 15. `index` increments to 4. - **Termination**: `index = 4`. The loop test `index < 4` evaluates to false, terminating the algorithm.
評分準則
Award up to 4 marks as follows: - 1 mark for correct `maxVal = 11` at `index = 1`. - 1 mark for correct `items[2] = 7` and `maxVal = 11` at `index = 2`. - 1 mark for correct `items[3] = 15` and `maxVal = 15` at `index = 3`. - 1 mark for correct termination state where `index` becomes 4 and loop ends.
題目 8 · logic_trace
4 分
An algorithm is designed to generate numbers using a loop until a limit is reached.
``` val = 2 limit = 20 while val < limit val = val * 2 + 1 endwhile ```
Complete the trace table below for this algorithm.
- **Initial state**: `val = 2`, `limit = 20`. The condition `val < limit` is `2 < 20`, which is True. - **First iteration**: `val` is updated to `2 * 2 + 1 = 5`. The loop condition test `5 < 20` is True. - **Second iteration**: `val` is updated to `5 * 2 + 1 = 11`. The loop condition test `11 < 20` is True. - **Third iteration**: `val` is updated to `11 * 2 + 1 = 23`. The loop condition test `23 < 20` is False. - **Termination**: The loop ends because `val < limit` evaluates to False.
評分準則
Award up to 4 marks as follows: - 1 mark for the first calculation update where `val` becomes 5 and loop condition is True. - 1 mark for the second calculation update where `val` becomes 11 and loop condition is True. - 1 mark for the third calculation update where `val` becomes 23. - 1 mark for correctly showing that at `val = 23`, the loop condition `val < limit` is False, causing the loop to terminate.
題目 9 · general_coding_theory
3 分
Explain three benefits of using subprograms (functions or procedures) when designing and writing a computer program.
查看答案詳解收起答案詳解
解題
Subprograms allow modularity. This means code is broken down into self-contained units. The main benefits include: 1. Code can be reused multiple times from different parts of the program without duplication. 2. It is easier to debug and test since errors can be isolated to a single function. 3. It makes the program easier to read, understand, and maintain, as well as allowing multiple programmers to collaborate on different parts of the project.
評分準則
Award 1 mark per valid benefit explained, up to a maximum of 3 marks: - Code reuse: Avoids duplication of code / can call the block multiple times. - Easier maintenance/debugging: Can locate and fix errors in specific blocks of code more easily / can test blocks independently. - Collaboration: Enables teamwork as different developers can write different subprograms at the same time. - Readability: Simplifies the main program flow, making it easier to read/understand.
題目 10 · general_coding_theory
3 分
A developer is creating a new mobile application for a local library.
Explain how the developer could use the computational thinking concept of 'decomposition' when designing this application. Your answer should include two examples of how the application could be decomposed.
查看答案詳解收起答案詳解
解題
Decomposition means taking a large task, like building a library app, and dividing it into smaller, distinct components. For example, instead of coding everything as one massive task, the developer creates separate functional areas: one for managing user accounts (login/logout), another for querying the inventory (book search), and another to handle borrow transactions. This makes development, testing, and debugging far simpler.
評分準則
Award 1 mark for defining decomposition as breaking down a complex problem into smaller/simpler sub-problems. Award 1 mark each for two realistic examples of sub-problems within a library app (e.g., user registration/login, database search, reserve/borrow book module, notification system, payment of fines, etc.) up to a maximum of 2 marks. Total: 3 marks.
題目 11 · general_coding_theory
3 分
Explain the difference between a global variable and a local variable in a computer program, and describe one disadvantage of using global variables.
查看答案詳解收起答案詳解
解題
Global variables are declared outside of any subprograms and have a global scope, meaning they can be read or updated from anywhere in the program. Local variables are declared inside a specific function or procedure and only exist within that local scope (they are destroyed when the subprogram finishes). A disadvantage of global variables is that because they can be changed anywhere, it is hard to track where a bug was introduced if their value becomes corrupted, and they use up memory for the entire duration of the program execution.
評分準則
Award 1 mark: Correct explanation of global variable scope (accessible/defined throughout the whole program). Award 1 mark: Correct explanation of local variable scope (only accessible/defined within the subprogram/block in which it is declared). Award 1 mark: Valid disadvantage of global variables (e.g., harder to debug as any part of the program can change its value, can cause accidental side effects/naming conflicts, remains in memory for the duration of the entire program run). Total: 3 marks.
題目 12 · general_coding_theory
3 分
Consider the following OCR Reference Language algorithm:
``` a = 5 b = 12 temp = a a = b b = temp ```
Describe the purpose of this algorithm and explain how the variable `temp` is used to prevent data loss.
查看答案詳解收起答案詳解
解題
The algorithm swaps the values of `a` and `b` (so that `a` becomes 12 and `b` becomes 5). In sequence: 1. `temp` is assigned 5 (the original value of `a`). 2. `a` is reassigned to 12 (the value of `b`). At this point, `a`'s original value (5) is lost from variable `a` itself. 3. `b` is assigned 5 (from the `temp` variable).
If `temp` was not used and we simply did `a = b` then `b = a`, both variables would end up holding 12, and the value 5 would be permanently lost.
評分準則
Award 1 mark: Identify the purpose is to swap the values of variables `a` and `b`. Award 1 mark: Explain that assigning `b` to `a` directly (i.e., `a = b`) would overwrite/erase the original value of `a`. Award 1 mark: Explain that storing the original value of `a` in `temp` preserves it so it can be assigned to `b` in the final step. Total: 3 marks.
題目 13 · general_coding_theory
3 分
A programmer writes a program to calculate the average of three numbers. During testing, they find the program compiles and runs successfully, but outputs the wrong average value.
State the type of error that has occurred. Explain the difference between this type of error and a syntax error.
查看答案詳解收起答案詳解
解題
The programmer has made a logic error (for example, writing `average = a + b + c / 3` instead of `average = (a + b + c) / 3`).
Differences: - Logic error: The program runs, but the output is incorrect because the logic/algorithm is flawed. - Syntax error: The compiler/interpreter cannot understand the code because it breaks the spelling or grammar rules of the programming language, meaning the program will fail to run or compile.
評分準則
Award 1 mark: Identify the error as a logic error. Award 1 mark: Explain that a logic error does not stop the program from running/compiling but leads to an incorrect output. Award 1 mark: Explain that a syntax error violates the grammatical rules of the programming language and prevents the program from compiling or running. Total: 3 marks.
J277/02 乙部
Spend at least 40 minutes on this section. Solve programming problems using the OCR Exam Reference Language or a high-level language.
7 題目 · 29.900000000000002 分
題目 1 · data_type_handling
3 分
A programmer is writing a system to calculate the average score of a student.
The user enters the student's total marks as `"145"` and the number of tests as `"5"`.
Currently, these inputs are stored as string data types in the variables `totalScore` and `testCount` respectively.
Write three lines of code in OCR Exam Reference Language to: 1. Cast `totalScore` to an integer. 2. Cast `testCount` to an integer. 3. Calculate the average score and store it in a variable named `average`.
查看答案詳解收起答案詳解
解題
The inputs must be converted from strings to integers using casting functions before division is performed to calculate the average.
In OCR Exam Reference Language, the function `stringtoint()` is used to cast a string to an integer.
1. `totalScore = stringtoint(totalScore)` converts the string `"145"` to the integer `145`. 2. `testCount = stringtoint(testCount)` converts the string `"5"` to the integer `5`. 3. `average = totalScore / testCount` calculates the average and stores it.
評分準則
- 1 mark for casting `totalScore` using `stringtoint()` or `int()`. - 1 mark for casting `testCount` using `stringtoint()` or `int()`. - 1 mark for correct calculation (`totalScore / testCount`) and assigning it to `average`.
Accept alternative high-level languages (e.g., Python: `totalScore = int(totalScore)`).
題目 2 · data_type_handling
4 分
A program receives a user's input as a string: `userInput = "3.14"`.
If the programmer attempts to execute the code `result = userInput * 2` without casting:
1. Describe the outcome or error that would occur in a high-level language like Python. (2 marks) 2. Write the corrected OCR Exam Reference Language code (or a high-level language of your choice) to cast `userInput` so that `result` is mathematically calculated as `6.28`. (2 marks)
查看答案詳解收起答案詳解
解題
1. In Python, multiplying a string by an integer performs string repetition (replication). Thus, `"3.14" * 2` results in the string `"3.143.14"` rather than the mathematical product `6.28`. 2. To fix this, the string must be cast to a Real (float) data type. In OCR Exam Reference Language, this is done using `stringtoreal()`. The corrected code converts `userInput` to a real number first, and then multiplies it by 2: `userInput = stringtoreal(userInput)` `result = userInput * 2`
評分準則
Part 1 (Max 2 marks): - 1 mark: Stating that string replication/repetition will occur. - 1 mark: Stating the resulting value will be the string `"3.143.14"` (or explaining that a Type Error would occur in languages that do not support string-integer multiplication).
Part 2 (Max 2 marks): - 1 mark: Correctly casting the variable using `stringtoreal()` or equivalent (e.g., `float()` in Python). - 1 mark: Correctly multiplying the casted value by 2 and storing the result in the variable `result`.
題目 3 · scenario_coding
5.3 分
A theme park ride has a minimum height limit of 120 cm and a maximum height limit of 190 cm.
Write an algorithm in pseudocode or a high-level language that: - Prompts the user to input a height in cm. - Checks if the input is valid (greater than 0). If not, outputs 'Invalid height'. - If valid, checks if the height is within the allowed limits (inclusive). - Outputs 'Access granted' if they are within the limits, or 'Access denied' if they are too short or too tall.
查看答案詳解收起答案詳解
解題
One possible solution written in Python:
```python height = int(input("Enter height: ")) if height <= 0: print("Invalid height") else: if height >= 120 and height <= 190: print("Access granted") else: print("Access denied") ```
Alternatively, in OCR Exam Reference Language:
```text height = input("Enter height: ") if height <= 0 then print("Invalid height") else if height >= 120 AND height <= 190 then print("Access granted") else print("Access denied") endif endif ```
評分準則
- 1 mark: Requesting user input and storing it in a variable. - 1 mark: Correct conditional check for invalid height (height <= 0) with matching error message. - 1 mark: Correct check for minimum limit (height >= 120) and maximum limit (height <= 190) combined with AND. - 1 mark: Outputting 'Access granted' and 'Access denied' in the correct branches. - 1.3 marks: Maintaining correct nested structure or logical flow (not checking limits if input is <= 0).
題目 4 · scenario_coding
5.3 分
A taxi company stores booking records in a 2D array named 'bookings'. Each row contains: - bookings[row][0]: Customer's name (string) - bookings[row][1]: Journey distance in miles (real) - bookings[row][2]: Tip given (boolean, true or false)
Write an algorithm using pseudocode or a high-level programming language that: - Loops through each booking in the array 'bookings' (assume the array has exactly 100 entries, indexed from 0 to 99). - Calculates the total money earned from distances, where each mile costs £1.50. - Counts how many bookings included a tip. - Outputs both the total earnings and the total tip count at the end.
查看答案詳解收起答案詳解
解題
One possible solution in OCR Exam Reference Language:
```text totalEarnings = 0 tipCount = 0 for i = 0 to 99 distance = bookings[i][1] totalEarnings = totalEarnings + (distance * 1.50) if bookings[i][2] == true then tipCount = tipCount + 1 endif next i print("Total earnings: " + totalEarnings) print("Total tips: " + tipCount) ```
評分準則
- 1 mark: Initialising accumulator variables (total earnings and tip count) to 0 before the loop. - 1 mark: Designing a loop to iterate exactly 100 times (e.g., 0 to 99). - 1 mark: Accessing the distance correctly at index [i][1], multiplying by 1.50, and updating the running total earnings. - 1 mark: Checking the boolean tip status at index [i][2] and incrementing the count if true. - 1.3 marks: Outputting the final calculated values outside of the loop.
題目 5 · scenario_coding
5.3 分
Write a function 'calculateDiscount' that takes two parameters: - 'originalPrice' (a real number) - 'isMember' (a boolean)
The function must calculate and return the discounted price based on these rules: - If originalPrice is less than 10, no discount is applied. - If originalPrice is 10 or more and isMember is true, a 20% discount is applied. - If originalPrice is 10 or more and isMember is false, a 10% discount is applied.
Write this function using pseudocode or a high-level programming language.
查看答案詳解收起答案詳解
解題
An OCR Exam Reference Language solution:
```text function calculateDiscount(originalPrice, isMember) if originalPrice < 10 then return originalPrice else if isMember == true then return originalPrice * 0.80 else return originalPrice * 0.90 endif endif endfunction ```
評分準則
- 1 mark: Correct function definition including two input parameters (originalPrice, isMember). - 1 mark: Correct validation for prices under 10 returning the unmodified originalPrice. - 1 mark: Correct nested check for isMember if price is >= 10. - 1 mark: Mathematically correct application of discounts (multiplying by 0.8 for 20% discount and 0.9 for 10% discount). - 1.3 marks: Using 'return' statements correctly instead of print statements to return the values from all paths.
題目 6 · database_query_sql
3 分
A database table, tblBooks, stores details of books in a shop. The table has the following fields: BookID, Title, Author, Genre, StockLevel, Price. Write an SQL query to display the Title and Price of all books where the Genre is 'Sci-Fi' and the StockLevel is greater than 10.
查看答案詳解收起答案詳解
解題
The query requires three main clauses: 1. SELECT followed by the fields to be displayed: Title, Price. 2. FROM followed by the table name: tblBooks. 3. WHERE followed by the conditions: Genre = 'Sci-Fi' AND StockLevel > 10. Combining these gives: SELECT Title, Price FROM tblBooks WHERE Genre = 'Sci-Fi' AND StockLevel > 10
評分準則
1 mark for SELECT Title, Price (or Price, Title). 1 mark for FROM tblBooks. 1 mark for WHERE Genre = 'Sci-Fi' AND StockLevel > 10 (accept double quotes for 'Sci-Fi' and accept optional trailing semicolon).
題目 7 · io_textfiles_2d_arrays
4 分
An algorithm is required to process student exam data.
A 2D array called students contains 30 records. - Column 0 contains the student's name (e.g. "Alice"). - Column 1 contains the student's exam score as an integer (e.g. 78).
Write an algorithm using OCR Exam Reference Language or a high-level language of your choice to: - Open a text file called pass_list.txt in write mode. - Loop through all 30 records in the 2D array students. - Identify students who have an exam score of 50 or higher. - Write the names of these students to the file, with each name on a new line. - Close the file once processing is complete.
查看答案詳解收起答案詳解
解題
Example Solution in OCR Exam Reference Language: passFile = open("pass_list.txt") for i = 0 to 29 if students[i, 1] >= 50 then passFile.writeLine(students[i, 0]) endif next i passFile.close()
Example Solution in Python: passFile = open("pass_list.txt", "w") for i in range(30): if students[i][1] >= 50: passFile.write(students[i][0] + " ") passFile.close()
評分準則
Award up to 4 marks: - 1 mark: Opening 'pass_list.txt' in write mode (e.g. open() or open("pass_list.txt", "w")). - 1 mark: A loop that correctly iterates 30 times (from index 0 to 29). - 1 mark: Checking if the score (column 1) is 50 or higher using correct 2D array indices (e.g. students[i, 1] >= 50 or students[i][1] >= 50). - 1 mark: Writing the student's name (column 0) to the file and closing the file (e.g. passFile.close()).
想知道自己有幾分把握?
Thinka 是 DSE 學生用的 AI 練習應用程式,有無限量練習題、即時自動批改和詳細解題步驟。逾 100,000 名學生用它確認自己真的識,而不只是「以為識」。