Question: #include #include using namespace std; // PLACE YOUR NAME HERE const MAXNAME = 20; int main() { ifstream inData; inData.open(grades.txt); char name[MAXNAME + 1]; //
#include
// PLACE YOUR NAME HERE
const MAXNAME = 20;
int main() { ifstream inData; inData.open("grades.txt");
char name[MAXNAME + 1]; // holds student name float average; // holds student average
inData.get(name,MAXNAME+1); while (inData) { inData >> average; // FILL IN THE CODE to print out name and // student average
// FILL IN THE CODE to complete the while // loop so that the rest of the student // names and average are read in properly }
return 0; }
Consider the following code: char string1[25] ="Total Eclipse ";
char string2[11] = "of the Sun";
cout << string1 << endl;
cout << string2 << endl;
strcat(string1,string2);
cout << string1 << endl;
Exercise 1: Write a complete program including the above code that outputs the concatenation of string1 and string2. Run the program and record the result.
Exercise 2: Alter the program in Exercise 1 so that string1 contains 20 charac- ters rather than 25. Run the program. What happens?
Step by Step Solution
There are 3 Steps involved in it
Complete Program for Exercise 1 cpp include include using namespace std int main Initialize the strings char string125 Total Eclipse Size of 25 char s... View full answer
Get step-by-step solutions from verified subject matter experts
