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 15:00
Which of the following statements tests if students have a grade of 70 or above, as well as fewer than five absences? a: if(grade > = 70 and daysabsent < = 5): b: if(grade > = 70 or daysabsent < = 5): c: if(grade > 70 and daysabsent < = 5): d: if(grade > 70 or daysabsent < = 5): i took the test the answer is a
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
Jaina and tomas are being considered as new tenants in an apartment. the landlord looks at their creditworthiness because he wants to be sure his new tenant pays the rent on time and in full. the table below summarizes the information that was on their applications. application information questions jaina tomas how many years have you had your job? 5 2 what is your monthly salary? $1,850 $2,500 how many credit cards do you have? 4 1 how much debt do you have? $13,000 $7,000 how many times were you late with payments on credit cards in the past year? 5 1 who will the landlord decide to be more creditworthy and why? tomas because the ratio of his debt to income is less. jaina because she has had her job longer, which makes her look more stable. jaina because she has more credit cards available to her. tomas because he makes more money per month.
Answers: 2
question
Computers and Technology, 23.06.2019 04:20
Which network media uses different regions of the electromagnetic spectrum to transmit signals through air? uses different regions of the electromagnetic spectrum to transmit signals through air.
Answers: 2
question
Computers and Technology, 24.06.2019 09:30
Atype of researcher who uses computers to make sense of complex digital data
Answers: 1
You know the right answer?
#include #include #include using namespace std; int main() { int numOfStudents = 0; // The number of...
Questions