Unified Modeling Language (UML), Pseudocode, C173 Study Sheet, Scripting and Programming, Exams of Computer Programming

Unified Modeling Language (UML), Pseudocode, C173 Study Sheet, Scripting and Programming - Foundations - C173, C173 Version 3 Language Agnostic. Latest Update, Graded A+ Use Case Diagram Used to describe the set of scenarios, the diagram itself illustrates functionality of the system Class Diagram Used to describe structure and behavior in the use cases, this diagram provides a conceptual model of the system in terms of entities and their relationship Activity Diagram Used to model the functional flow-of-control between two or more class objects Sequence Diagram

Typology: Exams

2025/2026

Available from 06/27/2026

Elsa025
Elsa025 🇺🇸

4

(3)

1.3K documents

1 / 36

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Unified Modeling Language (UML),
Pseudocode, C173 Study Sheet,
Scripting and Programming -
Foundations - C173, C173 Version 3
Language Agnostic. Latest Update,
Graded A+
Use Case Diagram
Used to describe the set of scenarios, the diagram itself illustrates functionality of the system
Class Diagram
Used to describe structure and behavior in the use cases, this diagram provides a conceptual model of
the system in terms of entities and their relationship
Activity Diagram
Used to model the functional flow-of-control between two or more class objects
Sequence Diagram
Used to describe interactions among classes in terms of an exchange of messages over time
1) Use Case Diagrams
-they describe actions (use cases) that a system should/could perform in collaboration with one or more
external users (actors)
- answers what system will do from a user-point-of-view
What is the primary purpose of a Use Case Diagram?
Is to help development teams visualize the functional requirements of the system
Use Case Diagram: Components
1) System Boundary - Scope/limits of system. The yellow rectangle
2) Actors - Entity that performs actions.actor interacts with the system
3) Use Case- Every business functionality is a Use Case
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24

Partial preview of the text

Download Unified Modeling Language (UML), Pseudocode, C173 Study Sheet, Scripting and Programming and more Exams Computer Programming in PDF only on Docsity!

Unified Modeling Language (UML),

Pseudocode, C173 Study Sheet,

Scripting and Programming -

Foundations - C173, C173 Version 3

Language Agnostic. Latest Update,

Graded A+

Use Case Diagram Used to describe the set of scenarios, the diagram itself illustrates functionality of the system Class Diagram Used to describe structure and behavior in the use cases, this diagram provides a conceptual model of the system in terms of entities and their relationship Activity Diagram Used to model the functional flow-of-control between two or more class objects Sequence Diagram Used to describe interactions among classes in terms of an exchange of messages over time 1) Use Case Diagrams

  • they describe actions (use cases) that a system should/could perform in collaboration with one or more external users (actors)
  • answers what system will do from a user-point-of-view What is the primary purpose of a Use Case Diagram? Is to help development teams visualize the functional requirements of the system Use Case Diagram: Components
  1. System Boundary - Scope/limits of system. The yellow rectangle
  2. Actors - Entity that performs actions.actor interacts with the system
  3. Use Case- Every business functionality is a Use Case
  1. Include - Represents invocation of one use case by another use case. One function being called by another function Class Diagrams (ie: Find the Objects) OOD is deigned to mimic the way humans naturally express relationships Three horizontal sections here:
  2. Class Name
  3. Class Properties
  4. Class Methods Class relationships (Association) Do this from bottom-up By definition, all associations are bi-directional un Sequence diagram they describe interactions among classes in terms of an exchange of messages over time DECLARE variable The process of assigning a name and a datatype to a variable STRING A datatype for a series of characters of text and numbers. INTEGER A datatype for whole numbers REAL A datatype for numbers with decimal places BOOLEAN A datatype that has a TRUE and FALSE value

Flowchart Start or Stop Rounded Rectangle Flowchart Input or Output Paralellogram Flowchart Process (something happens) Rectangle > Greater than < Less than <= Less than or equal to DECLARE array [1:20] The process of assigning an array. In pseudocode this starts at 1. DECLARE CONSTANT The process of assigning a constant WHILE ... DO ... ENDWHILE Execute a set of statements as long as a condition is true

