Docsity

Scripting and Programming Foundations: Key Concepts and Solutions, Exams of Computer Science

Partial preview of the text

Download Scripting and Programming Foundations: Key Concepts and Solutions and more Exams Computer Science in PDF only on Docsity!

SCRIPTING AND PROGRAMMING

FOUNDATIONS WGU WITH CORRECT

SOLUTIONS ALREADY PASSED.

Circular definitions - correct answer - Definition without a base that constantly calls itself, putting itself in a loop, very useful for mathematical application Fastest access to data - correct answer - Hash table or dictionary

Recursive definition - correct answer - Solution of the problem relies on the solution to smaller instances of the problem Used to define many things using simple rules Must have a base case that allows it to end, must move towards this end, and must call itself recursively Algorithm cost - correct answer - Resources required to execute, time and memory Algorithm analyzation prioritization - correct answer - Worst case to best case time.clock - correct answer - Measures when an algorithm begins and ends to determine run time for benchmarking UML - correct answer - Unified Modeling Language Standard way to visualize the design of a system

Class diagram - correct answer - Visual representation of the needs of classes, allowing you to plan out creation of classes Programming library - correct answer - Code already written, tested, and ready to use Compiled programming language - correct answer - Source code turned into executable machine code, machine code is then un- editable Interpreted programming language - correct answer - Language that does the conversion from source to machine code on the fly, is executed when needed with no separate executable file, and it always editable Object oriented programming language - correct answer - Language based around objects rather than actions C - correct answer - games

utilities embedded systems operating systems Java - correct answer - cross-platform language mobile desktop apps .NET & C# - correct answer - windows platforms Ruby - correct answer - cross-platform language web apps Objective C - correct answer - Apple development Editor - correct answer - allows you to write code

String - correct answer - Text surrounded by quotes Integer - correct answer - A number Boolean - correct answer - A true or false value Programming grammar - correct answer - Language rules, returns a syntax error if not followed Change variable value - correct answer - Using an = assigns a new value Indexing a string - correct answer - Selecting a sub-sequence of a string

Slicing a string - correct answer - Obtaining a subset of data from a string

    • correct answer - Concatenate or add = - correct answer - Assignment
    • correct answer - Multiply, when applied to string data it writes out the string multiple times
    • correct answer - Subtract / - correct answer - Divide % - correct answer - Does division and returns remainder Procedure - correct answer - Takes an input

If else statement - correct answer - Controls what code is executed based on results of a test expression if else: Compound mathematical expressions - correct answer - 1st - parenthesis 2nd - multiplication and division from left to right 3rd - addition and subtraction from left to right Parenthesis - correct answer - Groups items in an expression Defines inputs in procedures <

<=

=

** - correct answer - Less than Greater than Less than or equal to Greater than or equal to Equal to Not equal to To the power of Or operator - correct answer - evaluates the true expression And operator - correct answer - evaluates both expressions Indexing - correct answer - Each element in a list is assigned an index number, starting with 0, which can be referenced Mutation - correct answer - Change the value of something, supported by lists

print Colors [0] [1] Append operator - correct answer - Mutates list by adding elements to the end of the list Object - correct answer - Something that has its own identity, attributes, and behavior Class - correct answer - Describes what an object will be, one class can have many objects A house is an object, the blueprints to the house are a class Dot notation - correct answer - <object's name>. myhouse.color would be the color associated with the object myhouse

Instantiation - correct answer - Creating instances of a class Abstraction - correct answer - Focus on essential qualities of something rather than one specific example Encapsulation - correct answer - Surrounding something to protect and to keep contents together Inheritance - correct answer - Code reuse, creating new classes based on existing classes, some characteristics would be inherited Polymorphism - correct answer - Many forms, allows work with objects created from different classes For example the + sign It will add integers, but concatenate strings