Creat a text file that contains student number ( 9-digit number ) , year ( one of the four years: Senior denoted by SE, Junior denoted by JU, Sophomore denoted by SO or Freshman denoted by FR ) and GPA ( a floating point number greater than 0.0 ) . Add at least two students. For example , Your text file may contain entries as follow :
201212354 JU 3.5
201071256 SE 2.8
Then write a C++ program that uses the file you created above to do the following :
1) Display all the contents of the file in a tabular format with the first row being a header row.
2) write a file that is called StudentGPA.txt only the GPA from the read file.
3) Find out the average GPA
Afaf
0
Newbie Poster
Recommended Answers
Jump to PostThere are quite a few issues with your code... I will go through them one by one.
1) Invalid entry point
void main {
Is not the correct way to create your main function. The correct way is:
int main() { //code here …
Jump to Post^^Great advice, additionally attending classes and not leaving it to the last minute is another piece of great advice.
All 6 Replies
Kristian_2
11
Light Poster
tinstaafl
1,176
Posting Maven
Afaf
0
Newbie Poster
Afaf
0
Newbie Poster
Labdabeta
182
Posting Pro in Training
Featured Poster
iamthwee
commented:
loved the sandwich analogy
+14
iamthwee
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.