Assignment of a value Count <-- Count + 1 Increasing the count Sum <-- Sum + Number Performing a summing calculation What is a compiled programming language? You write your source code and then a compiler goes through the code and creates a separate file that contains the machine code. This separate file is an executable file because the computer can directly execute it. All of the code is converted at once and the new compiled file is no longer editable. What is an interpreted programming language? An interpreted language does the conversion from source code to machine code on-the- fly. There is no separate machine code file. The computer executes each line when it is needed. This means that all of the code is saved in a format that is editable programming language. What is the main difference in compiled and interpreted code? The main difference is when the code is converted to machine language. A compiled language converts all of the code at one time, before the code is run by the machine, and saves this into a new file. That new file is now machine code, and is not editable. An interpreted language still needs to convert to machine language in order for the computer to understand it, but it does this at the time that the code is executed. The original programming language is preserved, so it is editable. What is an object? Something that has its own identity and characteristics, separate from other objects. What three things describe an object in object-oriented programming languages? identity, attributes, and behavior What is a class? A class describes what an object will be, but it isn't the object itself. A class is a blueprint, a detailed description, a definition of an object. Why would we create a class? To create a blueprint upon which to build multiple objects that share attributes and behaviors. What is the difference in an object and a class? An object is something that has its own identify and characteristics, separate from other objects. A class describes that object will be, but it isn't the object itself. For example, a house is an object and the blueprints used to create it would be considered the class.

An object oriented programming language that is organized around objects or classes, rather than "actions". Object-oriented programming takes the view that what we really care about are the objects we want to manipulate rather than the logic required to manipulate them. Which of these programs is object-oriented Java, .NET & C#, Ruby, Python, Objective-C What is this programming languages best used for: C C - games, utilities, embedded systems, operating systems What is this programming languages best used for: Java Java - cross-platform language, used for desktop applications and android mobile applications What is this programming languages best used for: .NET :.NET - windows platforms - desktop, mobile, or web What is this programming languages best used for: C# sharp C# sharp - windows platforms - desktop, mobile, or web What is this programming languages best used for: Ruby Ruby - cross-platform language, used for small utilities and web apps What is this programming languages best used for: Python Python - cross-platform language, used for web apps, embedded scripting language inside other applications What is this programming languages best used for: Objective-C Objective-C - apple development 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? 1st - Gather Requirements 2nd - Describe the Application - This is where you create a Use Case and Use Case Diagram 3rd - Identify the main objects 4th - Describe the interactions between objects 5th - Create a class diagram - class diagram What is the 1st step in the UML design process? Gather Requirements What is the 2nd step in the UML design process?

Describe the Application. This is where you create a Use Case and Use Case Diagram What is the 3rd step in the UML design process? Identify the main objects What is the 4th step in the UML design process? Describe the interactions between objects What is the 5th step in the UML design process? Create a class diagram - This is where the Class Diagram is created In which steps of the design process do use case, use case diagrams, and class diagrams take place? Use case and use case diagrams take place in step 2, Describe the application. Class diagrams take place in the last step, Create a 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 the 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? 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. What is the purpose of creating a class diagram?

In a programming language like Python, the code must match the language grammar exactly. When programming language grammar is not followed the interpreter will return a Syntax Error message. This means that the structure of the code is inconsistent with the rules of the programming language. How do you change the value of a variable with Python? Using the = character to assign a new value x = 6 x = 9 print x # would print out 9 How to do you join multiple variables together with string data in Python? What is this called? Using the + sign to concatenate the values What does it mean to index a string? How do you do that with Python code? This is what we call selecting a sub-sequence of a string. You do this in Python by specifying the character you want to access by its index position. Index position begins at 0. For example, this code would print out the letter J: name = 'John' print name[0] What does it mean to slice a string? Slicing is simply obtaining a subset of data from a string. You may have also heard this called string extraction. How do you do you Slice a String with Python code? You do this in Python by specifying the index position where you want to begin and where you want to end. Everything from the starting point up until the end point will be extracted. For example, this code would print out "Jo": name = 'John' print name[0:2] What does a procedure do? It takes in inputs, does some processing, and produces outputs. What is the difference in a procedure and a function? A procedure and a function in python are the same so there is no difference. They both take inputs and may or may not return outputs. What is a parameter? Input to a procedure or function What is the difference in an input, an operand, and a parameter?

