100% tevredenheidsgarantie Direct beschikbaar na betaling Zowel online als in PDF Je zit nergens aan vast
logo-home
COS1511 EXAM PACK 2023 €2,69   In winkelwagen

Tentamen (uitwerkingen)

COS1511 EXAM PACK 2023

 97 keer bekeken  3 keer verkocht
  • Vak
  • Instelling
  • Boek

COS1511 Latest exam pack questions and answers and summarized notes for exam preparation. Updated for October November 2023 exams . For assistance Whats-App.0.6.7..1.7.1..1.7.3.9 . All the best on your exams!!

Voorbeeld 4 van de 278  pagina's

  • 1 oktober 2023
  • 278
  • 2023/2024
  • Tentamen (uitwerkingen)
  • Vragen en antwoorden
avatar-seller
COS1511
EXAM PACK




FOR ASSISTANCE WITH THIS MODULE +27 67 171 1739

, 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)

Voordelen van het kopen van samenvattingen bij Stuvia op een rij:

Verzekerd van kwaliteit door reviews

Verzekerd van kwaliteit door reviews

Stuvia-klanten hebben meer dan 700.000 samenvattingen beoordeeld. Zo weet je zeker dat je de beste documenten koopt!

Snel en makkelijk kopen

Snel en makkelijk kopen

Je betaalt supersnel en eenmalig met iDeal, creditcard of Stuvia-tegoed voor de samenvatting. Zonder lidmaatschap.

Focus op de essentie

Focus op de essentie

Samenvattingen worden geschreven voor en door anderen. Daarom zijn de samenvattingen altijd betrouwbaar en actueel. Zo kom je snel tot de kern!

Veelgestelde vragen

Wat krijg ik als ik dit document koop?

Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.

Tevredenheidsgarantie: hoe werkt dat?

Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.

Van wie koop ik deze samenvatting?

Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper iStudy. Stuvia faciliteert de betaling aan de verkoper.

Zit ik meteen vast aan een abonnement?

Nee, je koopt alleen deze samenvatting voor €2,69. Je zit daarna nergens aan vast.

Is Stuvia te vertrouwen?

4,6 sterren op Google & Trustpilot (+1000 reviews)

Afgelopen 30 dagen zijn er 76669 samenvattingen verkocht

Opgericht in 2010, al 14 jaar dé plek om samenvattingen te kopen

Start met verkopen
€2,69  3x  verkocht
  • (0)
  Kopen