Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using multidimensional arrays in C++ It said I did not declare the 2 dimensional array, but it has been initialized, what do I have to

using multidimensional arrays in C++

It said I did not declare the 2 dimensional array, but it has been initialized, what do I have to add to declare it, I thought ive already done that. with the "int rate"

#include using namespace std;

int main() { // Declare two dimensional array here int rate[5][5] ={ {30, 60, 88, 115, 140}, {26, 52, 70, 96, 120}, {24, 46, 67, 89, 110}, {22, 40, 60, 75, 88}, {20, 35, 50, 66, 84}}; for(int age=0;age<5;age++){ for(int numDays=0;numDays<5;numDays++) cout << rate[age][numDays] << " "; } cout << endl; // Declare other variables int numDays; int age; int QUIT = 99; // This is the work done in the getReady() function // Perform a priming read to get the age of the child cout << "Enter age of child or 99 to quit: "; cin >> age; while(age != QUIT) { // This is the work done in the determineRateCharge() function // Ask the user to enter the number of days cout << "Enter number of Days: "; cin >> numDays; // Print the weekly rate cout << "rate is $" << rate[age][numDays] << endl; // Ask the user to enter the next child's age cout << "Enter age of child or 99 to quit: "; cin >> age; } // This is the work done in the finish() function cout << "End of program" << endl;

return 0; } // End of main() function

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_2

Step: 3

blur-text-image_3

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

Sybase Database Administrators Handbook

Authors: Brian Hitchcock

1st Edition

0133574776, 978-0133574777

More Books

Students also viewed these Databases questions