100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CSC exam practice questions fully solved &updated $14.49   Add to cart

Exam (elaborations)

CSC exam practice questions fully solved &updated

 0 view  0 purchase
  • Course
  • Csc
  • Institution
  • Csc

CSC exam practice questions fully solved &updated

Preview 3 out of 20  pages

  • November 5, 2024
  • 20
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • Csc
  • Csc
avatar-seller
BRAINBOOSTERS
CSC exam practice questions
fully solved &updated
The code
int funct(char, char);
is:


1. A function prototype
2. A function definition
3. A function call
4. None of the above - answer A function prototype


What is the return type of the following prototype:
int func(char x, double t);


1. char
2. int
3. double
4. func
5. void
6. char and double - answer int


Which of the following is a valid function call in C++ (assuming a
function called 'funct' exists):


1. funct;
2. funct x, y;

,3. funct();
4. int funct(); - answer funct();


Given the function prototype:
int funct(char x, double y, bool z);
which of the following would be the MOST correct call:


1. int funct(char x, double y, bool z);
2. funct(char x, double y, bool z);
3. funct('a', 2.5, true);
4. funct 'a', 2.5, true;
5. int answer = funct('a', 2.5, true); - answer int answer = funct('a',
2.5, true);


The function prototype
int foo (int y, int x = 4);
means:


1. The parameter y is passed by value.
2. The parameter x has a default value of 4.
3. The function foo returns an int value.
4. All of the above. - answer All of the above.


When two functions with the same name are defined in the same
scope, the function is:


1. static
2. inline
3. overridden

, 4. overloaded - answer overloaded


Overloaded functions must have:


1. different return types
2. different executable statements
3. different types and/or number of arguments
4. all of these - answer different types and/or number of arguments


Given the following code, what would the output be:
#include <iostream>using namespace std;
void func_one();void func_two();void func_three();
int x = 1;
int main() {int x = 2;func_one();cout << x << " ";func_two();
return 0;}
void func_one() {int x = 3;cout << x << " ";func_three();}
void func_two() {cout << x << " ";func_three();}
void func_three() {cout << x << " ";}


1. 3 1 2 1 1
2. 3 3 2 2 2
3. 3 2 2 2 2 - answer 31211


Consider the following statements and assume the standard
iostream library has been included:
void doub(int x) { x = x * 2; }void trip(int & x) { x = x * 3; }
int main () {
int x = 1;

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

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!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

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.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller BRAINBOOSTERS. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $14.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

83637 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$14.49
  • (0)
  Add to cart