Question & Answer: ing last: string courseGrade: int testScore [5]: int programmingScore }: Stud…..

Please help with the following C++ question:
Consider the following declarations: struct Student string first: string last; string courseGrade int testScore [51: int programmingScore Student *p = new student ; The following statement sets the first element of array testScore of the structure pointed to by p to 100

Show transcribed image textConsider the following declarations: struct Student { string first: string last: string courseGrade: int testScore [5]: int programmingScore }: Student *p = new student: The following statement sets the first element of array testScore of the structure pointed to by p to _____ 100 _____.

Expert Answer

 

Hi,

By default the member inside a struct are initialized to 0, therefore elements of testScore are 0, but if you want to set the first element to 100 you can use p->testScore[0]=100.

Still stressed from student homework?
Get quality assistance from academic writers!