I want to write a program that takes the number of tests, assignments, labs, and quizzes taken in a given class by command line arguments. The program will read the number of tests, assignments, labs and quizzes as command line input, and then read the specific number of grades for each by prompting the user for the correct number of items.
The user can supply these arguments in any order, and therefore you need to preface each argument with an option to know what the argument is. For example:
class_average –q 5 –a 8 –l 10 –t 2 -f
I want the function to take in these commands and then ask what the scores for how many tests and quizzes and so on is:
example:
Quiz 1:
Quiz 2:
…
Quiz 5:
Assignment 1:
Assignment 2:
…
Assignment 8:
…
Final Exam:
with the example:
class_average –q 5 –a 8 –l 10 –t 2 -f
The user would have to enter 5 quiz scores, 8 assignment scores, 10 lab scores and 2 test scores with the final exam score optional.
How can I write this small program?
here is what I have:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
#include <iosteam>
#include <string>
#include <cmath>
#include <stdlib.h>
using namespace std;
#define LABS .1;
#define QUIZZES .1;
#define ASSIGNMENTS .4;
#define TESTS .25;
#define FINAL .15;
int main(int argc, char *argv[]){
}
|