🗒️FIT 1051 模拟卷分析

Cs, Go!

FIT 1051|2021-7-2|最后更新: 2025-10-14|
Place
人员
版本更新
2025年10月15日 - 修改了UML 增加了部分函数 # 感谢Ryan同学 2025年10月14日 - 新增拓展函数 #感谢黄同学
- 新增考试先后顺序 (7.) 2025年10月13日 - 修改了UML → UML答案 - 新增公式化打法 - Part2 隐藏题目 2025年6月2号 - 新增读题解析、UML、关键词

题目分析

notion image
notion image
 
👤
在考试中,Sample test的题目只占了50%,还有50%的隐藏题目。(你要是不知道这件事,你就等着考试的时候 看着题目超级加倍吧)。

隐藏题目类似内容:

题目1:

现在我们希望添加一个新的item叫做cap。它有3种颜色红黄蓝,请你拓展你的UML

题目2:

请你解释,你的UML设计是如何满足便于拓展需求的?

UML 标准答案

 
 
notion image

拓展函数

💭
由于2025S1 考试同学们体验下来时间非常紧张。所以推荐同学尽量不要多写题目中没有提到的函数。但是如果在做完卷子后有额外的时间,可以添加更多的函数来提高完成度。
添加的优先顺序: Driver > Abstract Class > Child > others
这里提供一下可额外添加的函数。
(感谢黄同学对函数的补充!)

Part A 公式化打法

第一题

1️⃣ 上去先把题目读了,图画了 (这个改不了)
画图的时候一切从简。能少写的一律不要多写
2️⃣ 讲 Inheritance
  1. A 和 B inherit 了 谁
  1. 好处 - 直接照搬这句话
Tshirt and Record inherit from Item, this avoids code duplication and makes code more maintainable
3️⃣ 讲 polymorphism
  1. 哪些class
  1. 好处1 - 同一个ArrayList
  1. 好处2 - 相同的函数
I’m using poluymorphism here,- both Tshirt and Record inherit from the same parent class, so I can store both class inside the same ArrayLlist. And they will override the function from the parent class.
4️⃣ 讲Enum
  1. 我对A使用了Enum
  1. 好处 - 直接抄
I set size as a enum, to improve code readability and maintainability
5️⃣ 焚决(不知道不重要,背出来就好了)
  1. 高内聚,低耦合
  1. 表现地方
  1. 好处
This design allows me to have a high cohesion and a low coupling code. Each class handle it’s own task, which increase codes maintainability and extensibility.

第二题

每个class的公式化打法

a. 类介绍

跟着题目要求
介绍这个class存在的原因,【是不是父类/是不是子类】

b. 变量介绍

  1. 所有变量默认都是private
  1. 所有父类全是protected
  1. Driverclass 不需要说

c. 函数

  1. 所有的toString提一句就够了
I have toString method help to display
  1. 介绍公式
函数名字 + 做的事 + 返回类型

第三题

这个占分小,考试时间紧,推荐最后写
  1. while loop 让程序一直运行
  1. 一个函数用于检查用户的输入,并且执行对应的内容
  1. 如何对ArrayList 增删改
 

考试做题先后顺序

  1. 先Intro,一边读题,一边旁边画草稿。
  1. 把要的function记下来。
  1. 画图
    1. 画图的时候一定要把类之间的间隔放开来(后面需要)
  1. 画完图,不要做题! 去把后面Part2的题目读了
    1. 读完知道后续要对哪些class做修改
  1. 去做Part1,按照公式化秒了
  1. 剩下的时间去做Part2 的图 + 回答问题
    1. 用其他颜色的笔去改Part1的图 不要删,只能增加
  1. 🔁 添加拓展函数
Loading...