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 theory of knowledge?​
Karolina [17]
Theory of knowledge (TOK) plays a special role in the International Baccalaureate® (IB) Diploma Programme (DP), by providing an opportunity for students to reflect on the nature of knowledge, and on how we know what we claim to know.
4 0
3 years ago
Write a class Bug that models a bug moving along a horizontal line. The bug moves either to the right or left. Initially, the bu
Harrizon [31]

Answer:

Explanation:

The following code is written in Java. It creates the Bug class with the position and direction variables. Then it creates a constructor, move method, turn method, and getPosition method. Finally, a bug object called bugsy is created in the main method, and we move it once to the right, then again to the right, and then we turn it and move it 5 times to the left, printing out the position when it is done moving. Output can be seen in the attached picture below.

class Brainly {

   public static void main(String[] args) {

       Bug bugsy = new Bug(10);

       bugsy.move();

       System.out.println("Current bug position: " + bugsy.getPosition());

       bugsy.move();

       System.out.println("Current bug position: " + bugsy.getPosition());

       bugsy.turn();

       bugsy.move();

       bugsy.move();

       bugsy.move();

       bugsy.move();

       bugsy.move();

       System.out.println("Current bug position: " + bugsy.getPosition());

   }

}

class Bug {

   char direction = 'r';

   int position = 0;

   public Bug(int initialPosition) {

       this.position = initialPosition;

   }

   public void turn() {

       if (this.direction == 'r') {

           this.direction = 'l';

       } else {

           this.direction = 'r';

       }

   }

   public void move() {

       if (this.direction == 'r') {

           this.position += 1;

       } else {

           this.position -= 1;

       }

   }

   public int getPosition() {

       return this.position;

   }

}

7 0
3 years ago
Type the correct answer in the box. Spell all words correctly.
faltersainse [42]

The resource allocation section of the test plan contains the information regarding the features to be tested in the test plan.

<h3>What is resource allocation?</h3>

The distribution and disbursement of the total disposable resources within an organization towards the different functions and processes in an organization is referred to as resource allocation.

The main functionality of a resource allocation section in a test plan is to portray the features of the test that will be conducted by the team of experts.

Hence, the functions of resource allocation in a test plan are as aforementioned.

Learn more about resource allocation here:

brainly.com/question/17837067

#SPJ1

5 0
2 years ago
Who is the first computer programmer​
enot [183]

Answer:

Ada Lovelace was the first computer programmer

8 0
2 years ago
Read 2 more answers
What field is used to send a copy of an e-mail message?
vampirchik [111]
The CC field is used to send a copy of an email. CC stands for carbon copy.
7 0
3 years ago
Other questions:
  • Sam's manager would like him to create and distribute copies of a budget report for each department. The budget report should sh
    8·2 answers
  • BOTH INTERNATIONAL &amp; INLAND Which procedure(s) shall be used to determine risk of collision?
    14·1 answer
  • Which of the following is NOT an argument used to determine how a shot is fired from an A. object the shot itself being instanti
    12·1 answer
  • write a program that calculates the total grade for N classroom exerices as a perfentage. the user should input the value for N
    11·1 answer
  • Someone plz answer
    8·1 answer
  • What is the best stratiget to avoid paying intrest in your credit cared
    13·1 answer
  • Any action that causes harm to your computer is called a
    15·1 answer
  • Which of the following is NOT one of the three main ways to control a program when writing code?
    6·2 answers
  • Use the drop-down menus to complete the statements about Search Folders.
    12·1 answer
  • Higher Order Functions used for simulations of dice rolls. Definition: An n-sided dice function takes no arguments and always re
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!