100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

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

Rating
-
Sold
-
Pages
33
Grade
A+
Uploaded on
27-04-2024
Written in
2023/2024

Solutions to assignment 01 of the year 2024 of COS1511












Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
April 27, 2024
Number of pages
33
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

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

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
JayJo University of South Africa (Unisa)
View profile
Follow You need to be logged in order to follow users or courses
Sold
51
Member since
4 year
Number of followers
46
Documents
24
Last sold
1 month ago

4,0

4 reviews

5
3
4
0
3
0
2
0
1
1

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions