Podcast
Questions and Answers
What is a consequence of using an electronic device during the exam?
What is a consequence of using an electronic device during the exam?
What items are permitted to be brought into the exam room?
What items are permitted to be brought into the exam room?
What should you do if your handwriting is deemed illegible?
What should you do if your handwriting is deemed illegible?
Which statement is true regarding academic integrity during the exam?
Which statement is true regarding academic integrity during the exam?
Signup and view all the answers
Which of the following is required at the top of every exam page?
Which of the following is required at the top of every exam page?
Signup and view all the answers
What happens if you submit answers outside of the designated box?
What happens if you submit answers outside of the designated box?
Signup and view all the answers
How does the exam instruct you to handle academic dishonesty?
How does the exam instruct you to handle academic dishonesty?
Signup and view all the answers
What coding style considerations are emphasized during the exam?
What coding style considerations are emphasized during the exam?
Signup and view all the answers
What is the return type of the deposit method in the AccountManager class?
What is the return type of the deposit method in the AccountManager class?
Signup and view all the answers
What should the deposit method do if an invalid account type is passed?
What should the deposit method do if an invalid account type is passed?
Signup and view all the answers
What happens if the deposit amount would cause the loan balance to become negative?
What happens if the deposit amount would cause the loan balance to become negative?
Signup and view all the answers
Which prompt is used first to collect information from the user?
Which prompt is used first to collect information from the user?
Signup and view all the answers
How does the program respond if the user enters a negative number for the posts to view?
How does the program respond if the user enters a negative number for the posts to view?
Signup and view all the answers
What should the validateUsername method do?
What should the validateUsername method do?
Signup and view all the answers
What type of error is indicated by the ERROR_MESSAGE in the menu?
What type of error is indicated by the ERROR_MESSAGE in the menu?
Signup and view all the answers
What will happen if the user input for number of posts is not an integer?
What will happen if the user input for number of posts is not an integer?
Signup and view all the answers
What type of post is displayed if the returned value from checkPostBrowsed() is divisible by both 3 and 5?
What type of post is displayed if the returned value from checkPostBrowsed() is divisible by both 3 and 5?
Signup and view all the answers
What is the output when calling primeFactorization(12)?
What is the output when calling primeFactorization(12)?
Signup and view all the answers
Which of the following correctly identifies a condition under which to use a do-while loop?
Which of the following correctly identifies a condition under which to use a do-while loop?
Signup and view all the answers
What would the correct printf statement be to print 'This course is fun 3.1 - 24' using the given variables?
What would the correct printf statement be to print 'This course is fun 3.1 - 24' using the given variables?
Signup and view all the answers
What is the prime factorization of the integer 28?
What is the prime factorization of the integer 28?
Signup and view all the answers
In the for loop iterating from i = 0 to x using Fibonacci increments, which of the following is a correct starting point for Fibonacci sequence values?
In the for loop iterating from i = 0 to x using Fibonacci increments, which of the following is a correct starting point for Fibonacci sequence values?
Signup and view all the answers
Which statement is true about the maximum size of any signed binary value of length n?
Which statement is true about the maximum size of any signed binary value of length n?
Signup and view all the answers
To declare a string format as 'x hyphen y', which of the following initializations is correct?
To declare a string format as 'x hyphen y', which of the following initializations is correct?
Signup and view all the answers
For which of the following integers is 22 represented in binary using Two's Complement Representation?
For which of the following integers is 22 represented in binary using Two's Complement Representation?
Signup and view all the answers
What number is produced by the sum of factorials of the digits of 145?
What number is produced by the sum of factorials of the digits of 145?
Signup and view all the answers
How can the statement 'Coding is easy.' be printed using the substring method with sOne and sTwo?
How can the statement 'Coding is easy.' be printed using the substring method with sOne and sTwo?
Signup and view all the answers
Which option incorrectly describes the condition for displaying FRIEND_POST?
Which option incorrectly describes the condition for displaying FRIEND_POST?
Signup and view all the answers
What is the correct declaration for a boolean variable isEven that checks the parity of myVar?
What is the correct declaration for a boolean variable isEven that checks the parity of myVar?
Signup and view all the answers
Which of the following statements correctly initializes myVal as the sum of x and y where both are doubles?
Which of the following statements correctly initializes myVal as the sum of x and y where both are doubles?
Signup and view all the answers
What is the correct condition for the while loop declaration checking if scan contains an integer?
What is the correct condition for the while loop declaration checking if scan contains an integer?
Signup and view all the answers
What detail must be included in the constructor for AccountManager to set boolean values based on the type string?
What detail must be included in the constructor for AccountManager to set boolean values based on the type string?
Signup and view all the answers
Study Notes
Exam Instructions
- Total of 75 points; includes fill in the blank, short answer, multiple choice, and coding questions.
- Submissions should follow academic integrity guidelines; no unauthorized help or resources.
- Bring only writing utensil and eraser; no notes or electronic devices allowed.
- All answers must be written in designated boxes; illegible handwriting will receive a zero.
Code Tasks Overview
- Use given variable types and initializations to write concise code.
- Code tasks include printing formatted strings, using loops, declaring booleans, and initializing integers.
- Tasks also require constructing classes and methods for banking-related functionalities, including deposit methods and prime factorization.
Important Code Concepts
- Printf Formatting: Use printf for formatted output; helpful for displaying numbers and strings.
- Looping: Understand how to implement looping structures, such as for loops that utilize Fibonacci sequences.
- String Manipulation: Utilize substring methods for extracting parts of strings.
- Boolean Logic: Use boolean flags to determine the state of variables, especially in context of account management.
- Class Design: Be familiar with creating constructors and methods within classes, especially managing multiple types of accounts.
Class AccountManager
- Constructor Requirement: Must take username and account type to determine account status.
- Boolean Variables: Must be set based on whether accounts (checking, savings, loan) are active according to specified types.
- Deposits: Implement deposits with conditions based on account type and balance checks.
Infinite Menu Implementation
- Input Handling: Continuously prompt for username and number of posts, validating entries.
- Ensure to provide feedback for invalid entries and use predefined messages for user interaction.
- Posts are displayed based on returned values categorized by their division properties.
Mathematical Operations
- Factorial and prime factorization must return string representations formatted correctly with specific separators.
- Solve specific computational problems, such as identifying numbers that equal the sum of the factorials of their digits.
Miscellaneous Knowledge
- Understand binary representations, signed values, and their maximum and minimum size calculated by binary length.
- Recognize specific cases favoring the use of do-while loops in programming.
- Convert integers to binary in two's complement representation as part of exam tasks.
Final Notes
- Prepare to answer both theoretical questions around code behavior and practical coding challenges.
- Familiarize yourself with best practices for writing clean, functional code within the time constraints of the exam.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Prepare yourself for the Fall 2024 CS 18000 midterm exam with this comprehensive practice quiz. It includes various question types such as fill in the blank, short answer, multiple choice, and coding questions. This practice exam is designed to help you review key concepts and perform well.