Package deal
Cmsc 216(A+ Guaranteed answers)
CMSC 216 Exam 3 Concepts(Complete answers) CMSC216 UMD Herman Final(100% Everfree Answers) CMSC 216 Lecture 1 & 2(Complete solutions)
[Show more]CMSC 216 Exam 3 Concepts(Complete answers) CMSC216 UMD Herman Final(100% Everfree Answers) CMSC 216 Lecture 1 & 2(Complete solutions)
[Show more]What are 3 roles of an operating system? correct answers 1. Protect the computer from misuse 
2. Provide an abstraction for using the hardware 
so that programs can be written for a variety 
of different hardware 
3. Manage the resources to allow for reasonable 
use by all users and programs on a...
Preview 3 out of 21 pages
Add to cartWhat are 3 roles of an operating system? correct answers 1. Protect the computer from misuse 
2. Provide an abstraction for using the hardware 
so that programs can be written for a variety 
of different hardware 
3. Manage the resources to allow for reasonable 
use by all users and programs on a...
format specifier for char correct answers %c 
 
format specifier for int correct answers %d 
 
format specifier for real correct answers %f 
 
What is object code? correct answers its machine code, but it is not executable! 
 
When is feof(stdin) true! correct answers when you've read to the end of...
Preview 1 out of 4 pages
Add to cartformat specifier for char correct answers %c 
 
format specifier for int correct answers %d 
 
format specifier for real correct answers %f 
 
What is object code? correct answers its machine code, but it is not executable! 
 
When is feof(stdin) true! correct answers when you've read to the end of...
Posix Thread correct answers Pthread 
to compile: 
gcc -lpthread 
 
Threads share correct answers Heap memory 
Global / static memory 
shared libraries 
virtual address space 
 
Threads have their own correct answers thread id 
-stack 
-stack pointer 
-frame pointer program counter 
-values of other...
Preview 1 out of 4 pages
Add to cartPosix Thread correct answers Pthread 
to compile: 
gcc -lpthread 
 
Threads share correct answers Heap memory 
Global / static memory 
shared libraries 
virtual address space 
 
Threads have their own correct answers thread id 
-stack 
-stack pointer 
-frame pointer program counter 
-values of other...
Compiling a C Program correct answers C programs must be compiled to be executed 
• Use the gcc program to build your programs 
 
-g enables debugging 
-Wall warns about common things that may be problems 
-o filename places executable in filename 
-c only compiles to object file, don't link 
 
C...
Preview 2 out of 15 pages
Add to cartCompiling a C Program correct answers C programs must be compiled to be executed 
• Use the gcc program to build your programs 
 
-g enables debugging 
-Wall warns about common things that may be problems 
-o filename places executable in filename 
-c only compiles to object file, don't link 
 
C...
30000 is of type ___, but 30000L is of type ____ 
2.5 is of type _____, but 2.5f is of type _____ correct answers int, long 
double, float 
 
Two different types of scope correct answers Block scope- Variable declared inside a block is visible only within the block 
 
File scope- An identifier decla...
Preview 2 out of 9 pages
Add to cart30000 is of type ___, but 30000L is of type ____ 
2.5 is of type _____, but 2.5f is of type _____ correct answers int, long 
double, float 
 
Two different types of scope correct answers Block scope- Variable declared inside a block is visible only within the block 
 
File scope- An identifier decla...
T/F array subscripting is equivalent to pointer arithmetic and vice versa correct answers true 
 
T/F In the scope where the array is declared, the compiler knows how big the array is but when you pass an array to a func, all it sees is a pointer to the first element so it does not know size correct...
Preview 3 out of 18 pages
Add to cartT/F array subscripting is equivalent to pointer arithmetic and vice versa correct answers true 
 
T/F In the scope where the array is declared, the compiler knows how big the array is but when you pass an array to a func, all it sees is a pointer to the first element so it does not know size correct...
The typedef keyword correct answers • You can give types new names 
• typedef existing-type new-name; 
 
typedef double Dollars; 
Dollars x, y = 1.25; 
 
x and y are double 
 
