This "runs" but nothing shows up on screen?

This program runs and it says 1 succeeded, however nothing shows up except:

"*** start of 276Arrays_Ex04.cpp program ***

*** end of 276Arrays_Ex04.cpp program ***

Here's the code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
/* Comments       /10 points
 *
 *
 *  U10_Arrays04.cpp
 *
 * CIS 276 Introduction to C/C++ Programming
 * Chuck Nelson, Professor
 *
 * Student Information (please complete ? below)
 *    Name:         Elizabeth Stevens
 *    RVC Email:    s030509@student.rockvalleycollege.edu
 * Class Information
 *    Section:      D010
 * Assignment Information
 *                  U10_Arrays04.cpp
 *
 * Purpose: 1D array practice exercises
 *
 *---------------------------------------------------------------------

Sample Output:

*** start of 27610_Arrays04.cpp program ***

City             City Points
---------------  1---5----10---15---20
Belvidere        **********
Freeport         ********
Byron            ************
Stillman Valley  ***************
Rockford         *********

*** end of 27610_Arrays04.cpp program ***


Input:
   TODO #1: complete the coding of the points array
            An integer array of 5 numbers: 10, 8, 12, 15, 9

   TODO #2: complete the coding of the cities string array
      An string of 5 city names intialized to:
      "Belvidere", "Freeport", "Byron", "Stillman Valley", "Rockford"

      Compile-time arrays with initialization lists.


Processing & Output:
   TODO #3: complete the coding of the call to the printStars() function

   TODO #4: code the printStars() function

*/


#include <iostream>
#include <iomanip>
#include <string>
using namespace std;


int main(void)
{
   /* declarations ------------------------------------------------*/
   
   
   // constants
   const int SIZE = 5;

   // function prototype(s)
   // return by value is used
   void printStars(const int [], const string [], const int);

   // local data (other than arrays)

   // TODO #1: complete the coding of the points array
   //   replace ?? with the correct initialization list
   //    each array cell will store the number of stars for the
   //    corresponding city in the cities array below
    
   // STUDENT CODE BEGINS
   
   int points[] = {10, 8, 12, 15, 9};
   
   string choice; 

   // STUDENT CODE ENDS                          ,




    // TODO #2: complete the coding of the cities string array

   // STUDENT CODE BEGINS

   void printStars( const int SIZE, const string cities, const int points );

    string cities[SIZE] = {
							"Belvidere", 
							"Freeport", 
							"Byron", 
							"Stillman Valley", 
							"Rockford"
                          };
   
	// STUDENT CODE ENDS                          ,
                          


	
   /* statements   ------------------------------------------------*/

    // start the program
    cout << "*** start of 276Arrays_Ex04.cpp program ***" << endl;
    cout << endl;



   // TODO #3: call display function, passing count array & size
   //   replace the three underlines with the correct parameters
   // STUDENT CODE BEGINS

  void printStars( const int SIZE, const string cities, const int points );



   // STUDENT CODE ENDS    


   // terminate the program
   cout << endl;
   cout << "*** end of 276Arrays_Ex04.cpp program ***" << endl << endl;
   cin.get();

   return 0;
}   // end main()





/*--------------------------------------------------------------------//
// Function Name: printStars()
// Parameters:    points : const int[],
//                cities : const string[], 
//                SIZE   : const int
// Return:        void
//
// Purpose: to display cities and their points in a graph
//--------------------------------------------------------------------//
// TODO #4: code the display function
// Suggested Algorithm 

declare local variables (if needed)


Print row 1 of column headings (City             City Points)
Print row 2 of column headings (---------------  1---5----10---15---20)

// print one line for each iteration of the for loop
for each city in the cities array
   print the name of a city
   
   // print one star for each iteration of the for loop
   for the value for that city in the points array
      print a star
   end for loop
   move cursor to next line
End outer loop
move cursor to next line

*/

// STUDENT CODE BEGINS
 void printStars( const int SIZE, const string cities, const int points )
{

cout << setw(13) << left << "City" << " " << endl; 

cout << setw(13) << left << "City Points" << endl; 

cout << setw(15) << left << " " << endl;

cout << setw(15) << left << "1" << " " << "5" << " " << "10" << " " << "15" << " " << "20" << endl;

}


// STUDENT CODE ENDS
@raven1101

I am surprised that compiles - there should be a forward declaration of the printStars function before main.
There are 3 forward declarations in main!
@cire

All right, I am going to give up today - will have another go when I can get 2 brain cells to work together !!!
Topic archived. No new replies allowed.