Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assignment5 Count number of lines in file then dynamically allocate memory for the array of structs. Check how these functions are used to count number
Assignment5 Count number of lines in file then dynamically allocate memory for the array of structs. Check how these functions are used to count number of lines in file: b. The name of the file must be college.cpp fin.unsetf(ios hase::skipws); // count the newlines with an algorithm specialized for counting unsigned line count - count (istream iteratorcchar>(fin), istream iteratorechar> n') //position streaning pointer back to the beginning of file fin.clear); fin.seekg(e, ios: :beg); fin>skipws; //white space skipping flag -->default CPP State College has a student file with the following data: (students.dat) -Social Security No. -Student Name -Class Code -School Code Credits Earned Read from the file into a vector (most efficient solution). You need to read from the file to a temporary struct variable first, then push back this temporary variable into the vector c. Class Codes: 1 Freshman Sample Output 3 Junior 4 Senior A. The percentage of students with: 1. GPA 1less than 2.8: 2. GPA between 2.e and 3.0: 3. GPA greater than 3-e 8% 43.75% School Codes: 56.25% 1 Business 2- Liberal Arts 8. The percentage of students with GPAs greater than 3.8 who are 43.75% 1. Business majors 2. Liberal Arts najors: 3. Engineering najors: 6.25% 6 , 25% Write a program that will read student data from file and print summary data as follows C. The percentage of students who have earned tore a. The percentage of students with a GPA of: than 109 credits and have GPAs less than 2.00: e less than 2.0 1 2. D. The percentage of students with GPAs ereater than 3.8 who are: 1. Freshen: 2. Sophonores: 3. Juniors: 4. Seniors: 6.25% between 2.0 and 3.0 (inclusive) 3. 18.75% greater than 3.0 12.5% 18.75% b. The percentage of students with GPAs greater than 3.0 who are: 1 Business majors 2. Liberal Arts majors 3. Engineering majors Makefile: c. The percentage of students who have earned more than 100 credits and have GPAs less than 2.00 The percentage of students with GPAs greater than 3.0 who are: -Should compile both programs, make sure you test your makefile before submission. - Check how to compile separate programs; one way for doing it is as follows: d. 1. Freshmen 2. Sophomores 3. Juniors 4. Seniors all: Partl Part2 Partl Part2 clean: + college.cpp -o college -std-c++11 t+ library.cpp -o library -std-c++11 rm-rf .0 Coding requirements/options: Read from the file into an array of structs Use enumerators in your code, example: enum {FRESHAN . 1, SOPHOMORE-2, Reading from file options: 1. 2. JUNIOR-3, SENIOR-4); 3. Define a maximum number of lines and define an array of structs accordingly inefficient) a. Assignment5 Count number of lines in file then dynamically allocate memory for the array of structs. Check how these functions are used to count number of lines in file: b. The name of the file must be college.cpp fin.unsetf(ios hase::skipws); // count the newlines with an algorithm specialized for counting unsigned line count - count (istream iteratorcchar>(fin), istream iteratorechar> n') //position streaning pointer back to the beginning of file fin.clear); fin.seekg(e, ios: :beg); fin>skipws; //white space skipping flag -->default CPP State College has a student file with the following data: (students.dat) -Social Security No. -Student Name -Class Code -School Code Credits Earned Read from the file into a vector (most efficient solution). You need to read from the file to a temporary struct variable first, then push back this temporary variable into the vector c. Class Codes: 1 Freshman Sample Output 3 Junior 4 Senior A. The percentage of students with: 1. GPA 1less than 2.8: 2. GPA between 2.e and 3.0: 3. GPA greater than 3-e 8% 43.75% School Codes: 56.25% 1 Business 2- Liberal Arts 8. The percentage of students with GPAs greater than 3.8 who are 43.75% 1. Business majors 2. Liberal Arts najors: 3. Engineering najors: 6.25% 6 , 25% Write a program that will read student data from file and print summary data as follows C. The percentage of students who have earned tore a. The percentage of students with a GPA of: than 109 credits and have GPAs less than 2.00: e less than 2.0 1 2. D. The percentage of students with GPAs ereater than 3.8 who are: 1. Freshen: 2. Sophonores: 3. Juniors: 4. Seniors: 6.25% between 2.0 and 3.0 (inclusive) 3. 18.75% greater than 3.0 12.5% 18.75% b. The percentage of students with GPAs greater than 3.0 who are: 1 Business majors 2. Liberal Arts majors 3. Engineering majors Makefile: c. The percentage of students who have earned more than 100 credits and have GPAs less than 2.00 The percentage of students with GPAs greater than 3.0 who are: -Should compile both programs, make sure you test your makefile before submission. - Check how to compile separate programs; one way for doing it is as follows: d. 1. Freshmen 2. Sophomores 3. Juniors 4. Seniors all: Partl Part2 Partl Part2 clean: + college.cpp -o college -std-c++11 t+ library.cpp -o library -std-c++11 rm-rf .0 Coding requirements/options: Read from the file into an array of structs Use enumerators in your code, example: enum {FRESHAN . 1, SOPHOMORE-2, Reading from file options: 1. 2. JUNIOR-3, SENIOR-4); 3. Define a maximum number of lines and define an array of structs accordingly inefficient) a
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started