Nothing! They are all different names used to describe inputs to a procedure. What are the advantages of using a function? Functions can be used multiple times. They provide a modular piece of code that only has to be written once and then can be called upon multiple times within the program. When does a function execute? When you explicitly ask it to execute by calling the function and passing in any parameters. We refer to this as invoking or calling the function. How do you define outputs for a function? Using the return keyword you can define what data will be returned or output when the procedure or function runs. You can only access data from within a function if you return that specific data to be used outside of the function. How is a while loop constructed in Python? What is its purpose? executes any number of times, continuing as long as the test expression is True while :

How are compound mathematical expressions evaluated in Python? First perform calculations within parentheses. Next work left to right and perform all multiplication and division. Finally, work left to right and perform all addition and subtraction. What is the function of parentheses, (), in programming expressions? When we are working with an expression, they group items within that expressions. Items within parentheses are evaluated first. What does this expression evaluate to: 5 + 4 * (4 + 4 / 2) Final value is 29. First we evaluate the parentheses, beginning with division, then addition: 5 + 4 * (4 + 2) 5 + 4 * (6) Then we evaluate the multiplication: 5 + 4 * (6) And finally, we evaluate the addition: 5 + 24 = 29 What does this operators do?

  • concatenate strings or add integers

What does the following operators do? <= less than or equal to What does the following operators do? >= greater than or equal to What does the following operators do? == equal to Evaluate the following expression: true AND true = True Evaluate the following expression: true AND false = False Evaluate the following expression: false AND true = False Evaluate the following expression: false AND false = False Evaluate the following expression: true OR true = True Evaluate the following expression: true OR false = True Evaluate the following expression: false OR true = True Evaluate the following expression: false OR false = False Evaluate the following expression: (false AND true) OR (true OR false) =

True Evaluate the following expression: (false AND false) OR (true OR true) = True Evaluate the following expression: (false AND true) AND (true OR false) = False Evaluate the following expression: (false AND false) AND (true OR true) = False Evaluate the following expression: true OR not true = True Evaluate the following expression: not (false AND true) AND (not true OR false) = False How are elements in a list indexed? List elements are assigned an index number starting with 0. What is mutation? Do lists support mutation? This is the ability to change the value of something. Lists support mutation, allowing you to change the overall length as well as individual elements within the list. How is a for loop constructed in Python? What is its purpose? A for loop provides a way to execute a block once for each element of a list. The syntax is this: for in :

How do you select a sub-sequence of a list with Python? You specify the index position to begin the selection and the index position by which to stop the selection. For example, the following code would print red and yellow because they are at position 0 and

The value of 2 tells us to stop the selection at position 2, but not to include it. myColors = ["red","yellow","blue","orange","green"] print myColors[0:2] What does the pop method do to a list in Python?

How are buckets used in a hash table? What effect do they have on lookup speed? Entries in a hash table are mapped to a number, which is the position in the index where you should look for the entry. A hash table has numbered bucket slots that hold entries. The entries are organized in the buckets based on their assigned keyword number. When you run a search using a hash table the keyword assigned will be used to determine which bucket the entry should be located in and begin the search there. Because the search knows where to begin looking it is much quicker to look up items. What is an algorithm? A well-defined sequence of steps (known as a procedure) that will always finish and produce the right results. The algorithm must finish in order for us to analyze efficiency. What is the difference in a procedure and an algorithm? A procedure and algorithm are both a set of instructions that will be executed in order. The difference is that an algorithm must return a value. A procedure, or function, that does not return a value may not be considered an algorithm. Which storage method covered in this course ensures the fastest access to data? A hash table, or dictionary - these are the same thing. 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. 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. 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 are circular definitions? A definition that constantly calls itself. Because it lacks a base case it has no way to stop. It is stuck in a loop with a reference pointing to another reference that never resolves. These types of definitions are largely helpful in mathematical application. What is a recursive definition?

