C++ programming questions: Thank you very much :) Pointer Syntax Declare a two-d
ID: 2247776 • Letter: C
Question
C++ programming questions:
Thank you very much :)
Pointer Syntax Declare a two-dimensional array of doubles (on the stack) named tickerValues with 12 rows and 31 columns Declare and allocate memory (on the heap) for a two-dimensional array of stringsS named carMakes with 20 rows, each with 6 columns Give the declaration for a function assignPicture() that takes a pointer to a HugeStudentRecord object Give the declaration for a function calculateAverage () that takes an array of doubleS and an int named count Write a call to function calculateAverage (), passing it rainfallExplanation / Answer
void someMethod() {
double tickerValues[12][31]; //answer 6
string **carMakes = new string*[20]; //amswer 7
for (int i = 0; i < 20; i++) //answer 7
carMakes[i] = new string[6]; //answer 7
}
void assignPicture(HugeStudentRecord *hsrPtr);
double calculateAverage(double *arr, int count);
int main() {
calculateAverage(rainfall,sizeof(rainfall)/sizeof(*rainfall));
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.