Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4,6 TrustPilot
logo-home
Exam (elaborations)

COS1511 OCTOBER 2021 EXAM SOLUTIONS

Rating
-
Sold
1
Pages
5
Grade
A+
Uploaded on
17-10-2024
Written in
2024/2025

Contact me on 0.7.1.0.7.3.8.0.0.5 for exam assistance. This document contains well written and emphasized solutions for the COS1511 OCTOBER 2021 written exam Free download

Content preview

COS1511
OCT/NOV 2021
SOLUTIONS
QUESTION 1
1.1: newval = 2
1.2: a = 13
1.3: Output: 23

, QUESTION 2


2.1: The code calculates the sum of numbers from 0 to 5.
2.2: The code counts how many non-zero elements are in the numbers array.


---


QUESTION 3


Initial values are: a = 2, count = 0.
After the loop, a = 18, output is 18.


---


QUESTION 4


4.1: int registrants; float amountOwed;
4.2: cin >> registrants; if (registrants <= 0) cout << "Error: Invalid number of
registrants.";
4.3:
cpp
if (registrants >= 1 && registrants <= 4) amountOwed = registrants * 100;
else if (registrants <= 10) amountOwed = registrants * 80;
else amountOwed = registrants * 60;
cout << "Amount owed: " << amountOwed;




---

Document information

Uploaded on
October 17, 2024
Number of pages
5
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

R50,00
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

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.
ThinkLab University of South Africa (Unisa)
View profile
Follow You need to be logged in order to follow users or courses
Sold
171
Member since
3 year
Number of followers
118
Documents
107
Last sold
8 months ago
ThinkLab Tutorials

A group of tutors that upload notes, exam elaborations, exam packs, assignment solutions and free packs. Unlock the door to academic excellence with our top-notch document uploads! It's meticulously prepared with foolproof solutions that guarantee your success. Trust in our reliable resources and conquer any challenge that comes your way. Don't settle for anything less than perfection in your studies. Our reliable document boasts 100% correct solutions, meticulously reviewed for your success. Say goodbye to uncertainty and hello to unwavering confidence! Giving the best services as the modules we are uploading are considered. If you have any questions, you're welcome to message us directly.

Read more Read less
4,0

20 reviews

5
8
4
5
3
6
2
1
1
0

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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions