Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include using namespace std; #define SIZE 5 // Max size of the array int count = 0; // global variable to count student's // mark

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

#include using namespace std; #define SIZE 5 // Max size of the array int count = 0; // global variable to count student's // mark info added into the array // Function prototypes. The formatName, press Enter, getGrade and // getTask were already implemented. Only need to complete the rest 17 after getTask. void formatName(string &); void press Enter(); char getGrade(int); int getTask(); void addMarkInfo(string [], int [][2]); void listMarkInfo(string n[SIZE], int m[][2]); void viewResults(string n[SIZE], int m[][2], int s); void viewReports(string n[SIZE], int m[][2]); // Start main function int main() { // The next 2 array variables are to be used as parallel array string names [SIZE]; // 1 dimensional array to store student's names int marks[SIZE][2]; // 2 dimensional array to store coursework and final exam marks int task = get Task(); while (task != 5 ) { switch (task) { case 1: addMarkInfo(names, marks); break; case 2: listMarkInfo(names, marks); break; case 3: viewResults (names, marks, count); break; case 4: viewReports(names, marks); } task = get Task(); count); break; case 4: viewReports(names, marks); } task = getTask(); } return 0; } 1/ start user-defined functions implementations // function to format student's name so it has at least 25 Il characters including the trailing space bar characters void formatName(string &n) { int strlen = n.length(); if (strlen = 85) return 'A': if (m >= 70) return 'B'; if (m >= 55) return 'C'; if (m >= 40) return 'D' return 'E'; } 1/ only allow users to choose the option from 1 to 5 int sett 1/ only 5 levels of grades (A, B, C, D & E) char getGrade(int m) { if (m >= 85) return 'A'; if (m >= 70) return 'B'; if (m >= 55) return 'C'; if (m >= 40) return 'D'; return 'E'; } 1/ only allow users to choose the option from 1 to 5 int get Task() { int t = 0; cout 5) { cout > t; } cout using namespace std; #define SIZE 5 // Max size of the array int count = 0; // global variable to count student's // mark info added into the array // Function prototypes. The formatName, press Enter, getGrade and // getTask were already implemented. Only need to complete the rest 17 after getTask. void formatName(string &); void press Enter(); char getGrade(int); int getTask(); void addMarkInfo(string [], int [][2]); void listMarkInfo(string n[SIZE], int m[][2]); void viewResults(string n[SIZE], int m[][2], int s); void viewReports(string n[SIZE], int m[][2]); // Start main function int main() { // The next 2 array variables are to be used as parallel array string names [SIZE]; // 1 dimensional array to store student's names int marks[SIZE][2]; // 2 dimensional array to store coursework and final exam marks int task = get Task(); while (task != 5 ) { switch (task) { case 1: addMarkInfo(names, marks); break; case 2: listMarkInfo(names, marks); break; case 3: viewResults (names, marks, count); break; case 4: viewReports(names, marks); } task = get Task(); count); break; case 4: viewReports(names, marks); } task = getTask(); } return 0; } 1/ start user-defined functions implementations // function to format student's name so it has at least 25 Il characters including the trailing space bar characters void formatName(string &n) { int strlen = n.length(); if (strlen = 85) return 'A': if (m >= 70) return 'B'; if (m >= 55) return 'C'; if (m >= 40) return 'D' return 'E'; } 1/ only allow users to choose the option from 1 to 5 int sett 1/ only 5 levels of grades (A, B, C, D & E) char getGrade(int m) { if (m >= 85) return 'A'; if (m >= 70) return 'B'; if (m >= 55) return 'C'; if (m >= 40) return 'D'; return 'E'; } 1/ only allow users to choose the option from 1 to 5 int get Task() { int t = 0; cout 5) { cout > t; } cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 3 Lnai 6323

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

3642159389, 978-3642159381

More Books

Students also viewed these Databases questions