Question: I'm trying to do this code but I can't find what wrong with it. It does not give me the output I'm expecting. I've included

I'm trying to do this code but I can't find what wrong with it. It does not give me the output I'm expecting. I've included the output, instructions, and the C++ code:



mming II Laboratory ID: #134972 ;i++) { nitialScores) { ; i++) {

es[1]; student Number) { S; i++) { Ln 74, Col 1 History

/home/runner/Lab03/./Grades.cpp:21: multiple definition of 'Gr ades::Grades(int const*)'; /tmp/main-c788a6.0:/home/runner/Lab 83/./Grades.cpp:21: first defined here

Lab03.cpp

/nix/store/039g378vc3pc3dv19dzdrd@14q93qwf-binutils-2.39/bin/ ld: /tmp/Grades-8d3f61.0: in function Grades': /home/runner/Lab03/./Grades.cpp:15: multiple definition of 'Gr ades::Grades()';

Grades.h

/tmp/main-c788a6.0:/home/runner/Lab03/./Grade s.cpp:15: first defined here /nix/store/839g378vc3pc3dv19dzdlrd014q93qwf-binutils-2.39/bin/ ld: /tmp/Grades-8d3f61.0: in function Grades': /home/runner/Lab83/./Grades.cpp:27:

Grades.cpp

multiple definition of 'Gr ades::~Grades()'; /tmp/main-c788a6.0:/home/runner/Lab83/./Grad es.cpp:27: first defined here /nix/store/839g378vc3pc3dv19dzdlrd@14q93qwf-binutils-2.39/bin/ ld:

/tmp/Grades-8d3f61.0: in function Grades': /home/runner/Lab03/./Grades.cpp:27: multiple definition of 'Gr ades::~Grades()'; /tmp/main-c788a6.0:/home/runner/Lab83/./Grad es.cpp:27:

first defined here /nix/store/839g378vc3pc3dv19dzdrde14q93qwf-binutils-2.39/bin/ ld: /tmp/Grades-8d3f61.0: in function Grades::getAverage() co nst': /home/runner/Lab83/./Grades.cpp:44:  
 
 
 
 

mming II Laboratory ID: #134972 ;i++) { nitialScores) { ; i++) { es[1]; student Number) { S; i++) { Ln 74, Col 1 History /home/runner/Lab03/./Grades.cpp:21: multiple definition of 'Gr ades::Grades(int const*)'; /tmp/main-c788a6.0:/home/runner/Lab 83/./Grades.cpp:21: first defined here /nix/store/039g378vc3pc3dv19dzdrd@14q93qwf-binutils-2.39/bin/ ld: /tmp/Grades-8d3f61.0: in function Grades': /home/runner/Lab03/./Grades.cpp:15: multiple definition of 'Gr ades::Grades()'; /tmp/main-c788a6.0:/home/runner/Lab03/./Grade s.cpp:15: first defined here /nix/store/839g378vc3pc3dv19dzdlrd014q93qwf-binutils-2.39/bin/ ld: /tmp/Grades-8d3f61.0: in function Grades': /home/runner/Lab83/./Grades.cpp:27: multiple definition of 'Gr ades::~Grades()'; /tmp/main-c788a6.0:/home/runner/Lab83/./Grad es.cpp:27: first defined here /nix/store/839g378vc3pc3dv19dzdlrd@14q93qwf-binutils-2.39/bin/ ld: /tmp/Grades-8d3f61.0: in function Grades': /home/runner/Lab03/./Grades.cpp:27: multiple definition of 'Gr ades::~Grades()'; /tmp/main-c788a6.0:/home/runner/Lab83/./Grad es.cpp:27: first defined here /nix/store/839g378vc3pc3dv19dzdrde14q93qwf-binutils-2.39/bin/ ld: /tmp/Grades-8d3f61.0: in function Grades::getAverage() co nst': /home/runner/Lab83/./Grades.cpp:44: multiple definition of 'Gr ades::getAverage() const'; /tmp/main-c788a6.0:/home/runner/Lab 03/./Grades.cpp:44: first defined here /nix/store/839g378vc3pc3dv19dzdlrd014q93qwf-binutils-2.39/bin/ ld: /tmp/Grades-8d3f61.0: in function Grades::printGrades (int ) const': /home/runner/Lab83/./Grades.cpp:64: multiple definition of 'Gr ades::printGrades (int) const; /tmp/main-c788a6.0:/home/runner /Lab03/./Grades.cpp:64: first defined here /nix/store/839g378vc3pc3dv19dzdlrd@14q93qwf-binutils-2.39/bin/ Ld: /tmp/Grades-8d3f61.0: in function Grades::getAverage() co nst': /home/runner/Lab03/./Grades.cpp:44: multiple definition of 'Gr ades::getGrade() const'; /tmp/main-c788a6.0:/home/runner/Lab03 /./Grades.cpp:44: first defined here clang-12: error: Linker command falled with extt code 1 (use - v to see invocation) make: *** [Makefile:10: main] Error 1 exit status 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!