subject

#include #include #include using namespace std; int main() { int numOfStudents = 0; // The number of test scores string *namesPtr = nullptr; // To point to the names // Get the number of students. cout << "\nHow many students will you enter? "; cin >> numOfStudents; // Validate the input. while (numOfStudents < 0) { cout << "The number cannot be negative.\n"; cout << "Enter another number: "; cin >> numOfStudents; } // Allocate an array to hold the names. namesPtr = new string[numOfStudents]; // Populate the arrays. for (int i = 0; i < numOfStudents; i++) { // Get a name. cout << "\nEnter student" << (i + 1) << "'s name: "; cin >> namesPtr[i]; } // Display the resulting data. cout << "\nThe list students " << "\n\n"; cout << setw(12) << left << "Name" << setw(6) << endl; cout << "" << endl; cout << setprecision(2) << fixed << showpoint; for (int j = 0; j < numOfStudents; j++) { cout << endl; cout << setw(12) << left << namesPtr[j]; } cout << endl; // Free the dynamically-allocated memory. delete [] namesPtr; namesPtr = nullptr; return 0; }The requirements of this final code is similar to this one. But this time you are asked to use a structure (you can name it Student) to store the student's name and gpa; instead of the parallel arrays

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:00
This program will store roster and rating information for a soccer team. coaches rate players during tryouts to ensure a balanced team. (1) prompt the user to input five pairs of numbers: a player's jersey number (0 - 99) and the player's rating (1 - 9). store the jersey numbers in one int vector and the ratings in another int vector. output these vectors (i.e., output the roster). (3 pts) ex: enter player 1's jersey number: 84 enter player 1's rating: 7 enter player 2's jersey number: 23 enter player 2's rating: 4 enter player 3's jersey number: 4 enter player 3's rating: 5 enter player 4's jersey number: 30 enter player 4's rating: 2
Answers: 1
question
Computers and Technology, 22.06.2019 19:10
10. when you create a pivottable, you need to specify where to find the data for the pivottable. is it true
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Me ! evelyn is a manager in a retail unit. she wants to prepare a report on the projected profit for the next year. which function can she use? a. pmt b. round c. division d. what-if analysis
Answers: 2
question
Computers and Technology, 23.06.2019 23:30
Worth 50 points answer them bc i am not sure if i am wrong
Answers: 1
You know the right answer?
#include #include #include using namespace std; int main() { int numOfStudents = 0; // The number of...
Questions
question
Mathematics, 16.10.2020 21:01
question
Mathematics, 16.10.2020 21:01
question
English, 16.10.2020 21:01
question
Mathematics, 16.10.2020 21:01
Questions on the website: 13722363