Hello i am trying to write a programm for my college c++ class. This class is the second level and i took the first level two years ago due to just transferring to different school/major. My project is to write a program for a small theater that will show what seats are available and compute ticket purchases. I am having trouble with arrays and functions. In my code below, i was able to write a menu function and have it displayed. That works. I then wrote a function that makes all the values of the 2 dimensional array(seating chart) a "a". Then the function displays the 2 dimensional array to the screen. I wrote this code in a seperate program in the main function to see if it worked. When it runs, it displays all the "a"'s but it does accross the whole screen instead of in a 15 row 30 column chart. My second problem, is im not very familier with functions. I cant get the function to display the chart (even if the chart displays wrong) to display when the user inputs the number 2. Really need help. Once i have it explained and shown to me i will understand it better.
//Author: Steven Cortright
//Course: CSC 136
//Date: Spring 2013
//Purpose: Develop a program that will allow a theater to sell tickets for performances
For your first problem, add a cout << endl; statement after your inner for loop while outputting the array.
For your second problem, you're not passing anything in to the availableSeating(...) function. You need to make an array in main, and then populate it (by moving the first set of for loops in your availableSeating(...) function to main).
it worked lol. i realize now why it wouldn;t work with have the endl where i had it. Having it outside like that allows the loop to run through for each row and then return instead of returning after every element. thank you for the help