100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

COS1512 Assignment 3 2024 (160814) - DUE 23 August 2024

Beoordeling
-
Verkocht
-
Pagina's
16
Cijfer
A+
Geüpload op
27-06-2024
Geschreven in
2023/2024

COS1512 Assignment 3 2024 (160814) - DUE 23 August 2024

Instelling
Vak










Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
27 juni 2024
Aantal pagina's
16
Geschreven in
2023/2024
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

Voorbeeld van de inhoud

COS1512
Assignment 3 2024
(160814) - DUE 23
August 2024
QUESTIONS WITH COMPLETE ANSWERS




[DATE]
[COMPANY NAME]
[Company address]

,COS1512 Assignment 3 2024 (160814) - DUE 23 August
2024

Question 1

Consider the following structure used to keep record of a student’s scores: struct Student {
string name; int quiz1; int quiz2; int midtermExam; int finalExam; } A student is assessed
according to the following policies:

1. The two quizzes are each marked out of 10.

2. The midterm exam and the final exam are each marked out of 100 marks.

3. The final exam counts for 50% of the grade, the midterm counts for 25%, and the two
quizzes together count for a total of 25%. (Do not forget to normalize the quiz scores. They
should be converted to a percentage before they are averaged in.) Turn the student record
into a class type rather than a structure type. The student record class should have member
variables for all the input data. Make all member variables private. Include public member
functions for each of the following:

• a default constructor that sets the student ‘s name to a blank string, and all the scores to
0;

• member functions to set each of the member variables to a value given as an argument to
the function (i.e. mutators);

• member functions to retrieve the data from each of the member variables (i.e. accessors);

• and a function that calculates and returns the student’s weighted average numeric score
for the entire course. Use this class in program which grades a student. The program
should read in the student’s name and scores and output the student’s record as well as the
student’s average numeric score for the entire course. Use the keyboard to supply input
and display the output on the screen. Test your program with the following input: Student
name: Johnny Applemac Quiz 1: 7 Quiz 2: 5 Midterm exam: 65 Final exam: 73
Downloaded by Corona Virus () lOMoARcPSD| COS1512/103/2024 3

, Here's how you can implement the described class in C++:

cpp

Copy code

#include <iostream>

#include <string>

using namespace std;



class Student {

private:

string name;

int quiz1;

int quiz2;

int midtermExam;

int finalExam;



public:

// Default constructor

Student() : name(""), quiz1(0), quiz2(0), midtermExam(0), finalExam(0) {}



// Mutator functions to set values

void setName(string studentName) {

name = studentName;

}

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
QuizDoc Chamberlain College Of Nursng
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
226
Lid sinds
2 jaar
Aantal volgers
193
Documenten
1051
Laatst verkocht
2 maanden geleden

3,7

31 beoordelingen

5
13
4
4
3
10
2
0
1
4

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen