Posts

Showing posts from June, 2022

C#

 QUESTION 1 "A-PIE" (Pillars of OOP) ANSWER: Abstraction, Polymorphism, Inheritance, Encapsulation ---------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------- QUESTION 2 Abstraction ANSWER: is the process by which a developer hides everything other than the relevant data about an object in order to simplify and increase efficiency. ---------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------- QUESTION 3 Polymorphism ANSWER: is when each class implements the same methods in varying ways, but you can still have several classes that can be utilized interchangeably. ---------------------------------------------------------------------------------------------------- --------------------------------------...

C++ Midterm answers

 false T/F When assigning a numeric value to a variable, enclose the variable in single quotes true T/F The symbol :: represents the scope resolution operator false T/F When you increase an integer beyond its maximum value, you generate an error true T/F every variable must have a type that tells your compiler how much memory to set aside and defines what you can legally do with the variable true T/F a linker links objects files to external files and creates an executable file false T/F a quote is a series of printable characters false T/F A postfix increment operator increments a variable before the evaluation of a larger expression involving the variable false T/F Inserting comment into code is a waste of time true T/F When you declare a variable, you must specify its type false T/F Users cannot input values for variables Assembly Which of the following is not one of the three typical categories of programming errors object-oriented programming Creation of reusable software objec...

Machine Learning Questions

How do we measure the accuracy of a hypothesis function? By using a cost function, usually denoted by J. What is the definition of a cost function of a supervised learning problem? Takes an average difference of all the results of the hypothesis with inputs from x's and the actual output y's. What are alternative terms of a Cost Function? #2 • Squared error function. • Mean squared error. State the algorithm for gradient descent. Repeat until convergence, where j=0,1 represents the feature index number. How does gradient descent converge with a fixed step size alpha? #2 • As we approach a local minimum, gradient descent will take smaller steps. • Thus no need to decrease alpha over time. What is the algorithm for implementing gradient descent for linear regression? #2 • We can substitute our actual cost function and our actual hypothesis function. • m is the size of the training set, theta 0 a constant that will be changing simultaneously with theta 1 and x, y are values of the...

LinkedIn Python Badge

 LinkedIn Python Badge Q1: What is an abstract class? An abstract class exists only so that other "concrete" classes can inherit from the abstract class. Q2. What happens when you use the build-in function any( ) on a list? The any( ) function returns True if any item in the list evaluates to True. Otherwise, it returns False. if any([True, False, False, False]) == True: print('Yes, there is True') >>> Yes, there is True Q3. What data structure does a binary tree degenerate to if it isn't balanced properly? linked List Q4. What statement about static methods is true? Static methods serve mostly as utility methods or helper methods, since they can't access or modify a class's state. Q5. What are attributes? Attributes are a way to hold data or describe a state for a class or an instance of a class. Q6. What is the term to describe this code? count, fruit, price = (2, 'apple', 3.5) tuple unpacking Q7. What built-in list method would you use ...