CS1181 - Intro-To-Computer-Science - ISU - 2024 - MIDTERM - Study Guide
CS1181 - Intro-To-Computer-Science - ISU - 2024 - MIDTERM - Study Guide
Week 1
1. Discuss compile time error vs runtime error with example
2. What are the different levels (high, mid, and low) of programming languages and discuss some
differences among those?
3. What is Algorithm, discuss the approach of an algorithm that may help you organize a number
of integers in non-decreasing order
Week 2
1. Given a decimal number, show me the steps to convert it to the equivalent binary number (slide
6, 7)
2. Given a binary number, show the steps to get its decimal equivalent (slide 5)
3. Given a binary number, translate it to corresponding hexadecimal equivalent (slide 10)
4. Given a positive binary number, find the 2’s complement (slide 13)
Week 3:
1. What is function prototype and why do you need that? Explain with example(s).
2. What is function overloading, since a function can have the following parts: a function name, a
return type, argument(s), function body. What can we change or cannot change in the
overloaded function(s)?
3. Discuss with example defaults arguments in function
4. Discuss function arguments passing by value and passing by reference
5. What is inline function and what is the benefit/use of inline function
6. Review the slides explaining scope of variables (slides 40-43)
Week 4:
1. Discuss LValue and RValue with example (slide 6)
2. Discuss correctness and incorrectness of increment & decrement operations. The exam question
may come in the form that you will be given similar examples to slide 15 and ask whether the
compiler will raise an error
3. Discuss operator precedence, associativity, and evaluation order (slide 17)
4. If you pass an array as function argument, is it by passed by value or by reference? Discuss the
reasoning behind such behavior.
Idaho State University Fall, 2024 CS 1181
Week 5:
1. Given a code snippet for pointer operations as such in slide 4, show the values or states of
the memory locations
2. Discuss passing an argument by reference using pointer in C++ (slide 3)
3. What could be the values of different variables for different operations as discussed in slide
17
4. Review the code examples in slide 19, 20, 21
Week 6:
1. What is structure and why do we need structure (slide 2)?
2. What are some features of structures (slide 9 to 13)
3. Bonus problem: can you solve problem 2 without the output array, i.e., modify the
input array while maintaining the relative order of the non-zero elements and return it
as the output.
4. Given an input positive integer, compute the factorial of that number. Can you do the
computation using recursive function.
5. Compute Fibonacci series recursively.
6. Given a positive integer, write a function to check if that number is prime number.
8. Given a positive number, write a function to verify whether the number is a perfect
number.
9. Given a string, return the reverse of the string.
Idaho State University Fall, 2024 CS 1181
10. Practice and understand the Problem given in you Programming Lab 2 and 3.