help with Student grades program

using array of structs

  • (2 Pages)
  • +
  • 1
  • 2

25 Replies - 14373 Views - Last Post: 12 December 2008 - 10:09 AM Rate Topic: -----

#1 Gamergirl22  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 08-December 08

help with Student grades program

Post icon  Posted 08 December 2008 - 09:11 PM

I need some help with my program. The program is supposed to read ID#'s for students as well as grades from a file called "grades.txt" After the program reads the the file it displays a menu as follows: 0. Publish(publish contents of file to output file called "report.txt"); 1. Search(program prompts user to enter ID and display the grades for that specific student); 2. Sort( ask user which field to sort records: valid fields are 0-7 and then print specific records in ascending order like user types 4 and shows all students Exam 2 grades); 3. Projected Grade(calculate official grade/display using formula: (quiz1+quiz2+exam1+exam2+assignment1+assignment2+assignment3)*0.1+((exam1+exam2)/2)*0.15+LAB =15 as well as display letter grade: A=90-100, B = 80-89, C= 70-79, D =60-69, F = <60); 4. Distribution(display number of A's, B's, C's, D's and F's in class based on students scores). The "grades.txt" file looks similar to this: 116807 65 31 41 19 15 72 11 // ID quiz1 quiz2 exam1 exam2 assignment1 assignment2 assignment3. This is my code so far:

 #include<iostream>
#include<fstream>
using namespace std;

struct students{
	   int ID;
	   int q1;
	   int q2;
	   int e1;
	   int e2;
	   int assg1;
	   int assg2;
	   int assg3;
	   };


int main(){
	
	int ID;
	char command;
	students grades[Num_grades];
	int i =0;
	int Num_Students = 65;
	while(!infile.eof()){
						 infile >> grades[i].ID;
						 infile >> grades[i].q1;
						  infile >> grades[i].q2;
						   infile >> grades[i].e1;
							infile >> grades[i].e2;
							 infile >> grades[i].assg1;
							  infile >> grades[i].assg2;
							   infile >> grades[i].assg3;
							   i++;
							   }
	
	ifstream infile;
	infile.open("grades.txt");
	
	ofstream outfile;
	outfile.open("report.txt");
	
	
	do{
		 cout << "0: Publish grade report" << endl;
		 cout << "1: Search for student grade by ID" << endl;
		 cout << "2: Sort grades" << endl;
		 cout << "3: Projected grade" << endl;
		 cout << "4: Distribute grades" << endl;
		 cout << endl;
		 cout << "Enter an operator: ";
		 cin >> command;
		 
		 switch (command) {
		   case '0':
				for(int j = 0; j<0;j++){
						outfile << grades[j];
						j++;
				}
		   break;
		   case '1':
				cout << "Enter an ID" << endl;
				cin << ID; 
				int searchList(int grades[], int Num_Students, int ID){
					int index = 0;
					bool found =false;
					while (index < Num_Students && !found){
						  if (grades[index] == ID){
											found = true;
											cout << grades[].q1;
											cout << grades[].q2;
											cout << grades[].e1;
											cout << grades[].e2;
											cout << grades[].assg1;
											cout << grades[].assg2;
											cout << grades[].assg3;
											}
											index++;
											}
											} 
				
		   break;
		   case '2':
				
		   break;
		   case '3':
				cout << "Enter an ID" << endl;
				cin >> ID;
				int LAB =15;
				 int searchList(int grades[], int Num_Students, int ID){
					int index = 0;
					bool found =false;
					while (index < Num_Students && !found){
						  if (grades[index] == ID){
											found = true;
											int total = (grades[].q1+grades[].q2
+grades[].e1+grades[].e2+grades[].assg1+grades[].assg2+grades[].assg3)*0.1 + ((grades[].e1+grades[].e2)/2)*.15 + LAB
											}
											index++;
											}
											if (total < 60){
													  cout << "You have an F" << endl;
													  else if(total <69)
													  cout << " You have an D" << endl;
													  else if(total < 79)
													  cout << "You have an C" << endl;
													  else if(total < 89)
													  cout << "You have an B" << endl;
													  else if( total <= 100)
													  cout << "You have an A" << endl;
													  
											} 
											}


I have not done case 0 or case 4 for yet because it is not complete. So, can anyone help me to see if I am going in the right direction or if something is wrong with the program? Also, I am supposed to store the data in an array of structs and manipulate it as the program requires.

Is This A Good Question/Topic? 0
  • +

Replies To: help with Student grades program

#2 n8wxs  Icon User is offline

  • --... ...-- -.. . -. ---.. .-- -..- ...
  • member icon

Reputation: 972
  • View blog
  • Posts: 3,878
  • Joined: 07-January 08

Re: help with Student grades program

Posted 09 December 2008 - 12:37 AM

Two things off the bat: 1) students grades[Num_grades]; Num_grades is undeclared, and 2) the do...while loop has no while(). :)

