Scripting and Programming - Foundations - C173 Questions with Complete Solutions 100%
Solved| Grade A+
What do we mean when we talk about the cost of an algorithm? An algorithm's cost is
related to the resources that it requires to execute. The primary way cost is discussed is related
to the size of the input. Larger inputs usually mean more resources, so this is the main factor
that determines the speed. Ultimately this determines the amount of time it takes the
algorithm to execute and the amount of memory required to run it. The process of calculating
this is called algorithm analysis.
What are the two most important factors that affect the cost of an algorithm? Time and
memory. Time is the more important factor.
How do you prioritize case (best case, worst case, average case) when analyzing algorithms?
You would look at them in this order: Worst case, average case, best case. The worst case is
the most important because this will give you a better understanding of why the time scales as
it does.
What is time.clock used for? To check when an algorithm begins and when it ends so that
we can determine the run time. This performs benchmarking, which is simply assessing the
relative performance of an object.
What is UML? Unified Modeling Language. This is a graphical notation specifically for
drawing diagrams of an object-oriented system.
What are the 5 steps in the UML design process? In which steps do use case, use case diagrams,
and class diagrams take place? 1.Gather Requirements
2. Describe the Application (use case and use case diagram)
3. Identify the main objects
, 4. Describe the interactions between objects
5. Create a class diagram (class diagram)
What does a use case provide? A simple narrative for how people use the application. It is
written text and there is no coding at this point. This is created after gathering the
requirements.
What is a title in a use case? This is a short phrase with an active verb that describes the
goal. For example, "register new members".
What is an actor in a use case? This is the person or entity who needs to accomplish
something.
What must be true of entities for them to be considered actors in a use case? As long as an
entity exists outside of the described system it can interact with the system. In this case the
entity can accomplish something within the system and is considered an actor.
What is a scenario in a use case? This is how the actor accomplishes the activity or goal.
What does a use case diagram provide? What is the purpose of creating a case diagram?
The use case diagram allows you to look more broadly at the requirements of an application
by visualizing several use cases and multiple actors at the same time.
What does a class diagram provide? What is the purpose of creating a class diagram? A class
diagram is a visual representation of classes needed. Its most basic structure defines the class
name, attributes that it will have, and operations, or methods. This is also where you define
inheritance and polymorphism. It allows you to plan out the classes that you will create and
their basic structure so that when you translate this to code you know what is needed.
Solved| Grade A+
What do we mean when we talk about the cost of an algorithm? An algorithm's cost is
related to the resources that it requires to execute. The primary way cost is discussed is related
to the size of the input. Larger inputs usually mean more resources, so this is the main factor
that determines the speed. Ultimately this determines the amount of time it takes the
algorithm to execute and the amount of memory required to run it. The process of calculating
this is called algorithm analysis.
What are the two most important factors that affect the cost of an algorithm? Time and
memory. Time is the more important factor.
How do you prioritize case (best case, worst case, average case) when analyzing algorithms?
You would look at them in this order: Worst case, average case, best case. The worst case is
the most important because this will give you a better understanding of why the time scales as
it does.
What is time.clock used for? To check when an algorithm begins and when it ends so that
we can determine the run time. This performs benchmarking, which is simply assessing the
relative performance of an object.
What is UML? Unified Modeling Language. This is a graphical notation specifically for
drawing diagrams of an object-oriented system.
What are the 5 steps in the UML design process? In which steps do use case, use case diagrams,
and class diagrams take place? 1.Gather Requirements
2. Describe the Application (use case and use case diagram)
3. Identify the main objects
, 4. Describe the interactions between objects
5. Create a class diagram (class diagram)
What does a use case provide? A simple narrative for how people use the application. It is
written text and there is no coding at this point. This is created after gathering the
requirements.
What is a title in a use case? This is a short phrase with an active verb that describes the
goal. For example, "register new members".
What is an actor in a use case? This is the person or entity who needs to accomplish
something.
What must be true of entities for them to be considered actors in a use case? As long as an
entity exists outside of the described system it can interact with the system. In this case the
entity can accomplish something within the system and is considered an actor.
What is a scenario in a use case? This is how the actor accomplishes the activity or goal.
What does a use case diagram provide? What is the purpose of creating a case diagram?
The use case diagram allows you to look more broadly at the requirements of an application
by visualizing several use cases and multiple actors at the same time.
What does a class diagram provide? What is the purpose of creating a class diagram? A class
diagram is a visual representation of classes needed. Its most basic structure defines the class
name, attributes that it will have, and operations, or methods. This is also where you define
inheritance and polymorphism. It allows you to plan out the classes that you will create and
their basic structure so that when you translate this to code you know what is needed.