100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Exam (elaborations) Introduction to Programming (COS1511) Introduction to Programming R99,33   Add to cart

Exam (elaborations)

Exam (elaborations) Introduction to Programming (COS1511) Introduction to Programming

 9 views  0 purchase

Solutions to assignment 01 of the year 2024 of COS1511

Preview 4 out of 33  pages

  • April 27, 2024
  • 33
  • 2023/2024
  • Exam (elaborations)
  • Questions & answers
book image

Book Title:

Author(s):

  • Edition:
  • ISBN:
  • Edition:
All documents for this subject (2)
avatar-seller
JayJo
27/04/2024, 21:05 Assessment 4 Replacing AssNo 1: Attempt review




S1511 Module Site  Assessment 4 Replacing AssNo 1

QUIZ




Started on Monday, 1 April 2024,
3:27 PM
State Finished
Completed on Saturday, 27 April
2024, 9:03 PM
Time taken 26 days 5 hours
Marks 49.00/56.00
Grade 87.50 out of 100.00


Question 1

Correct

Mark 1.00 out of 1.00




Which of the following is a valid variable
name?


a. 3com

b. three_com 

c. 3_com

d. ampersand&




Your answer is correct.
The correct answer is:
three_com




Question 2
Correct

Mark 1.00 out of 1.00




Which of the following statements is
NOT legal?


a. char ch = 'b';

b. char ch = '0';

c. char ch = 65;

d. char ch = "cc"; 




Your answer is correct.

The correct answer is:
char ch = "cc";


https://mymodules.dtls.unisa.ac.za/mod/quiz/review.php?attempt=16709304&cmid=959160 1/33

,27/04/2024, 21:05 Assessment 4 Replacing AssNo 1: Attempt review

Question 3

Correct

Mark 1.00 out of 1.00




What is the value of x after the following
statements?
float x;
x = 15/4;


a. 3.75

b. 4.0

c. 3.0 

d. 60




Your answer is correct.
The correct answer is:
3.0




Question 4
Correct

Mark 1.00 out of 1.00




What is the value of x after the following
statements?
int x;
x = 15/4;


a. 15

b. 3 

c. 4

d. 3.75




Your answer is correct.

The correct answer is:
3




https://mymodules.dtls.unisa.ac.za/mod/quiz/review.php?attempt=16709304&cmid=959160 2/33

,27/04/2024, 21:05 Assessment 4 Replacing AssNo 1: Attempt review

Question 5

Correct

Mark 1.00 out of 1.00




What is the value of x after the following
statements?
int x;
x = 15 % 4;


a. 15

b. 4

c. 3 

d. 3.75




Your answer is correct.
The correct answer is:
3




Question 6
Correct

Mark 1.00 out of 1.00




What is the value of x after the following
statement?
float x;
x = 3..0 + 3 + ;


a. 5.75

b. 5,75

c. 1.75

d. 3.75 




Your answer is correct.

The correct answer is:
3.75




https://mymodules.dtls.unisa.ac.za/mod/quiz/review.php?attempt=16709304&cmid=959160 3/33

, 27/04/2024, 21:05 Assessment 4 Replacing AssNo 1: Attempt review

Question 7

Incorrect

Mark 0.00 out of 1.00




Which C++ statements correctly declare
a variable called age, and prompt a user
for his/her age.


a. int age = 0;
cout >> "Please enter your age: ;
cin << age;

b. int age = 0;
cout << "Please enter your age: ";
cin >> ages;

c. int age = 0;
cout << "Please enter your age: ";
cin >> age;

d. int ages = 0; 
cout << "Please enter your
age: ";
cin >> age;




Your answer is incorrect.

The correct answer is:
int age = 0;
cout << "Please enter your age: ";
cin >> age;




Question 8

Correct

Mark 1.00 out of 1.00




Which C++ statement is the equivalent of
the following statement using a single
arithmetic assignment operator?
sum = sum + 47;


a. sum += 47; 

b. sum == 47;

c. sum +47;

d. sum += sum;




Your answer is correct.

The correct answer is:
sum += 47;




https://mymodules.dtls.unisa.ac.za/mod/quiz/review.php?attempt=16709304&cmid=959160 4/33

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

Will I be stuck with a subscription?

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

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

77016 documents were sold in the last 30 days

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

Start selling
R99,33
  • (0)
  Buy now