This post has been edited by n8wxs: 09 December 2008 - 12:39 AM

Was This Post Helpful? 0
  • +
  • -

#3 Linkowiezi  Icon User is offline

  • D.I.C Regular

Reputation: 58
  • View blog
  • Posts: 316
  • Joined: 07-October 08

Re: help with Student grades program

Posted 09 December 2008 - 01:54 AM

Num_grades not declared.

Can't read from the file before you open it.

'grades[j]' needs to have it's members here to if you are gonna ooutput it. Like you did with the infile above.
And do not 'j++' two times in a for loop.
...and btw, you should use something else than 0 if you want to utput something else than the first student.

'cin << ID;' should be 'cin >> ID;'

why do you have a function declaration here in the middle of your main file?
Put it above the main function and then call it like this 'searchList( grades, Num_Students, ID );'
And you can't use 'int grades[]' here, you have to use your struct. 'students grades[]'.
And in the if statement you need to check your ID against the student ID( 'grades[index].ID' ).
You also need to have a return statemnt in this function since it's an int.
My suggestion is 'return index;'.
It will return the wrong student as it is now, but toss in a break to get out of the while loop.
I will also tss in a check to se if we actualy found a student.
If we didn't we return -1.
And also, you need to put in 'index' in all the empty 'grade[]'.
Otherwise it won't know what to read from.

I guess you are gonna put in a sorting function in case 2 but it's empty atm.
You can always toss in an empty function in it that says "not implemented yet" in the utput so you don't forget it.
Easily done in larger projects, and always good to have some sort of output so you know if you accessed that part.

...and here you seem to have a second function declaration...
The same function actually.
That is something you can't do.
If you don't have diffrent agruments for it.
And you have to put all functions outside of the main function.
I'm gonna rename it 'sortList2' for the moment and toss it up above main.
And you can't use 'int grades[]' here neither, you have to use your struct. 'students grades[]'.
And in the if statement you need to check your ID against the student ID( 'grades[index].ID' ).
I will also toss in an extra if statement and return statements in it and remve the '{' after your 'if(total<60){'.
Otherwise it will give the wrong output.
I also moved your declaration of 'int total' so the rest of the function can use it.
And the same goes for this one as the last searchList function.
No empty 'grade[]', insert index here to.

Then you have no end for the switch(command) so I put in a 'default:' case so we can exit.

You also have no 'while()' at the end of your 'do' statement. and no end or return statement of the main function.

So I put in a 'bool exit = false' above the do and exit the do-while statement if you do not enter any of the above 'commands' atm 0-4.
And a 'return 0' and a '}' for the main function.

You also should maybe exit the program if the files you are trying to read doesn't exist.

And here's the changed code:
#include<iostream>
#include<fstream>
using namespace std;

struct students{
  int ID;
  int q1;
  int q2;
  int e1;
  int e2;
  int assg1;
  int assg2;
  int assg3;
};

int searchList(students grades[], int Num_Students, int ID){
  int index = 0;
  bool found =false;
  while (index < Num_Students && !found){
    if (grades[index].ID == ID){
      found = true;
      cout << grades[index].q1;
      cout << grades[index].q2;
      cout << grades[index].e1;
      cout << grades[index].e2;
      cout << grades[index].assg1;
      cout << grades[index].assg2;
      cout << grades[index].assg3;
      break;
    }
    index++;
  }
  if( found )
    return index;
  else
    return -1;
}