When a function calls itself, it is recursion. If a function is calling itself, it would be stuck in a loop forever unless we have a condition that would allow the recursion to stop. A recursive definition needs to have two parts: the recursive case and the base case. The base case must be something that you already know the answer for and not need to do anything to work it out. This is what allows us to eventually stop running the definition. The recursive case is when the function is calling itself to run again. The recursive case is defined in terms of itself, but in terms of a smaller version of itself, as progress must be made towards the base case. When would you use recursion? To allow us to define infinitely many things using a few simple rules. A simple definition can be used to expand on something much more complex. This involves breaking a problem down into smaller and smaller subproblems until you get to a small enough problem that it can be solved trivially. For example, you could define ancestory = person 1 + ancestors. If you are person 1, your ancestors would be your parents, but they are not your only ancestors. Your parents have parents, but those are still your ancestors. Your grandparents had parents, and so on. A very simple definition can execute with multiple layers and a much more complex value. What type of definition is this code an example of? Answer: This is a circular definition What type of definition is this code an example of? Answer: This is a recursive definition What is an editor? A program that allows you to write code What is a compiler? A program that produces other programs. The compiler does all the work at once and then runs the new program. We're translating the code we wrote to computer code all at once. This is often when we produce an .exe (executable) file. What is an interpreter?

Using the + sign to concatenate the values What does it mean to index a string? How do you do that with Python code? This is what we call selecting a sub-sequence of a string. You do this in Python by specifying the character you want to access by its index position. Index position begins at 0. For example, this code would print out the letter J: name = 'John' print name[0] What does it mean to slice a string? How do you do that with Python code? Slicing is simply obtaining a subset of data from a string. You may have also heard this called string extraction. You do this in Python by specifying the index position where you want to begin and where you want to end. Everything from the starting point up until the end point will be extracted. For example, this code would print out "Jo": name = 'John' print name[0:2]

concatenate or add

assignment

multiply

subtract / divide % Modulos, does division and returns the remainder What does the * operator do when applied to string data? It writes out the string data multiple times. For example, print '!' * 12 would output !!!!!!!!!!!! ( exclamation points). What does a procedure do? takes in inputs, does some processing, and produces outputs What is the difference in a procedure and a function?

A procedure and a function in python are the same so there is no difference. They both take inputs and may or may not return outputs. What is a parameter? Input to a procedure or function What is the difference in an input, an operand, and a parameter? Nothing! They are all different names used to describe inputs to a procedure. What are the advantages of using a function? Functions can be used multiple times. They provide a modular piece of code that only has to be written once and then can be called upon multiple times within the program. When does a function execute? When you explicitly ask it to execute by calling the function and passing in any parameters. We refer to this as invoking or calling the function. How do you define outputs for a function? Using the return keyword you can define what data will be returned or output when the procedure or function runs. You can only access data from within a function if you return that specific data to be used outside of the function. How is a while loop constructed in Python? What is its purpose? executes any number of times, continuing as long as the test expression is True while :

How is an if else statement constructed in Python? What is its purpose? provides a way to control what code executes based on the result of a test expression if :

else:

How are compound mathematical expressions evaluated in Python? First perform calculations within parentheses. Next work left to right and perform all multiplication and division. Finally, work left to right and perform all addition and subtraction What is the function of parentheses, (), in programming expressions? When we are working with an expression, they group items within that expressions. Items within parentheses are evaluated first. For example: (5 + 3) * 8 = 64 because we do the addition first, then multiplication