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

COS1512 Assignment 3 (COMPLETE ANSWERS) 2025 - DUE 4 August 2025; 100% TRUSTED Complete, trusted solutions and explanations Ensure your success with us..

Rating
-
Sold
-
Pages
12
Grade
A+
Uploaded on
04-08-2025
Written in
2025/2026

COS1512 Assignment 3 (COMPLETE ANSWERS) 2025 - DUE 4 August 2025; 100% TRUSTED Complete, trusted solutions and explanations Ensure your success with us..










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

Document information

Uploaded on
August 4, 2025
Number of pages
12
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

[TYPE THE COMPANY NAME]




COS1512 Assignment 3
(COMPLETE ANSWERS)
2025 - DUE 4 August
2025
NO PLAGIARISM

[Pick the date]




[Type the abstract of the document here. The abstract is typically a short summary of the contents of
the document. Type the abstract of the document here. The abstract is typically a short summary of
the contents of the document.]

, Exam (elaborations)
COS1512 Assignment 3 (COMPLETE
ANSWERS) 2025 - DUE 4 August 2025
 Course
 Introduction to Programming II (COS1512)
 Institution
 University Of South Africa (Unisa)
 Book
 Introduction to Programming

COS1512 Assignment 3 (COMPLETE ANSWERS) 2025 - DUE 4 August 2025;
100% TRUSTED Complete, trusted solutions and explanations Ensure your
success with us..



Question 1 Write a program that asks a user to enter the size of a dynamic
array that stores exam marks obtained by students. Create the dynamic
array and a loop that allows the user to enter an exam mark into each array
element. Loop through the array, find the average mark for the exam and
output it. Delete the memory allocated to your dynamic array before exiting
your program.
#include <iostream>

// This program demonstrates the use of a dynamic array in C++.
// It asks the user for the size of the array, populates it with exam
marks,
// calculates the average, and then properly deallocates the memory.

int main() {
// Variable to store the size of the dynamic array
int size;

// Prompt the user to enter the size of the array
std::cout << "Enter the number of students (size of the array): ";
std::cin >> size;

// Basic input validation to ensure a positive size
if (size <= 0) {
std::cout << "Invalid size. Please enter a positive number." <<
std::endl;
return 1; // Exit with an error code
}

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.
tabithamwendwa73 Chamberlain College Nursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
379
Member since
1 year
Number of followers
82
Documents
1032
Last sold
1 month ago
brilliant tutorials

brilliant tutorials Attention all students! Are you struggling with a particular subject or just need some extra support to help you succeed? Look no further than our expert tutorial services! Our experienced tutors provide personalized one-on-one sessions to help you overcome your academic challenges and reach your full potential. Whether you need help with any module, our tutors are here to help. With flexible scheduling and competitive pricing, there\'s no reason to struggle on your own. Invest in your academic success today and book a tutorial session with us

Read more Read less
3,6

64 reviews

5
28
4
14
3
3
2
4
1
15

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