Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Create the following: a) Two global integer constants, NUM_STUDENTS = 3, NUM_GRADES = 4. b) One dimensional string array of size NUM_STUDENTS, named students.

1. Create the following:

a) Two global integer constants, NUM_STUDENTS = 3, NUM_GRADES = 4.

b) One dimensional string array of size NUM_STUDENTS, named students.

c) Two dimensional integer array of size NUM_STUDENTS by NUM_GRADES, named grades.

d) Initialize students with Alice, Brenda and Chris.

e) Initialize grades with: Array 1: 76, 80, 88, 90 (Alices grades) Array 2: 57, 98, 69, 93 (Brendas grades) Array 3: 98, 83, 76, 85 (Chriss grades)

f) Create an output function that outputs: Student: Alice Grades: 76, 80, 88, 90 Student: Brenda Grades: 57, 98, 69, 93 Student: Chris Grades: 98, 83, 76, 85

g) Implement an average function that computes the average of all grades stored in the array.

h) Modify the output function so that it calls the average function and displays the GPA as shown in the example

2. Implement a partially filled array of capacity 100.

a) Implement an output and append function.

b) Use those functions to append a number of elements and output.

c) Implement an insertFirst function. This inserts an element in the first position of the array.

d) Implement a removeFirst function. This removes the element in the first position of the array. Hint: Both insert and remove functions will require shifting the array. Improper shifting of elements will result in data loss. Depending upon which way you are shifting (left or right), you will have to iterate in reverse.

3. Implement a partially filled array of capacity 100.

a) Implement an output and append function.

b) Use those functions to append a number of elements and output.

c) Implement a remove function. This function will remove a specified element from the array. This function can be split into two sections:

i) Locate the element in the array (if it exists).

ii) If the element exists, remove it.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions

Question

1. Define mass and mediated communication

Answered: 1 week ago