1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Minchanka [31]
3 years ago
15

class student_record { public: int age; string name; double gpa; }; Implement a void function that has five formal parameters: a

dynamic array of student_records, the count (number of student_records in the array), an integer, a string, and a double. The function will delete a student record in the dynamic array with age, name and gpa fields that match the age, name and gpa fields that are given in the formal parameters. Remember, to check to see if the dynamic array is empty because you cannot delete from an empty array.
Computers and Technology
1 answer:
Setler79 [48]3 years ago
8 0

Answer:

void delete_record(student_record *arr, int &size, int age, string name, double gpa) {

int index = -1;

if (arr != NULL && size > 0) {

for (int i = 0; i < size; ++i) {

if (arr[i].age == age && arr[i].name == name && arr[i].gpa == gpa) {

index = i;

break;

}

}

}

if (index != -1) {

for (int i = index; i < size - 1; ++i) {

arr[i] = arr[i + 1];

}

size--;

}

}

You might be interested in
What is Human Dignity
jeyben [28]

Answer:

what is human dignity

Explanation:

The English word dignity comes from the Latin word, dignitas, which means “worthiness.” Dignity implies that each person is worthy of honor and respect for who they are, not just for what they can do. ... In other words, human dignity cannot be earned and cannot be taken away.

6 0
3 years ago
In Microsoft Word, spelling errors are identified by a _____.
kvasek [131]
Red underline. Hope this helps.
5 0
2 years ago
Read 2 more answers
How do I go to files in Brainly I need help
Lyrx [107]

Answer:

There should be a little icon at the bottom of your question box/answer box. It looks like a paper clip. click it and boom

Explanation:

4 0
3 years ago
In order to organize your work effectively on the computer, where is the best place to save it?
Morgarella [4.7K]
Your answer is -

B. Folder Is the best place to save it
8 0
3 years ago
Read 2 more answers
Do You assign the Needs Met rating before assigning the page quality (PQ) rating?
tensa zangetsu [6.8K]
IS GOD REAL.......................?<span>

</span>
6 0
3 years ago
Other questions:
  • Airbags only absorb the _____ impact in a crash. initial final mid-stage smallest
    13·1 answer
  • Which of the following commands is more recommended while creating a bot?
    9·1 answer
  • Match each item with a statement below. a device used in mobile devices to sense the physical position of the device an area whe
    11·1 answer
  • Alison wants to add her company name at the bottom of every page in her document. Which option should she use?
    11·2 answers
  • On laptops with a smart card reader installed, where is the smart card reader usually located?
    13·1 answer
  • Please tell fast plzzzzzzzz​
    11·2 answers
  • How do people decide their ethical behavior
    13·2 answers
  • can you still receive messages on messenger from a person when you deleted the conversation with them? (But not blocked them)
    14·2 answers
  • Discuss the ways you can perform to prevent your computer/device and its data/contents from being stolen. Define two-facto authe
    7·1 answer
  • This seems like a good time to ask the basic question, “How’s it going in class?” Feel free to offer constructive feedback about
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!