int searchList2(students grades[], int Num_Students, int ID){
  int LAB =15;
  int index = 0;
  bool found =false;
  int total = 0;
  while (index < Num_Students && !found){
    if (grades[index].ID == ID){
      found = true;
      total = (grades[index].q1+grades[index].q2
      +grades[index].e1+grades[index].e2+grades[index].assg1+grades[index].assg2+grades[index].assg3)*0.1 + ((grades[index].e1+grades[index].e2)/2)*.15 + LAB;
    }
    index++;
  }
  

  if( found ){
    if(total < 60)
      cout << "You have an F" << endl;
    else if(total <69)
      cout << " You have an D" << endl;
    else if(total < 79)
      cout << "You have an C" << endl;
    else if(total < 89)
      cout << "You have an B" << endl;
    else if( total <= 100)
      cout << "You have an A" << endl;

    return 1;
    }
  else
    return -1;
}

void sortList(){
  cout << "'sortList()' not yet implemented!" << endl;
}

int main(){
  
  int Num_grades = 65;
  
  int ID;
  char command;
  students grades[Num_grades];
  int i =0;
  int Num_Students = 65;
  
  ifstream infile;
  infile.open("grades.txt");
  
  while(!infile.eof()){
    infile >> grades[i].ID;
    infile >> grades[i].q1;
    infile >> grades[i].q2;
    infile >> grades[i].e1;
    infile >> grades[i].e2;
    infile >> grades[i].assg1;
    infile >> grades[i].assg2;
    infile >> grades[i].assg3;
    i++;
  }
  
  ofstream outfile;
  outfile.open("report.txt");
  
  bool exit = false;
  do{
  cout << "0: Publish grade report" << endl;
  cout << "1: Search for student grade by ID" << endl;
  cout << "2: Sort grades" << endl;
  cout << "3: Projected grade" << endl;
  cout << "4: Distribute grades" << endl;
  cout << endl;
  cout << "Enter an operator: ";
  cin >> command;
  
  switch (command) {
    case '0':
      for(int j = 0; j<0;j++){
        outfile << grades[j].ID;
  //      j++;
      }
      break;
      
      case '1':
      cout << "Enter an ID" << endl;
      cin >> ID; 
      if( searchList( grades, Num_Students, ID ) == -1 )
        cout << "This student doesn't exist!" << endl;
      break;
      
      case '2':
        sortList();
      break;
      
    case '3':
    cout << "Enter an ID" << endl;
    cin >> ID;
    if( searchList2( grades, Num_Students, ID ) == -1 )
      cout << "This student doesn't exist!" << endl;
    break;
    
    default:
      exit = true;
  
    }
  }while( !exit );
  return 0;
}


Still could use some good tweaking, but that's up to you.
Hope this was of any help :)
Was This Post Helpful? 0
  • +
  • -

#4 Gamergirl22  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 08-December 08

Re: help with Student grades program

Posted 09 December 2008 - 12:01 PM

Thanks, Linkowiezi I got most of it but something is still wrong. In " searchList2" the formula I had for computing the grade scores of students is wrong because I get "warning:converting int to double" and "expected expression before else" errors. So, this is the new code I have:
 #include<iostream>
#include<fstream>
using namespace std;

struct students{
	   int ID;
	   int q1;
	   int q2;
	   int e1;
	   int e2;
	   int assg1;
	   int assg2;
	   int assg3;
	   };
int searchList(students grades[], int Num_Students, int ID){
					int index = 0;
					bool found =false;
					while (index < Num_Students && !found){
						  if (grades[index].ID == ID){
											found = true;
											cout << grades[index].q1;
											cout << grades[index].q2;
											cout << grades[index].e1;
											cout << grades[index].e2;
											cout << grades[index].assg1;
											cout << grades[index].assg2;
											cout << grades[index].assg3;
											break;
											}
											index++;
											}
											if( found )
											   return index;
											else
											  return -1;
											}

