100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
COS1511 November exam 2016 R95,00
Add to cart

Exam (elaborations)

COS1511 November exam 2016

 0 purchase

This document contains answers for the November examinations

Preview 2 out of 9  pages

  • October 17, 2022
  • 9
  • 2016/2017
  • Exam (elaborations)
  • Questions & answers
All documents for this subject (83)
avatar-seller
lindelanitshikalange0
COS1511_Nov2016_MEMO TUTORIALS CAMPUS www.tutorialscampus.co.za

1.1 45
1.2 Twice
1.3 0
1.4 6
1.5 7
1.6 Name.size()
1.7 0
1.8 Classic basic primitive types may include:



Character (character, char);

Integer (integer, int, short, long, byte) with a variety of precisions;

Floating-point number (float, double, real, double precision);

Boolean, logical values true and false



1.9 SAfrica

1.10 #include <iostream>

Question 2)

2.1) To add all the even numbers in the array to sum variable, and display sum

2.2) To accept values to variable a and b, swap the values in the variables and display the
variables.

Question 3)

3.1)

if(level == 1 || level == 2)
cout<<"Basic";
else if(level == 3)
cout<<"Intermediate";
else if(level == 4)
cout<<"Advance";
else
cout<<"Not a valid level";

3.2)
A prime number is a whole number greater than 1, whose only two whole-number factors are 1
and itself. The first few prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23, and 29.

int i=2, j;


1|Page -)For more info call Nicholas on 083 33 13 124

, COS1511_Nov2016_MEMO TUTORIALS CAMPUS www.tutorialscampus.co.za

bool prime = true;
while(i < 10)
{
prime = true;
j = 2;
while(j<i)
{
if((i%j) == 0)
prime = false;
j++;
}
if(prime)
cout<<i<<endl;
i++;
}
4.1)
A named memory location used to store data of a specific datatype

4.2)
Global variable are variables which are declared outside all function and can be accessed by all
the functions within that program.

Local variable are variable which are declared within a function or block of code(e.g for_loop)
and are visible within that function or block.

4.3)
float f1;

4.4)
A function is a group of statements that together perform a task. A function declaration
tells the compiler about a function's name, return type, and parameters. A function
definition provides the actual body of the function.

4.5)Refer to Appendix D of the leaner guide, page 376
getline(istream, string &, char)
srand(int)
int rand( )
char tolower(char)

4.6)
Acutal parameters are values in a function calling statement that are passed to the function
being called.

Formal are parameter are variables in the function definition that are used to receive values for
that function.




2|Page -)For more info call Nicholas on 083 33 13 124

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 lindelanitshikalange0. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

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

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

73356 documents were sold in the last 30 days

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

Start selling
R95,00
  • (0)
Add to cart
Added