Software Eng.

Ace your homework & exams now with Quizwiz!

What is the name of the file used to tell git not to track certain files and/or folders in your repository?

.gitignore

Hiding implementation details behind an interface.

Encapsulation

When you save a file in Visual Studio, it will automatically commit that file into the git repo.

False

The pre-processor removes statements such as #include and #define from the body of code when forming a translation unit.

False. The preprocessor in C++ does not remove statements such as #include and #define from the body of code when forming a translation unit. Instead, it processes these directives before the actual compilation of the code begins.

True or False: When doing a Merge and every commit in the destination branch is already contained in the source branch, you may get conflicts that need to be resolved.

False. This is known as a "fast-forward merge." In a fast-forward merge, Git simply moves the branch pointer of the destination branch to point to the same commit as the source branch. Since there are no divergent changes to reconcile, there are no conflicts to resolve. The merge is automatic and results in a linear history.

New files that you create in a project are automatically staged in git, and will always be part of the next commit that you make into the repository.

Fasle, You need to explicitly use the git add command to stage these files before they become part of the next commit. Staging allows you to select which changes you want to include in the next commit, giving you control over what gets committed to the repository.

What is the term for the merge process that occurs when every commit in the destination branch is already contained in the source branch?

Fast-Forward Merge

The Observer Pattern is a ______ pattern.

Is a behavioral design pattern.

What is the name of the default branch in git?

Master or main

Modular code is _______.

Modular code is code that is divided into separate modules, where each module encapsulates a specific functionality or a set of related functionalities. This approach promotes reusability, maintainability, and scalability in software development. It allows different parts of a program to be developed, tested, and understood independently, leading to more organized and manageable code.

Building a solution out of a bunch of smaller pieces.

Modularity

Which of the following are examples of refactoring?

Moving a function between classes Renaming a variable Deleting an unused function

When using revision control for a Visual Studio project, the Debug folder should be tracked.

No, the Debug folder in a Visual Studio project should not be tracked in revision control. This folder contains compiled binaries, intermediate files, and other artifacts that are specific to one particular build configuration and are generated when you build your project.

The Flyweight pattern is useful for __________.

Optimizing memory usage and improving the efficiency of a system by sharing common and reusable objects, especially when numerous similar objects need to be created.

Which git command can you use to undo any changes made sense in your last commit?

Revert

Moving or copying code from one place to another.

Abstraction

A translation unit contains pre-processor statements such as #include and #define.

Actually, a translation unit does not contain pre-processor directives like #include and #define in their original form. A translation unit in C++ is the result of processing a C++ source file and all the included headers and source files it refers to, after all pre-processor directives have been executed.

Which git command is used to change to a different branch?

Checkout

Which git command is used to create a new copy of a git repository on your computer?

Clone

Which git command is used to save your changes to your local repository?

Commit

The Factory Method Pattern is a _____ pattern.

Creational

Record

Data structure that stores subitems, often called fields, with a name associated with each subitem.

True or False: When creating a new git branch, the default behavior is to switch to the new branch automatically.

False, must check out first

When using revision control for a Visual Studio project, the Debug folder should be tracked.

False. In a Visual Studio project (or any project using Git or another version control system), it's generally not recommended to track the "Debug" folder. The "Debug" folder typically contains build artifacts, temporary files, and compiled binaries that are generated during the development and debugging process. These files are not meant to be part of the version control repository.

True or False: A Rebase is a type of Merge.

False. Rebase takes the changes from one branch and reapplies them on top of another branch. It essentially replays the commits from the source branch onto the target branch, creating a linear branch history. This can make the branch history cleaner, but may also require resolving conflicts as each commit is applied.

Select all statements applicable to forward declarations:

Forward declarations may reduce compile time of an individual translation unit. Forward declarations can hide dependencies. Forward declarations help break circular dependencies.

What is a polymorphic function?

Imagine you have a box of building blocks, and you want to build different things with those blocks. A polymorphic function is like a magic tool that can be used to build many different things with those blocks, like houses, cars, or animals. When you use this magic tool, it knows what kind of thing you want to build and uses the blocks in the right way to create it. So, if you want to build a house, the tool knows how to stack the blocks like bricks to make walls and a roof. If you want to build a car, it knows how to arrange the blocks to make wheels and a body. The cool part is that you don't need a different tool for each thing you want to build; the same magic tool can work for everything. In object-oriented programming, polymorphism allows you to call a method on an object and have it execute the appropriate implementation for that object's specific class, even if you're using a reference or pointer to the parent class. This is achieved by using the "virtual" keyword in languages like C++. It enables dynamic binding of functions based on the actual type of the object, making it polymorphic.

