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

Rating
-
Sold
-
Pages
6
Grade
A+
Uploaded on
07-08-2025
Written in
2025/2026

100% TRUSTED WORKINGS, EXPLANATIONS & SOLUTIONS










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

Document information

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

Subjects

Content preview

COS1512 Assignment
3 (COMPLETE
ANSWERS) 2025 - DUE
4 August 2025
FOR MORE ASSISTANCE CONTACT:




100% TRUSTED WORKINGS, EXPLANATIONS & SOLUTIONS

, COS1512 Assignment 3 (COMPLETE
ANSWERS) 2025 - DUE 4 August 2025
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.
Here's a simple C++ program that meets the requirements of your question:
✅ Program: Dynamic Array for Exam Marks and Average Calculation cpp Copy
Edit #include using namespace std;
int main() { int size; double sum = 0;
// Ask user to enter the number of students
cout << "Enter the number of students (size of array):
";
cin >> size;

// Dynamically allocate memory for the array
double* marks = new double[size];

// Get exam marks from the user
for (int i = 0; i < size; i++) {
cout << "Enter mark for student " << i + 1 << ": ";
cin >> marks[i];
sum += marks[i];
}

// Calculate average
double average = sum / size;

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.
examexpert01 Chamberlain College Nursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
195
Member since
2 year
Number of followers
111
Documents
937
Last sold
1 month ago

3,3

21 reviews

5
9
4
0
3
6
2
1
1
5

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