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, 23.06.2019 05:30
Sally is editing her science report about living things. she needs to copy a paragraph from her original report. order the steps sally needs to do to copy the text to her new document.
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
Respond to the following in three to five sentences. select the workplace skill, habit, or attitude described in this chapter that you believe is most important for being a successful employee.
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
*! 20 points! *jeff wants to create a website with interactive and dynamic content. which programming language will he use? a. dhtml b. html c. css d. javascript
Answers: 1
question
Computers and Technology, 24.06.2019 02:10
Which sentences describe the things you need to ensure while creating a sketch and a drawing? while an artistic or creative drawing is a creative expression, a technical drawing is an informative expression. you need to create accurate and neat drawings to convey accurate information. a technical drawing clearly conveys its meaning or information, and does not leave room for interpretation maintain a good speed while creating drawings
Answers: 1
You know the right answer?
#include #include #include using namespace std; int main() { int numOfStudents = 0; // The number of...
Questions
question
Mathematics, 15.01.2021 23:20
question
Health, 15.01.2021 23:20
question
English, 15.01.2021 23:20
question
Arts, 15.01.2021 23:20
Questions on the website: 13722367