100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
COS1511 EXAM PACK 2023 - DISTINCTION GUARANTEED R50,00   Add to cart

Exam (elaborations)

COS1511 EXAM PACK 2023 - DISTINCTION GUARANTEED

 56 views  4 purchases

Well-structured COS1511 EXAM PREPARATION PACK - DISTINCTION GUARANTEED. Contains recent exam questions and answers, and Summarised study notes. All you need to pass the OCTOBER NOVEMBER 2023 EXAMS

Preview 4 out of 278  pages

  • October 1, 2023
  • 278
  • 2023/2024
  • Exam (elaborations)
  • Questions & answers
book image

Book Title:

Author(s):

  • Edition:
  • ISBN:
  • Edition:
All documents for this subject (31)
avatar-seller
dochub
COS1511
EXAM PACK
 Recent exam questions and answers
 Summarised study notes
 Exam tips and guidelines


DISCLAIMER & TERMS OF USE
1. Educational Aid: These study notes are designed to serve as educational aids and should not be considered as a
substitute for individual research, critical thinking, or professional guidance. Students are encouraged to
conduct their own extensive research and consult with their instructors or academic advisors for specific
assignment requirements.
2. Personal Responsibility: While every effort has been made to ensure the accuracy and reliability of the
information provided in these study notes, the seller cannot guarantee the completeness or correctness of all
the content. It is the responsibility of the buyer to verify the accuracy of the information and use their own
judgment when applying it to their assignments.
3. Academic Integrity: It is crucial for students to uphold academic integrity and adhere to their institution's
policies and guidelines regarding plagiarism, citation, and referencing. These study notes should be used as a
tool for learning and inspiration, but any direct reproduction of the content without proper acknowledgment and
citation may constitute academic misconduct.
4. Limited Liability: The seller of these study notes shall not be held liable for any direct or indirect damages,
losses, or consequences arising from the use of the notes. This includes, but is not limited to, poor grades,
academic penalties, or any other negative outcomes resulting from the application or misuse of the information
provided.

, Jan/Feb 2023



70 Marks




This paper consists of 8 pages out of 70 marks


INSTRUCTIONS:

1. Answer all the questions on a Word document/by hand and convert to PDF.
2. Number your answers and label your rough work clearly.
4. Marks are awarded for part of an answer, so do whatever you are able to in each question.




ALL THE BEST




[TURN OVER]

,2

Choose the correct option and write only the number

Question 1 [20]
1.What is the output of the following code fragment? (2)

int x = 0;
while( x < 8)
cout << x << " ";
x ++;
cout << x << endl;

1. 0
2. infinite loop
3. 1 2 3 4 5 6 7 8
4. 0 1 2 3 4 5 6 7 8

2.What is the value of x after the following statements? (2)

int x, y, z; y = 10;
z = 3;
x = y * z - 3;

1. 0
2. 3
3. 10
4. 27

3.What is the value of x after the following statements? (2)

int x;
x = x + 15;

1. 0
2. 14
3. 15
4. not defined

4.What is the output of the following code? (2)

cout << "Where is the \\" << endl;

1. Where is the \
2.Where is the
3.Nothing, it is a syntax error
4.Where is the \ endl

5.What is the value of xafter the following statements? (2)

int x;
x = 19 % 5;

1. 4.0
2. 4
3. 3.8
4. 8

6.Given the following code fragment and the input value of 5, what output is generated? (2)
[TURN OVER]
float tax; float total;

cout << "Enter the cost of the item\n"; cin >> total;

, 3

if ( total >= 5.0)
{
tax = 0.14;
cout << total + (total * tax) << endl;
}
else
{
cout << total << endl;
}
1. 5
2. 5.7
3. 11
4. 11.4


7.Given the following code fragment and the input value of 3.0, what output is generated? (2)

float tax; float total;
cout << "Enter the cost of the item\n"; cin >> total;
if (total > 3.0)
{


}
else
{

}


tax = 0.10;
cout << total + (total * tax) << endl;

1. 3.0
2. 2.0
3. 3.3
4. 2.3

8.If x has the value of 3, y has the value of -2, and w is 10, is the following condition true or false? (2)

if( x < 2 && w < y)

1. true && true
true

2. false && false
false

3. false && false
true

4. true && false
false


9.Given the following code fragment, and an input value of 8, what is the output that is generated? (2)

int x;
[TURN OVER]
cout << "Enter a value\n"; cin >>
x;
if (x = 0)

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 EFT, 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 this summary from?

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

Will I be stuck with a subscription?

No, you only buy this summary for R50,00. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

67474 documents were sold in the last 30 days

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

Start selling
R50,00  4x  sold
  • (0)
  Buy now