Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 3 fuera de 25 páginas
Examen

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

Document preview thumbnail
Vista previa 3 fuera de 25 páginas

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

Vista previa del contenido

,COS1512 Assignment 3 (COMPLETE ANSWERS) 2024
(160814) - DUE 23 August 2024;100% TRUSTED workings,
explanations and solutions
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


int midtermExam;
int finalExam;


public:
// Default constructor

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


// Setter functions (mutators)
void setName(string studentName) {
name = studentName;
}


void setQuiz1(int score) {
quiz1 = score;
}


void setQuiz2(int score) {
quiz2 = score;
}


void setMidtermExam(int score) {
midtermExam = score;
}


void setFinalExam(int score) {
finalExam = score;
}


// Getter functions (accessors)

Libro relacionado
 image
Editorial: 2013 ISBN: 9780273794196 Edición: Desconocido

Información del documento

Subido en
26 de julio de 2024
Número de páginas
25
Escrito en
2023/2024
Tipo
Examen
Contiene
Preguntas y respuestas
$2.50

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
THEBLAZE1
3.6
(113)
Vendido
719
Seguidores
173
Artículos
1098
Última venta
3 semanas hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes