A-level 計算機/AQA/試卷 1/程式框架/AS2024
外觀
AQA 計算機科學佇列模擬器
這適用於 AQA AS 計算機科學規範。
這裡可以提出關於一些問題可能是什麼以及我們如何解決它們的建議。
2024 年試卷 1 A 部分將包含 4 道題,總分 21 分。(Q1 - 5 分,Q2 - 4 分,Q3 - 3 分,Q4 - 9 分)。EAD 提供了一個用於 Q1 答案的表格,這很可能是一個跟蹤表。
2024 年試卷 1 B 部分將包含 11 道題,總分 24 分。(Q5 - 2 分,Q6 - 2 分,Q7 - 1 分,Q8 - 1 分,Q9 - 2 分,Q10 - 2 分,Q11 - 4 分,Q12 - 2 分,Q13 - 3 分,Q14 - 3 分,Q15 - 2 分。)
2024 年試卷 1 C 部分將包含 3 道題,總分 30 分。(Q16 - 8 分,Q17 - 9 分,Q18 - 13 分。)
Q16 - 預測
由於程式中沒有重大未解決的錯誤,因此可以做出的唯一顯著的功能更改是與設定選單有關。最初,輸入除“Y”之外的任何值都會讓使用者跳過編輯設定,但是應該更改為程式只接受 Y 和 N 作為使用者輸入。下面給出了 C# 中的一個示例
public static void ChangeSettings(ref int SimulationTime, ref int NoOfTills)
{
SimulationTime = 10;
NoOfTills = 2;
Console.WriteLine("Settings set for this simulation:");
Console.WriteLine("=================================");
Console.WriteLine($"Simulation time: {SimulationTime}");
Console.WriteLine($"Tills operating: {NoOfTills}");
Console.WriteLine("=================================");
Console.WriteLine();
Console.Write("Do you wish to change the settings? Y/N: ");
string Answer = Console.ReadLine();
Answer = Answer.ToUpper();
while (Answer != "Y" && Answer != "N")
{
Console.WriteLine("Not a valid choice, please try again with Y/N");
Answer = Console.ReadLine();
Answer = Answer.ToUpper();
}
if (Answer == "Y")
{
Console.WriteLine($"Maximum simulation time is {MAX_TIME} time units");
Console.Write("Simulation run time: ");
SimulationTime = Convert.ToInt32(Console.ReadLine());
while (SimulationTime > MAX_TIME || SimulationTime < 1)
{
Console.WriteLine($"Maximum simulation time is {MAX_TIME} time units");
Console.Write("Simulation run time: ");
SimulationTime = Convert.ToInt32(Console.ReadLine());
}
Console.WriteLine($"Maximum number of tills is {MAX_TILLS}");
Console.Write("Number of tills in use: ");
NoOfTills = Convert.ToInt32(Console.ReadLine());
while (NoOfTills > MAX_TILLS || NoOfTills < 1)
{
Console.WriteLine($"Maximum number of tills is {MAX_TILLS}");
Console.Write("Number of tills in use: ");
NoOfTills = Convert.ToInt32(Console.ReadLine());
}
}
}