When committing a brand-new file into one source control branch with git, that file will automatically be added to all other branches.

No, that's not correct. When you commit a brand-new file into one source control branch with Git, that file is only added to the branch you are currently working on. It will not automatically be added to all other branches. Each branch in Git represents an independent line of development. When you create or modify files in one branch, these changes are isolated to that branch until you explicitly merge them into other branches. This allows you to work on different features or fixes in parallel without affecting other branches.

When you want to have the debugger stop on a specific line of code, you would:

Set a break point

The Flyweight Pattern is a _____ pattern.

Structural

In the Observer Pattern, subjects care about the unique attributes of the concrete classes that are observing them.

The Observer Pattern is designed to establish a one-to-many dependency between objects so that when the state of the subject changes, all its observers are notified and updated automatically.

Debugging is:

The process of identifying and fixing errors, bugs, and issues in computer programs or code. It involves tracing and diagnosing problems that cause incorrect behavior, unexpected results, or crashes in software applications. Debugging techniques and tools are used to locate and correct these issues, making the program work as intended.

The pre-processor removes statements such as #include and #define from the body of code when forming a translation unit.

The statement is not entirely accurate. The pre-processor in C++ does not "remove" statements like #include and #define from the code. Instead, it processes them as follows: #include: The #include directive is used to include the contents of a file into the current file. The pre-processor replaces the #include directive with the contents of the specified file. This is often used to include header files containing function declarations, macros, constants, etc. #define: The #define directive is used to define macros. The pre-processor replaces occurrences of these macros throughout the code with their corresponding values or expressions defined in the #define statement. It doesn't remove the #define statement; instead, it uses it as a directive to make textual replacements in the code. After the pre-processor has processed these directives, the resulting code (known as the translation unit) is then compiled. The original #include and #define statements are not in the translation unit, as they were directives for the pre-processor, not actual code to be compiled.

What is one reason a program might work in debug mode but crash in release mode?

Too much dynamic memory.

A Singleton is basically a single globally accessible class instance.

True

True or False: A Fetch is like a Pull but without a Merge.

True, When you run a Fetch, Git fetches the changes from the remote repository and updates your local references (like remote-tracking branches) to reflect the state of the remote branch. However, it does not automatically merge these changes into your current branch.

True or False: You can double-click a line in the Call Stack to go directly to that code.

True. In many debugging environments, you can double-click a line in the Call Stack window to go directly to the code where that function or method was called.

True or False: When merging, you need to switch to the branch you want to merge into

True. When merging changes from one branch into another in Git, you typically need to switch to the branch you want to merge into before performing the merge.

Is calling a function virtual is not the only way to achieve function overriding in C++?

Virtual Function in Base Class: The function in the base class must be declared virtual. This tells the compiler that the function is intended to be overridden in derived classes. Override Specifier in Derived Class: In the derived class, the override specifier is used when defining the function. This ensures that the function is overriding a virtual function from the base class. If it's not correctly overriding, the compiler will generate an error.

Which debugging window allows you to add variables/expressions to keep track of?

Watch window

Which git command is used to update the remote repository (for example on GitHub) with the changes in your local repository?

When you run git push, it sends the committed changes from your local repository to the remote repository, keeping them in sync. This command is commonly used to share your local changes with others and update the remote repository with your latest commits.

#pragma once directive, although non-standard, is supported by most compilers.

Yes, that's correct. The #pragma once directive is a non-standard preprocessor directive used to prevent multiple inclusions of the same file within a single compilation. Despite not being part of the C++ standard, it is widely supported by most modern compilers, including GCC, Clang, and Microsoft Visual C++.

Which debug window can you use to see the values of variables in the current scope?

You can use the "Locals window" in a debugging environment to see the values of variables in the current scope. The Locals window typically displays information about variables that are local to the current function or block of code being executed during debugging, allowing you to inspect their values.

Arrays

data structure that stores an ordered list of items, where each item is directly accessible by a positional index.

What is the term for a version of a repository that is not on your computer (for example, the version of your repository that is on GitHub)?

remote repository


Related study sets

THINKING SKILLS FOR TROUBLESHOOTING

View Set

Intro to Anesthesia(and Patient Prep)

View Set

Personal Finance Notes Unit 2: Chapter 5

View Set

MN Real Estate Salesperson Course I Final

View Set