int *a, b -> only a is a pointer variable 
 
Structures Declarations correct answers - Like arrays, hold multiple ite...
Preview 2 out of 5 pages
Add to cartThe typedef keyword correct answers • You can give types new names 
• typedef existing-type new-name; 
 
typedef double Dollars; 
Dollars x, y = 1.25; 
 
x and y are double 
 
int *a, b -> only a is a pointer variable 
 
Structures Declarations correct answers - Like arrays, hold multiple ite...
Memory Hierarchy correct answers Smaller / faster / costlier at top 
Larger / slower / cheaper at bottom 
Lvl0. CPU Registers 
Lvl1. On chip l1 cache 
Lvl2. Off chip l2 cache 
Lvl3. Main memory 
Lvl4. Local secondary storage 
Lvl5. Remote secondary storage 
 
Operating System correct answers -Manag...
Preview 1 out of 2 pages
Add to cartMemory Hierarchy correct answers Smaller / faster / costlier at top 
Larger / slower / cheaper at bottom 
Lvl0. CPU Registers 
Lvl1. On chip l1 cache 
Lvl2. Off chip l2 cache 
Lvl3. Main memory 
Lvl4. Local secondary storage 
Lvl5. Remote secondary storage 
 
Operating System correct answers -Manag...
String Literals correct answers Constant, defined with double quotes 
 
Can you pass in String literals into string functions correct answers Yes, if you don't need to modify the parameter 
 
Can you compare two arrays directly correct answers No, as it compares the memory addresses of them 
 
Link...
Preview 3 out of 17 pages
Add to cartString Literals correct answers Constant, defined with double quotes 
 
Can you pass in String literals into string functions correct answers Yes, if you don't need to modify the parameter 
 
Can you compare two arrays directly correct answers No, as it compares the memory addresses of them 
 
Link...
Where does memory for a program's heap come from? correct answers - the memory allocation functions make calls to the OS 
- get big chunks of memory and hand out small regions when allocation requests occur 
 
Heap Manager Requirements correct answers - must be able to handle arbitrary sequences of...
Preview 2 out of 10 pages
Add to cartWhere does memory for a program's heap come from? correct answers - the memory allocation functions make calls to the OS 
- get big chunks of memory and hand out small regions when allocation requests occur 
 
Heap Manager Requirements correct answers - must be able to handle arbitrary sequences of...
Assembly language concepts correct answers • Registers 
- Fast-access locations that the CPU uses, rather than storing all variables in memory 
- In the code we'll be examining, these are named by three-letter codes, and begin with % 
%eax, %ebx 
- Y86 has 8 registers (shown in next slide) 
 
•...
Preview 2 out of 5 pages
Add to cartAssembly language concepts correct answers • Registers 
- Fast-access locations that the CPU uses, rather than storing all variables in memory 
- In the code we'll be examining, these are named by three-letter codes, and begin with % 
%eax, %ebx 
- Y86 has 8 registers (shown in next slide) 
 
•...
What is the difference between a pointer and a pointer variable? correct answers A pointer is a memory address/reference 
 
A pointer variable is a variable whose value is an address 
 
What is a NULL pointer? correct answers • This is a pointer that points to the address 0, where nothing is allow...
Preview 2 out of 5 pages
Add to cartWhat is the difference between a pointer and a pointer variable? correct answers A pointer is a memory address/reference 
 
A pointer variable is a variable whose value is an address 
 
What is a NULL pointer? correct answers • This is a pointer that points to the address 0, where nothing is allow...
What is a prototype? correct answers All identifiers in C need to be declared before they are used. This is true for functions as well as variables. 
 
For functions the declaration needs to be before the first call of the function. 
 
A full declaration includes the return type and the number and...
Preview 1 out of 4 pages
Add to cartWhat is a prototype? correct answers All identifiers in C need to be declared before they are used. This is true for functions as well as variables. 
 
For functions the declaration needs to be before the first call of the function. 
 
A full declaration includes the return type and the number and...
What is the difference between Big Endian and Little Endian? Suppose we have the value 0x. How would the value be represented using Big/Little Endian? correct answers Big Endian: 
 
