For my semester 2 programming assignment I wrote a program that reads in a file (html), and checks that the html tags are in lower case, and if not converts them to lower case. Also we have to ensure comments and strings are left unchanged.
I have written the program but just wanted to get some feedback on how I could improve it??
Any chance I could e-mail someone to have a look at it? I don't want to divulge it on the forum just yet because of obvious reasons.
So if you fancy a laugh just leave me your e-mail address and ill send it to you!
hey mcleano and eker thanks for the replys! I saw that post earlier, i got mine to run correctly, but i need to find out what i can make into functions. Now i know thats not the way its supposed to be done, but I dont think i could write a whole new program from stratch. It would make my head go boom. hehe.
Its probably the opposite of forum ethics but its my uni project and it may not be amazing, but its my work, and I dont want anyone to take credit for my hardwork. So sorry dont wanna post it up. But like I said, if anyone wants a copy e-mailed I will do, just wants some feedback. So any takers?
And then copy-paste all of the code from your original program into that function.
Then identify the variables that need to be passed in and what needs to be returned.
A short example:
1 2 3 4 5 6
// Normal code
//int main.. and all the other stuff
int number1;
cout << "Enter a number: ";
cin>> number1;
// some code to double the number
The code above could be converted to:
1 2 3 4 5 6 7 8
// Function code
void getNumber(int& number1)
{
cout << "Enter a number: ";
cin >> number1;
number1 *= 2;
}
Then you could call that function from main.
It shouldn't take too much effort to convert your code into functioned-code.