Learn Extracted exam questions IGCSE Computer Science 0478 Computer Science November 2025 Question Paper 21
0478 Computer Science November 2025 Question Paper 21
Source PDF on the left, extracted YAML on the right. Compare numbering, marks, options and text.
Four descriptions of structured query language (SQL) keywords and \textbf{five} SQL keywords are given.
Draw \textbf{one} line from each description to its matching keyword. \textbf{Not} all SQL keywords will be used.
\textbf{Description} \begin{itemize} \item identifies the database table \item sets the condition \item sorts the results \item returns the number of records \end{itemize}
\textbf{SQL keywords} \begin{itemize} \item \texttt{ORDER BY} \item \texttt{COUNT} \item \texttt{WHERE} \item \texttt{SUM} \item \texttt{FROM} \end{itemize}
Identify \textbf{three} different types of test data that can be used to test a program.
- \hrulefill
- \hrulefill
- \hrulefill
Tick ($\checkmark$) one box to identify the operator that returns the quotient of a calculation with the fractional part discarded.
A restaurant offers a fixed priced menu. A meal for an adult costs $9.99 and a meal for a child costs$6.99.
If there are 6 or more people at a table, a 15% discount is applied to the total cost of the order.
Write an algorithm in pseudocode to:
\begin{itemize} \item input the number of adults and the number of children at a table \item calculate the total cost of the order with the discount, if this applies \item output the final cost of the order. \end{itemize}
The final cost of the order after the discount may have more than 2 decimal places.
Write a pseudocode statement to set the final cost of the order to 2 decimal places. You do \textbf{not} need to rewrite the whole algorithm.
The restaurant offers a discount on a meal if the person ordering is either a student or is 65 years or older. The discount ($X = 1$) can only be given if the amount of the order is $20.00 or over.
\begin{tabular}{|c|l|c|} \hline rule A & a student & 0 \ \cline{2-3} & not a student & 1 \ \hline rule B & under 65 years old & 0 \ \cline{2-3} & 65 years or older & 1 \ \hline rule C & under $20.00 & 0 \ \cline{2-3} & $20.00 or over & 1 \ \hline \end{tabular}
Write the logic expression for this problem.
Draw a logic circuit for this logic expression.
Each logic gate must have a maximum of \textbf{two} inputs. Do \textbf{not} simplify this logic expression.
Draw the NAND logic gate symbol \textbf{and} complete the truth table for it.
NAND logic gate symbol:
Truth table:
\begin{tabular}{|c|c|c|} \hline \textbf{A} & \textbf{B} & \textbf{X} \ \hline 0 & 0 & \ \hline 0 & 1 & \ \hline 1 & 0 & \ \hline 1 & 1 & \ \hline \end{tabular}
A hotel booking system is an example of a computer system that is made up of sub-systems.
The booking system: \begin{itemize} \item allows the user to select the room type and the number of nights required \item displays the types of rooms available to the user as pictures or as a list. \end{itemize}
Complete the structure diagram for the given parts of the hotel booking system.
Identify the line numbers of the \textbf{four} errors in the pseudocode and suggest a correction for each error.
Error 1 line number \hrulefill
Correction \hrulefill
Error 2 line number \hrulefill
Correction \hrulefill
Error 3 line number \hrulefill
Correction \hrulefill
Error 4 line number \hrulefill
Correction \hrulefill
Explain how you could modify the pseudocode to validate that each input is a single digit.
Any code must be fully explained.
The 5-digit number needs to be entered as a single input.
Describe \textbf{one} verification method that could be applied to the input of the 5-digit number.
Complete the tables, using the flowchart, for the given data:
Input data: 20
\begin{tabular}{|c|c|c|c|} \hline \textbf{Count} & \textbf{Number} & \textbf{Value} & \textbf{Output} \ \hline & & & \ \hline & & & \ \hline & & & \ \hline & & & \ \hline & & & \ \hline & & & \ \hline & & & \ \hline & & & \ \hline & & & \ \hline & & & \ \hline \end{tabular}
\vspace{1em}
Input data: 110
\begin{tabular}{|c|c|c|c|} \hline \textbf{Count} & \textbf{Number} & \textbf{Value} & \textbf{Output} \ \hline & & & \ \hline & & & \ \hline & & & \ \hline & & & \ \hline & & & \ \hline & & & \ \hline & & & \ \hline & & & \ \hline & & & \ \hline & & & \ \hline \end{tabular}
State the purpose of the algorithm on page 8. A copy of the algorithm is provided for you on page 11.
State a suitable data type for the variable \texttt{Count}
Write the algorithm in pseudocode. A copy of the algorithm is provided for you on page 11.
A school has set up a database table \texttt{SchoolTrip} to record details of students that will go on a school trip.
\begin{tabular}{|l|l|l|l|l|} \hline \textbf{StudentID} & \textbf{StudentName} & \textbf{ParentName} & \textbf{Permission} & \textbf{DateReceived} \ \hline STU147 & Amir & Mr Akar & True & 03/03/2025 \ \hline STU348 & Filip & Mrs Johnson & True & 04/03/2025 \ \hline STU274 & Matthew & Mr Smith & False & \ \hline STU873 & Jafar & Mr Al-Saigh & True & 21/03/2025 \ \hline STU221 & Hussein & Mr Alkasab & True & 28/02/2025 \ \hline STU553 & Julie & Mrs Jones & True & 25/02/2025 \ \hline STU213 & Julie & Mr Smith & False & \ \hline \end{tabular}
State the reason why \texttt{ParentName} is not appropriate as the primary key.
Give the name of the field that should be the primary key.
The database only uses these data types:
\begin{itemize} \item text \item character \item Boolean \item integer \item real \item date/time \end{itemize}
Complete the table to show the most appropriate data type for each field. Each data type must be different.
\begin{tabular}{|l|l|} \hline \multicolumn{1}{|c|}{\textbf{Field}} & \multicolumn{1}{c|}{\textbf{Data type}} \ \hline \texttt{ParentName} & \ \hline \texttt{Permission} & \ \hline \texttt{DateReceived} & \ \hline \end{tabular}
Complete the structured query language (SQL) statement to display only the names of the students who do not have permission to go on the trip.
SELECT \hrulefill FROM \hrulefill WHERE \hrulefill
A school stores all the students’ attendance data in a file called \texttt{Attendance.txt}
Write an algorithm in pseudocode to read a line of text from the file and store this line in the variable \texttt{StudentAttendance}
The variables \texttt{Seconds} and \texttt{Minutes} are used in a program. \texttt{Seconds} holds the number of seconds as a whole number and \texttt{Minutes} holds the number of minutes as a whole number.
Write pseudocode statements to declare the variables \texttt{Seconds} and \texttt{Minutes}
The procedure \texttt{Time(TotalSeconds)} takes the number of seconds as a parameter. The procedure converts the value held in the parameter into minutes and seconds and outputs the result.
Write this procedure in pseudocode.
The scores for each competitor in an archery competition are recorded.
The one-dimensional (1D) array \texttt{CompetitorName[]} is used to store the names of the competitors.
The maximum number of competitors is 30.
There are 10 rounds in the competition with a maximum score of 30 per round.
The two-dimensional (2D) array \texttt{CompetitorScore[]} stores the score in each of the 10 rounds for each competitor.
The first index of the array \texttt{CompetitorScore[]} is the same as the index of the competitor in \texttt{CompetitorName[]}
After the 10 rounds have been completed, the highest score and the lowest score for each competitor are discarded.
The overall score for each competitor is the total of the remaining 8 scores (after discarding the highest and lowest scores).
A competitor with an overall score of 210 or more moves onto the next competition. A competitor with an overall score between 180 and 209 inclusive becomes a reserve competitor. A competitor with an overall score below 180 does not qualify.
Write a program that meets the following requirements:
\begin{itemize} \item inputs the total score (out of 30) for each competitor in each round \item validates each input is between 0 and 30 inclusive \item calculates the overall score for each competitor discarding the highest and lowest scores \item outputs the name of each competitor and if they move onto the next competition, are a reserve or do not qualify \item calculates and outputs the number of competitors who: \begin{itemize} \item have qualified for the next competition \item are reserve competitors \item do not qualify. \end{itemize} \end{itemize}
You must use pseudocode or program code \textbf{and} add comments to explain how your code works.
You do \textbf{not} need to declare any arrays or variables; assume that this has already been done.
All inputs and outputs must contain suitable messages.