Little Endian: (reverse of Big Endian) 
 
What is the purpose of the .align directive? correct answers The .align di...
Preview 1 out of 2 pages
Add to cartWhat is the difference between Big Endian and Little Endian? Suppose we have the value 0x. How would the value be represented using Big/Little Endian? correct answers Big Endian: 
 
Little Endian: (reverse of Big Endian) 
 
What is the purpose of the .align directive? correct answers The .align di...
x = y; x & y are scalar correct answers types can be different, larger, or smaller than each other 
 
x = y; x & y are arrays correct answers not allowed 
 
x = y; x & y are structs correct answers allowed, as long as they are of the same structure type 
 
NDEBUG correct answers if it's defined whe...
Preview 1 out of 3 pages
Add to cartx = y; x & y are scalar correct answers types can be different, larger, or smaller than each other 
 
x = y; x & y are arrays correct answers not allowed 
 
x = y; x & y are structs correct answers allowed, as long as they are of the same structure type 
 
NDEBUG correct answers if it's defined whe...
If the value of dollars is 5.0, the following statement will output 5.00: 
 
cout << fixed << showpoint << setprecision(4) << dollars << endl; correct answers False 
 
A structure has member variables, like an object, but are usually public and accessed directly w/ the ...
Preview 1 out of 1 pages
Add to cartIf the value of dollars is 5.0, the following statement will output 5.00: 
 
cout << fixed << showpoint << setprecision(4) << dollars << endl; correct answers False 
 
A structure has member variables, like an object, but are usually public and accessed directly w/ the ...
What's machine language? correct answers Sequential execution of instructions 
 
Assembly language vs machine language correct answers Assembly language is low level programming that requires assembler to translate it into binary (machine code) 
 
Machine code is executed binaries by computer 
 
Wh...
Preview 1 out of 1 pages
Add to cartWhat's machine language? correct answers Sequential execution of instructions 
 
Assembly language vs machine language correct answers Assembly language is low level programming that requires assembler to translate it into binary (machine code) 
 
Machine code is executed binaries by computer 
 
Wh...
Inheritance correct answers The concept in OOP that allows classes to gain methods and data by extending other classes' fields and methods 
 
UML correct answers A standardized language for modeling systems and structures in programming 
 
super correct answers A keyword that allows subclasses to a...
Preview 1 out of 2 pages
Add to cartInheritance correct answers The concept in OOP that allows classes to gain methods and data by extending other classes' fields and methods 
 
UML correct answers A standardized language for modeling systems and structures in programming 
 
super correct answers A keyword that allows subclasses to a...
strstr(const char *haystack, const char *needle) correct answers Finds the first occurrence of needle in haystack 
 
strrchr(const char *str, int c) correct answers Searches for the last occurrence of character c in string str 
 
strchr(const char *str, int c) correct answers Searches for the first ...
Preview 1 out of 1 pages
Add to cartstrstr(const char *haystack, const char *needle) correct answers Finds the first occurrence of needle in haystack 
 
strrchr(const char *str, int c) correct answers Searches for the last occurrence of character c in string str 
 
strchr(const char *str, int c) correct answers Searches for the first ...
Encapsulation correct answers A programming philosophy that promotes protecting data and hiding implementation in order to preserve the intergrity of data and methods 
 
Validation correct answers An activity that ensures that an end product meets user's true needs and expectations are met 
 
Inher...
Preview 1 out of 4 pages
Add to cartEncapsulation correct answers A programming philosophy that promotes protecting data and hiding implementation in order to preserve the intergrity of data and methods 
 
Validation correct answers An activity that ensures that an end product meets user's true needs and expectations are met 
 
Inher...
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Stuvia is a marketplace, so you are not buying this document from us, but from seller sh3rrymagdah. Stuvia facilitates payment to the seller.
No, you only buy these notes for $20.49. You're not tied to anything after your purchase.
4.6 stars on Google & Trustpilot (+1000 reviews)
75323 documents were sold in the last 30 days
Founded in 2010, the go-to place to buy study notes for 14 years now