Just follow the guidelines provided in each question before proceeding towards submission.
Each question comes up with a requested file, You just need to write code within the function body of the requested file provided.
Maximum Grade for GA 4 Qn 1 and Qn 2 is 15. Maximum Grade for GA 4 Qn 3 is 20.
Do not change the name of the file.
Do not change the function definition of the requested file.
Do not write main function within the requested file.
Do not take input or print any kind of output.
Link 2: Graded Assignment 5 questions
Link 3: Adding Security Exceptions Configuration To Your Browser For Moodle
You might be wondering how your code will run without a main method. So here is the explanation.
We have a created a main.cpp file in moodle which contains the main method. This main.cpp file is hidden from the students. Our main.cpp file calls the function in the requested file. After we receive the required arguments we have a checker function which checks if the students answers are correct or not.
Here is a sample example for your understanding purpose only.
Our main.cpp contains code something like this...
#include "iostream"
using namespace std;
extern int uniqueInteger(vector<int> V); // it defines that uniqueInteger function is in an external file
bool check(int studentAnswer, int correctAnswer){
if(studentAnswer==correctAnswer) return true;
return false;
}
int main(){
vector<int> V {1,2,3,3,2};
int studentAnswer = uniqueInteger(V); // Call to the function unique Integer that is inside the requested file
int correctAnswer = 1;
bool correct = check(studentAnswer, correctAnswer); // Check if student answer is correct
int grade=0;
if(correct) grade=10;
else grade=0;
}
Now say the requested file name is Ga3Qn3.cpp
We compile your code using the command 'g++ main.cpp Ga3Qn3.cpp' and then run it using './a.out'
This is just for a simple understanding on how the things work. In practice we have additional scripts running to handle the grading and number of test cases.