int searchList2(students grades[], int Num_Students, int ID){
	int LAB =15;
	int index = 0;
	bool found = false;
	int total = 0;
	while (index < Num_Students && !found){
		  if (grades[index].ID == ID){
							   found = true;
							   total = (grades[index].q1+grades[index].q2
							   +grades[index].e1+grades[index].e2+grades[index].assg1+
							   grades[index].assg2+grades[index].assg3)*0.1 + ((grades[index].e1+grades[index].e2)/2)*.15 + LAB;
							 }
							 index++;
						   }
						   if( found ){
							   if (total < 60){
											  cout << "You have an F" << endl;
											  else if(total <69)
											  cout << " You have a D" << endl;
											  else if(total < 79)
											  cout << "You have a C" << endl;
											  else if(total < 89)
											  cout << "You have a B" << endl;
											  else if( total <= 100)
											  cout << "You have an A" << endl;
											  return 1;
											  }
										  else
											return -1;
							   }
void sortList(){
	 cout << "'sortList()' not yet initiated!" << endl;
	 }
						   
										 
											
				
int main(){
	
	int ID;
	char command;
	int Num_grades = 65;
	students grades[Num_grades];
	int i =0;
	int Num_Students = 65;
	
	ifstream infile;
	infile.open("grades.txt");
	
	while(!infile.eof()){
						 infile >> grades[i].ID;
						 infile >> grades[i].q1;
						  infile >> grades[i].q2;
						   infile >> grades[i].e1;
							infile >> grades[i].e2;
							 infile >> grades[i].assg1;
							  infile >> grades[i].assg2;
							   infile >> grades[i].assg3;
							   i++;
							   }
	ofstream outfile;
	outfile.open("report.txt");
	bool exit = false;
	
	
	do{
		 cout << "0: Publish grade report" << endl;
		 cout << "1: Search for student grade by ID" << endl;
		 cout << "2: Sort grades" << endl;
		 cout << "3: Projected grade" << endl;
		 cout << "4: Distribute grades" << endl;
		 cout << endl;
		 cout << "Enter an operator: ";
		 cin >> command;
		 
		 switch (command) {
		   case '0':
				for(int j = 0; j<0;j++){
						outfile << grades[j].ID;
						j++; 
				}
		   break;
		   
		   case '1':
				cout << "Enter an ID" << endl;
				cin >> ID;
				if( searchList( grades, Num_Students, ID ) == -1);
				cout << "Student not found!" << endl; 
				break;
		   case '2':
				sortList();
		   break;
		   
		   case '3':
				cout << "Enter an ID" << endl;
				cin >> ID;
				if( searchList2(grades, Num_Students, ID) == -1 )
				  cout << "Student not found!" << endl;
				break;
				
				default:
						exit = true;
						
						}
					 }while( !exit );								   
	
	infile.close();
	system("PAUSE");
	return 0;
}

:)
Was This Post Helpful? 0
  • +
  • -

#5 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6246
  • View blog
  • Posts: 24,014
  • Joined: 23-August 08

Re: help with Student grades program

Posted 09 December 2008 - 12:04 PM

If you're going to end up with a decimal, as you are in your total by virtue of the fact you're multiplying by 0.1, then your variable type for total needs to be a double, rather than an int.
Was This Post Helpful? 0
  • +
  • -

#6 Gamergirl22  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 08-December 08

Re: help with Student grades program

Posted 09 December 2008 - 08:56 PM

OK, now my formula works but I still get the "expected primary-expression before else" error. This time it is in my "else if(total < 69)" part. Am I supposed to have an expression before the else if statement?
Was This Post Helpful? 0
  • +
  • -

#7 janotte  Icon User is offline

  • code > sword
  • member icon

Reputation: 991
  • View blog
  • Posts: 5,141
  • Joined: 28-September 06

Re: help with Student grades program

Posted 09 December 2008 - 09:09 PM

View PostGamergirl22, on 9 Dec, 2008 - 07:56 PM, said:

OK, now my formula works but I still get the "expected primary-expression before else" error. This time it is in my "else if(total < 69)" part. Am I supposed to have an expression before the else if statement?


This is usually caused by a missing or misplaced brace " { " or " } ".

Have a look to make sure all your braces around that line are in the right place. If you can't see the problem post your new code so we can help you more.
Was This Post Helpful? 0
  • +
  • -

#8 Linkowiezi  Icon User is offline

  • D.I.C Regular

Reputation: 58
  • View blog
  • Posts: 316
  • Joined: 07-October 08

Re: help with Student grades program

Posted 10 December 2008 - 12:28 AM

