100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
COS1512 ASSIGNMENT 03. DUE 23 AUGUST 2024. R60,00   Add to cart

Exam (elaborations)

COS1512 ASSIGNMENT 03. DUE 23 AUGUST 2024.

1 review
 18 views  1 purchase

COS1512 ASSIGNMENT 03. DUE 23 AUGUST 2024. PASS WITH DISTINCTION-FORTIS PASSUM.

Preview 4 out of 43  pages

  • July 17, 2024
  • 43
  • 2023/2024
  • Exam (elaborations)
  • Questions & answers
All documents for this subject (45)

1  review

review-writer-avatar

By: chikovorer • 2 months ago

avatar-seller
distinctiongateway
COS1512 ASSIGNMENT 03


Friday, 23 August 2024, 12:00 PM


Year Module 2024


PASS WITH DISTINCTIONS. FORTIS PASSUM


FOR FURTHER ASSISTANCE WITH ECONOMICS,
MANAGEMENT, ACCOUNTING, TAXATION EDUCATION@ LLB
MODULES.




CALL/WHATSAAP0816884518/0816884519
EMAIL: info@fortispassum.co.za
admin@fortispassum.co.za

,Question 1

#include <iostream>

#include <string>

class Student {

private:

std::string name;

int quiz1;

int quiz2;

int midtermExam;

int finalExam;

public:

// Default constructor

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

// Mutators

void setName(const std::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;

}

// Accessors

std::string getName() const {

return name;

}

int getQuiz1() const {

return quiz1;

}

int getQuiz2() const {

return quiz2;

}

int getMidtermExam() const {

return midtermExam;

}

int getFinalExam() const {

return finalExam;

}

, // Function to calculate the weighted average score

double calculateAverage() const {

double quizPercentage = (static_cast<double>(quiz1) / 10 +
static_cast<double>(quiz2) / 10) / 2 * 100;

double average = (quizPercentage * 0.25) + (midtermExam * 0.25) + (finalExam *
0.50);

return average;

}

};

int main() {

Student student;



// Input the student data

std::string name;

int quiz1, quiz2, midtermExam, finalExam;



std::cout << "Student name: ";

std::getline(std::cin, name);

student.setName(name);



std::cout << "Quiz 1: ";

std::cin >> quiz1;

student.setQuiz1(quiz1);

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through EFT, credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying this summary from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller distinctiongateway. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy this summary for R60,00. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

78462 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy summaries for 14 years now

Start selling
R60,00  1x  sold
  • (1)
  Buy now