Podcast
Questions and Answers
Which of the following options is a compiled programming language?
Which of the following options is a compiled programming language?
- Python
- Bash
- Fortran (correct)
- None of the above
Before a function can be called in a program, what must occur in the code?
Before a function can be called in a program, what must occur in the code?
- The function's body
- The function's definition (correct)
- The function's description
- The function's declaration
In a function definition, what does the keyword void
indicate?
In a function definition, what does the keyword void
indicate?
- The function will empty any arguments that it is called with.
- The function doesn’t return any value. (correct)
- The function’s return type is the type named void.
- The function’s return type isn’t specified.
For two functions to be considered overloaded, what characteristic must they share?
For two functions to be considered overloaded, what characteristic must they share?
Which of the following best describes the following C++ code snippet?
int main() { }
Which of the following best describes the following C++ code snippet?
int main() { }
According to the provided information, under what condition is attribution required when using external sources?
According to the provided information, under what condition is attribution required when using external sources?
Which statement regarding whitespace in a program is most accurate?
Which statement regarding whitespace in a program is most accurate?
Based on the syllabus, which of the following resources should always be cited when used as a source?
Based on the syllabus, which of the following resources should always be cited when used as a source?
Under what condition are parameter names NOT ignored by the compiler in function declarations?
Under what condition are parameter names NOT ignored by the compiler in function declarations?
According to the Preface of the required textbook, what does Stroustrup mean when he says the book isn’t a layer cake?
According to the Preface of the required textbook, what does Stroustrup mean when he says the book isn’t a layer cake?
Why was the function call print(0,0)
in Section 1.3 considered ambiguous?
Why was the function call print(0,0)
in Section 1.3 considered ambiguous?
What is the return type for a function that does not return any value?
What is the return type for a function that does not return any value?
What advice is given in Section 1.3 to reduce errors?
What advice is given in Section 1.3 to reduce errors?
Which statement best describes function overloading?
Which statement best describes function overloading?
If a student has multiple scores, which factor determines the points from exams that contribute to their point total?
If a student has multiple scores, which factor determines the points from exams that contribute to their point total?
According to the provided exam instructions, on which of the following assessments are students explicitly NOT allowed to collaborate?
According to the provided exam instructions, on which of the following assessments are students explicitly NOT allowed to collaborate?
What should a student do if they have a question during the exam?
What should a student do if they have a question during the exam?
A student wants to use external resources during the exam. Which of the following is permissible according to the exam instructions?
A student wants to use external resources during the exam. Which of the following is permissible according to the exam instructions?
How many questions must a student answer correctly to achieve a perfect score on the exam?
How many questions must a student answer correctly to achieve a perfect score on the exam?
A student is taking Version A of the exam. What is the significance of the version letter?
A student is taking Version A of the exam. What is the significance of the version letter?
According to the instructions, which of the following items must students present when returning their exam materials?
According to the instructions, which of the following items must students present when returning their exam materials?
A student brings a smart-watch to the exam. According to the instructions, what should they do with it?
A student brings a smart-watch to the exam. According to the instructions, what should they do with it?
What is meant by the statement 'the book can be read in many different ways'?
What is meant by the statement 'the book can be read in many different ways'?
Which namespace contains cout
in C++?
Which namespace contains cout
in C++?
What is the primary purpose of using the -std=c++20
command-line argument with g++
?
What is the primary purpose of using the -std=c++20
command-line argument with g++
?
In the context of this course, what is the C++ interpreter being used?
In the context of this course, what is the C++ interpreter being used?
C++ was developed as an extension of which earlier programming language?
C++ was developed as an extension of which earlier programming language?
Function declarations can also be considered what?
Function declarations can also be considered what?
What does it mean when a function is overloaded in C++?
What does it mean when a function is overloaded in C++?
What is the name given to a program that converts a source file into an executable program?
What is the name given to a program that converts a source file into an executable program?
What is the total possible point value for all exams in the course?
What is the total possible point value for all exams in the course?
Which of the following is a key difference between an interpreter and a compiler?
Which of the following is a key difference between an interpreter and a compiler?
According to the course policy, what is true regarding the use of AI tools like GitHub Copilot or ChatGPT?
According to the course policy, what is true regarding the use of AI tools like GitHub Copilot or ChatGPT?
Which of the following activities permits collaboration among students, according to the course policies?
Which of the following activities permits collaboration among students, according to the course policies?
Which of the following elements are typically present in a minimal, working C++ program?
Which of the following elements are typically present in a minimal, working C++ program?
Given the function declarations below, determine which functions are examples of overloading:
void Jump();
int Jump();
void After(double a);
void After(double);
int Nice(string);
int Nice(int);
string Bark(string);
string Bark();
Given the function declarations below, determine which functions are examples of overloading:
void Jump();
int Jump();
void After(double a);
void After(double);
int Nice(string);
int Nice(int);
string Bark(string);
string Bark();
Consider two functions:
int calculate(int a, double b);
double calculate(double a, int b);
What concept do these functions demonstrate?
Consider two functions:
int calculate(int a, double b);
double calculate(double a, int b);
What concept do these functions demonstrate?
Which task is typically handled by a compiler rather than an interpreter?
Which task is typically handled by a compiler rather than an interpreter?
When does the int
keyword define a primitive integer data type in C++?
When does the int
keyword define a primitive integer data type in C++?
If code compiles without errors but generates errors when compiled with the -std=c++20
flag in g++
, what is the most likely cause?
If code compiles without errors but generates errors when compiled with the -std=c++20
flag in g++
, what is the most likely cause?
Which of the following denotes a single-line comment in C++?
Which of the following denotes a single-line comment in C++?
A non-zero value returned by the main
function typically indicates which condition?
A non-zero value returned by the main
function typically indicates which condition?
What is the return type of the function hum
in the following C++ code snippet: int x {7}; char y = hum(x + 8.9);
?
What is the return type of the function hum
in the following C++ code snippet: int x {7}; char y = hum(x + 8.9);
?
Which of the following is NOT a standard component of a C++ program?
Which of the following is NOT a standard component of a C++ program?
Which statement accurately describes the purpose of the include
directive in C++?
Which statement accurately describes the purpose of the include
directive in C++?
Which of the following best describes the role of the main
function in a C++ program?
Which of the following best describes the role of the main
function in a C++ program?
Flashcards
Open Note Exam
Open Note Exam
Converting paper material into digital format for educational purposes.
Exam Question Format
Exam Question Format
Only one option should be chosen for each question on the exam.
Allowed Materials
Allowed Materials
Notes, slides, prior exams, assignments and books are all allowed.
Returning Exam
Returning Exam
Signup and view all the flashcards
Exam Material Placement
Exam Material Placement
Signup and view all the flashcards
Getting Help
Getting Help
Signup and view all the flashcards
Prohibited Electronics
Prohibited Electronics
Signup and view all the flashcards
Exam Start Preparation
Exam Start Preparation
Signup and view all the flashcards
Function declaration placement
Function declaration placement
Signup and view all the flashcards
-std=c++20 flag purpose
-std=c++20 flag purpose
Signup and view all the flashcards
C++ Interpreter Name
C++ Interpreter Name
Signup and view all the flashcards
Language C++ Extends
Language C++ Extends
Signup and view all the flashcards
cout's namespace
cout's namespace
Signup and view all the flashcards
Function overloading
Function overloading
Signup and view all the flashcards
What is A compiler?
What is A compiler?
Signup and view all the flashcards
What is an interpreter?
What is an interpreter?
Signup and view all the flashcards
Function call requirement?
Function call requirement?
Signup and view all the flashcards
Meaning of void
Meaning of void
Signup and view all the flashcards
int main() { }
int main() { }
Signup and view all the flashcards
What is the Return Type of a function?
What is the Return Type of a function?
Signup and view all the flashcards
Arguments and Parameters?
Arguments and Parameters?
Signup and view all the flashcards
Interpreter
Interpreter
Signup and view all the flashcards
Compiler
Compiler
Signup and view all the flashcards
Include Directives
Include Directives
Signup and view all the flashcards
Variable Declarations
Variable Declarations
Signup and view all the flashcards
Function Definitions
Function Definitions
Signup and view all the flashcards
CSE 232 AI Policy
CSE 232 AI Policy
Signup and view all the flashcards
Minimal C++ program
Minimal C++ program
Signup and view all the flashcards
Citation Requirement (Syllabus)
Citation Requirement (Syllabus)
Signup and view all the flashcards
Parameter Names in Declarations
Parameter Names in Declarations
Signup and view all the flashcards
Stroustrup's 'Layer Cake'
Stroustrup's 'Layer Cake'
Signup and view all the flashcards
Ambiguous Function Call
Ambiguous Function Call
Signup and view all the flashcards
'No Return' Type
'No Return' Type
Signup and view all the flashcards
Reducing Errors
Reducing Errors
Signup and view all the flashcards
int
int
Signup and view all the flashcards
#include
#include
Signup and view all the flashcards
main
main
Signup and view all the flashcards
C++
C++
Signup and view all the flashcards
STL
STL
Signup and view all the flashcards
Non-zero main return
Non-zero main return
Signup and view all the flashcards
// Comment
// Comment
Signup and view all the flashcards
char hum(int x)
char hum(int x)
Signup and view all the flashcards
Study Notes
- CSE 232 is an Introduction to Programming II course.
Exam Instructions
- Don't start the exam until instructed.
- Write name, student number, and exam version/form letter on the printed exam and bubble sheet using a #2 pencil before starting.
- This is Version A, so section doesn't matter.
- Show MSU ID (or photo ID) when turning in your bubble sheet and printed exam.
- Choose one option per question and mark it on both the printed exam and bubble sheet.
- Assume any needed #includes and using std::...; namespace declarations are performed for code samples.
- Each question is worth the same amount; answer only 50 questions correctly out of 55 for a perfect score.
- Electronics aren't allowed during the exam; put smart-watches, phones, and headphones in your bag.
- The exam is open note; any paper material is allowed.
- Place all materials on your desk before the exam to avoid rummaging through your bag.
- Bring the required textbook.
- Raise your hand if you have any questions during the exam, and a proctor will assist.
Exam Questions
- To calculate the total points from exams, sum the highest scores from Midterm MCQ/Makeup, Midterm Coding/Makeup, Final MCQ, and Final Coding.
- An interpreter differs from a compiler because it directly executes the code, it doesn't just interpret it.
- CSE 232's policy on AI tools like GitHub Copilot and ChatGPT states that they can be used, but you must be cautious about using them in ways that deter learning. They can be used but only with attribution
- Collaboration isn't permitted on exams.
- The minimal C++ program has no specific traits from the list, thus the answer is that it "has none of the above" traits
- Functions are overloaded when they share the same name but have different parameters (different arguments). In the provided declarations, Nice and Bark are overloaded.
- According to the syllabus, always cite peers you collaborated with if you use them as a source.
- Parameter names are not ignored by the compiler in function declarations when the function declaration is also a function definition.
- Stroustrup's analogy of the book not being a layer cake means the book can be read in many different ways.
- cout is contained in the
std
namespace. - The function call
print(0,0)
in Section 1.3 was ambiguous because(0,0)
could be interpreted as one number or two. - The return type for a function that doesn't return anything is
void
. - To reduce errors, all function declarations should be included at the start of the file.
- The
-std=c++20
command-line argument for g++ is recommended to allow for C++20 features to be used in the code. - The C++ interpreter used in the course is not listed.
- C++ was created to extend the programming language C.
- For a function to be called, its declaration must occur prior to the function call in the code.
- In
print_square
's definition withvoid
,void
means the function doesn't return any value. - If a function is overloaded, another function exists with the same name.
- A program that turns a source file into an executable program is called a compiler.
- To be overloaded, two functions must have the same name.
int main() {}
is best described as a program definition.STL
is a namespace.- If code gives errors with -std=c++20 but works without it, the code is illegal according to the C++20 standard.
/* Comment */
is a comment in C++.double other();
could be a function declaration (but isn't a function definition). Note the lack of{}
.- Whitespace matters when it is in a string literal.
- In the main function, a non-zero return value indicates failure.
- With
int x {7}; char y = hum(x + 8.9);
, the return type of the function named hum is char. - Working through sample MCQ exam questions is recommended when studying.
- The
main
function must be present in every C++ program. - Not using function overloading would eliminate ambiguous function calls.
- The following program won't compile:
int twice(int x) { return x + x; } int main() { cout << twice("3"); }
int * Xyz::Abc(Xyz const &);
is an example of a member function.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Test your knowledge of C++ fundamentals. This quiz covers compiled languages, function definitions, overloading, and the importance of source attribution. It also tests understanding of whitespace, compiler behavior, and textbook concepts.