I believe it is here you have a '{' to much: if (total < 60){
Remove the '{' at the end of that line and you'll be fine ;)
Was This Post Helpful? 0
  • +
  • -

#9 janotte  Icon User is offline

  • code > sword
  • member icon

Reputation: 991
  • View blog
  • Posts: 5,141
  • Joined: 28-September 06

Re: help with Student grades program

Posted 10 December 2008 - 02:45 AM

View PostLinkowiezi, on 9 Dec, 2008 - 11:28 PM, said:

I believe it is here you have a '{' to much: if (total < 60){
Remove the '{' at the end of that line and you'll be fine ;)


This is the code segment that Linkowiezi is referring to:
							   if (total < 60){
											  cout << "You have an F" << endl;
											  else if(total <69)
											  cout << " You have a D" << endl;
											  else if(total < 79)
											  cout << "You have a C" << endl;
											  else if(total < 89)
											  cout << "You have a B" << endl;
											  else if( total <= 100)
											  cout << "You have an A" << endl;
											  return 1;
											  }
										  else
											return -1;




My concern with the advice above it if you remove the " { " as suggested that seems to leave a dangling " } " later that you need to also deal with.

A better approach than either of these options in to replace that complicated jumble of if-else statements with a switch() control instead.

Have a read here:
http://www.cplusplus...al/control.html
and you'll see that a switch is both easier to write and far easier to debug.
Was This Post Helpful? 0
  • +
  • -

#10 Linkowiezi  Icon User is offline

  • D.I.C Regular

Reputation: 58
  • View blog
  • Posts: 316
  • Joined: 07-October 08

Re: help with Student grades program

Posted 10 December 2008 - 02:59 AM

@ janotte
Yes, that's the code segment I refered to.
But no I think it's just an extra ' { ' there that shouldn't be there.
Don't think it leave any dangling ' } ' later on.


EDIT:
It's just messy indentation.
if( found ){
  if (total < 60){  //  This { should be taken away
    cout << "You have an F" << endl;  // or you could add a } after the ; on this line
  else if(total <69)
    cout << " You have a D" << endl;
  else if(total < 79)
    cout << "You have a C" << endl;
  else if(total < 89)
    cout << "You have a B" << endl;
  else if( total <= 100)
    cout << "You have an A" << endl;
  return 1;
}
else
  return -1;

This post has been edited by Linkowiezi: 10 December 2008 - 03:01 AM

Was This Post Helpful? 0
  • +
  • -

#11 janotte  Icon User is offline

  • code > sword
  • member icon

Reputation: 991
  • View blog
  • Posts: 5,141
  • Joined: 28-September 06

Re: help with Student grades program

Posted 10 December 2008 - 03:03 AM

I see 2 * { and 2 * } here:

Or am I not looking at a big enough chunk of the code?

						   if( found ){
							   if (total < 60){
											  cout << "You have an F" << endl;
											  else if(total <69)
											  cout << " You have a D" << endl;
											  else if(total < 79)
											  cout << "You have a C" << endl;
											  else if(total < 89)
											  cout << "You have a B" << endl;
											  else if( total <= 100)
											  cout << "You have an A" << endl;
											  return 1;
											  }
										  else
											return -1;
							   }



Was This Post Helpful? 0
  • +
  • -

#12 Linkowiezi  Icon User is offline

  • D.I.C Regular

Reputation: 58
  • View blog
  • Posts: 316
  • Joined: 07-October 08

Re: help with Student grades program

Posted 10 December 2008 - 03:15 AM

Let's look at the whole function as it is with better indentation:
int searchList2(students grades[], int Num_Students, int ID){
  int LAB =15;
  int index = 0;
  bool found = false;
  int total = 0;
  while (index < Num_Students && !found){
    if (grades[index].ID == ID){
      found = true;
      total = (grades[index].q1+grades[index].q2
      +grades[index].e1+grades[index].e2+grades[index].assg1+
      grades[index].assg2+grades[index].assg3)*0.1 + ((grades[index].e1+grades[index].e2)/2)*.15 + LAB;
    }
    index++;
  }
  if( found ){
    if (total < 60){
      cout << "You have an F" << endl;
      else if(total <69)
        cout << " You have a D" << endl;
      else if(total < 79)
        cout << "You have a C" << endl;
      else if(total < 89)
        cout << "You have a B" << endl;
      else if( total <= 100)
        cout << "You have an A" << endl;
      return 1;
    }
    else
    return -1;
  }

This won't work since it has a dangling }.
That's why it needs to be removed.
EDIT: And also look at the else if after the if.

This post has been edited by Linkowiezi: 10 December 2008 - 03:17 AM

Was This Post Helpful? 0
  • +
  • -

#13 janotte  Icon User is offline

  • code > sword
  • member icon

Reputation: 991
  • View blog
  • Posts: 5,141
  • Joined: 28-September 06

Re: help with Student grades program

Posted 10 December 2008 - 03:32 AM

Yes you are completely correct and I'm dead wrong.

I worked it out about a minute after posting my bad contribution but couldn't get back into the page fix it. Lag only happens when it's important <haha>.

Apologies for wasting your time

But I do stand behind the suggestion that this would be better written as a switch() than a series of if-else statements.

(Some more explicit commenting of the code wouldn't go astray either.)
/***********************************************************
** Function - numberOfAngels							  **
**   Calculates the number of angels that can comfortably **
**	 fit on the head of the pin of size passed in.	  **
***********************************************************/
int numberOfAngels( double pinHeadSize )
{
	// nifty and clever code
	return angelNumber;
} // end numberOfAngels()



Takes a bit of time and space but something along those lines really helps people reading the code.

This post has been edited by janotte: 10 December 2008 - 03:34 AM

Was This Post Helpful? 0
  • +
  • -

#14 Linkowiezi  Icon User is offline

  • D.I.C Regular

Reputation: 58
  • View blog
  • Posts: 316
  • Joined: 07-October 08

Re: help with Student grades program

Posted 10 December 2008 - 04:26 AM

View Postjanotte, on 10 Dec, 2008 - 10:32 AM, said:

I worked it out about a minute after posting my bad contribution but couldn't get back into the page fix it. Lag only happens when it's important <haha>.

Lol, completly agree! :P

View Postjanotte, on 10 Dec, 2008 - 10:32 AM, said:

But I do stand behind the suggestion that this would be better written as a switch() than a series of if-else statements.

Yes, it takes up a little more space, but why not.
Really up to the person who writes it, but personly I'm quite fond of switches myself.

View Postjanotte, on 10 Dec, 2008 - 10:32 AM, said:

(Some more explicit commenting of the code wouldn't go astray either.)
/***********************************************************
** Function - numberOfAngels							  **
**   Calculates the number of angels that can comfortably **
**	 fit on the head of the pin of size passed in.	  **
***********************************************************/
int numberOfAngels( double pinHeadSize )
{
	// nifty and clever code
	return angelNumber;
} // end numberOfAngels()



Takes a bit of time and space but something along those lines really helps people reading the code.

Oh, yes! You shuld defenetly comment much much more!
...at all times.
Even when you think evrything is obvious.
Me and a friend started making a monpoly like game or if you have better reference the game is realy called Hotel.
We started out making it a text based game and wrote different parts of it.
Then we had a good break because neither of us had any time to put on it.
We resumed it a while ago and decided to go for a more graphical approach so I jumped on the SDL library since we need to have it cross platform since I use mostly Windows and my friend mostly Linux and also now in the beging easy to code and understand. And we agreed that he should work on some stuff that had been on my shoulder before so I tossed a bunch of files at him.
And he didn't even have to think about anything. He actually commented that my comments made it feel like he actually had just written everything himself and he didn't even have to go trough the code anything by himself just expanding the functions and also easily implementing new ones.
(I had pretty much commented everything that happend)
It was also good because I remembered stuff myself, it's so easy to forget if you go away for just a coupple of weeks and this was half a year or more.

Conclusion: Everyone should comment more! :D
Was This Post Helpful? 1
  • +
  • -

#15 janotte  Icon User is offline

  • code > sword
  • member icon

Reputation: 991
  • View blog
  • Posts: 5,141
  • Joined: 28-September 06

Re: help with Student grades program

Posted 10 December 2008 - 05:14 AM

View PostLinkowiezi, on 10 Dec, 2008 - 03:26 AM, said:

And he didn't even have to think about anything. He actually commented that my comments made it feel like he actually had just written everything himself and he didn't even have to go trough the code anything by himself just expanding the functions and also easily implementing new ones.
(I had pretty much commented everything that happend)
It was also good because I remembered stuff myself, it's so easy to forget if you go away for just a coupple of weeks and this was half a year or more.


Brilliant example!!

Those who have read this far down this thread might be interested in the ideas here:
http://www.literateprogramming.com/
(if you are studying CompSci and don't know who Donald Knuth is then it's time you found out).
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2