Create a C program that has two users with two different rol

Create a C++ program that has two users with two different role: student, instructor.

1. Instructor should be able to create a quiz and student should be able to take the quiz.

2. Both users should have to register, login and logoff,

3. Both users should have to view the exam result (how many student got wrong/correct answers, exam grade).

4. Additionally, the program shall have a vector for loading quiz questions from the question bank file. The instructor shall provide the number of questions for the exam (about 15 random questions) and the program shall randomly select that number from the bank questions and create a new exam file – Quiz-03.

5. The users (instructor/student) will be accessing the exam program at a different time, meaning we will be running the program twice first as a instructor and then as a student.

6. Overall, the program shall have operations with at least these files:

Profile/users

Question bank (provided with this project)

Exam Quiz-03

Results Quiz-03

Below is the data for Question test bank.

Since I cannot upload a txt.file here... I copy and pasted the data from the text file.

The if, while and for statements control only one statement. Answer: True
A break statement is used in loops only. Answer: False
A variable declared outside of main function is said to be a local variable. Answer: False
A variable declared outside of main function is said to be a global variable. Answer: True
When a local variable is defined, it is not initialized by the system, you must initialize it yourself. Answer: True
When a global variable is defined, it is not initialized by the system, you must initialize it yourself. Answer: False
The job of the CPU is to fetch instructions, carry out the operations commanded by the instructions, and produce some outcome or resultant information. Answer: True
The rules that must be followed when constructing a program are called common sense. Answer: False
In distinguishing an expression as true or false, C++ sees 1, true and any non-zero value as true. Answer: True
Before a variable in C++ is used, it must be initialized. Answer: False
Each pass through a loop is called an iteration. Answer: False
Array: variable that can store multiple values of the same type. Answer: True
Array values are stored in consecutive memory locations. Answer: True
There are no checks in C++ that an array subscript is in range. Answer: True
An invalid array subscript can cause program to overwrite other memory. Answer: True
Array can copy into another array with an assignment statement. Answer: False
Parallel arrays are two or more arrays that contain related data. Answer: True
The vector can automatically increase its size. Answer: True
The vector can report the number of elements they contain. Answer: True
The last element of the vector can be removed with pop_back function. Answer: True
The vector elements can be deleted with clear function. Answer: True
The array size must be an integer constant greater than zero and the array data type can be any valid C++ data type. Answer: True
We can initialize C++ array elements either one by one or using a single statement. Answer: True
The array has 0 as the index of their first element which is called base index. Answer: True

Solution

#include \"stdafx.h\" #include #include #include #include #include using namespace std; struct StudentData { int studentID; string first_name; string last_name; int exam1; int exam2; int exam3; int total; char ch; }; const int SIZE = 9; const int INFO = 4; // Function prototypes void openInputFile(ifstream &, string); void getTotal(StudentData[]); void getGrade(StudentData[]); void calcLowest(StudentData[], int &, int &, int &, int &, int[]); void calcHighest(StudentData[], int &, int &, int &, int &, int[]); void getAverage(StudentData[], int, double &, double &, double &, double &, double[]); void getStd(StudentData[], double &, double &, double &, double &, double &, double &, double &, double &, double[]); void print(StudentData[], int[], int[], double[], double[]); void sort(StudentData[]); int main() { // Variables StudentData arr[SIZE]; int lowest1, lowest2, lowest3, lowest4; // Stores lowest exam scores int highest1, highest2, highest3, highest4; // Holds highest exam scores double average1 = 0, average2 = 0, average3 = 0, average4 = 0; // Represents average of each exam double std1 = 0, std2 = 0, std3 = 0, std4 = 0; // Holds standard deviation for Exams 1-3 and Total int lowest[INFO] = {}; int highest[INFO] = {}; double average[INFO] = {}; double standardDeviation[INFO] = {}; ifstream inFile; string inFileName = \"C:\\\\Users\\\\Lisa\\\\Desktop\\\\scores.txt\"; // Call function to read data in file openInputFile(inFile, inFileName); // Read data into an array of structs for(int count = 0; count < SIZE; count++) { inFile >> arr[count].studentID >> arr[count].first_name >> arr[count].last_name >> arr[count].exam1 >> arr[count].exam2 >> arr[count].exam3; } // Close input file inFile.close(); // Get score total for each student getTotal(arr); // Determine grade for each student getGrade(arr); // Calculate lowest scores in each exam and total scores calcLowest(arr, lowest1, lowest2, lowest3, lowest4, lowest); // Calculate highest scores in each exam and total scores calcHighest(arr, highest1, highest2, highest3, highest4, highest); // Calculate average of each exam and the average of the total scores getAverage(arr, SIZE, average1, average2, average3, average4, average); // Calculate standard deviation of each category getStd(arr, std1, std2, std3, std4, average1, average2, average3, average4, standardDeviation); cout << \"\ \"; // Print unsorted data print(arr, lowest, highest, average, standardDeviation); cout << \"\ \"; // Sort data sort(arr); // Print sorted data print(arr, lowest, highest, average, standardDeviation); system(\"PAUSE\"); return 0; }
Create a C++ program that has two users with two different role: student, instructor. 1. Instructor should be able to create a quiz and student should be able t
Create a C++ program that has two users with two different role: student, instructor. 1. Instructor should be able to create a quiz and student should be able t

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site