Ironworks Gaming Forum

Ironworks Gaming Forum (http://www.ironworksforum.com/forum/index.php)
-   General Conversation Archives (11/2000 - 01/2005) (http://www.ironworksforum.com/forum/forumdisplay.php?f=28)
-   -   C++ Question (any advice?) (http://www.ironworksforum.com/forum/showthread.php?t=81498)

/)eathKiller 09-26-2002 01:17 PM

Alright alright I should've picked HTML or some other language I was at least half-familiar with to start this project off but some of their machines were so old that they were only running DOS, oh right i'll tell you the full story first...

mmmkay... So this local school has just received word that they will have to work their grades out electronically, i've got a great system worked out, but the program has to exit everytime a new grade is entered to a main index of a student. I used Visual C++ because it seemed like a good idea at the time and I knew a littl ebit of it... basically, what I'm asking is... What is the alternative to saying end1; where as it would repeat the program again, from the start, while also retaining the original output...

As an example: If student 01 had a 87.5 on a grade, it would list their name, class, grade, assignment, everything, and THEN it says "press any key to continue" and up and exits the main program. I know there must be a way to enter Suzy's information and Carl's too, one after the other, and then have the read outs listed alphabetically or by highest grade % . . . I was basically chosen for this task because I'm supposed to be the expert around here but gosh darnit i wasn't made for writing DOS programs! If anybody might have a clue as to how to continue the program running, pleeeeease, I could really use a bit of help here, infact everyone here could [img]tongue.gif[/img]

And If not i'll just begin the daunting task anew, perhaps HTML will read in some version of DOS (who'm I kidding?...)

andrewas 09-26-2002 02:24 PM

Sigh, homework problems. Oh wait, your saying your doing this for real? Odd, but never mind. Post your algorithms and such, for preferance your main() as well.

I cant work in Visual C++ (cant afford it), but you should be able to use an array[] to store the details and work with them later.

T/-/alali 09-26-2002 04:09 PM

Where did you get c++ I've been looking all over for it.

andrewas 09-26-2002 04:15 PM

Quote:

Originally posted by T/-/alali:
Where did you get c++ I've been looking all over for it.
The only free (technicaly its GPL) c++ compiler i know of is djgpp.

Its a bit of a pain to setup though. Search for it. DOS only, not windows. Its actualy the same compiler they wrote Quake 1 in.

/)Deathkiller.

Assuming this is a real problem and not homework, itd be easier to use Excel or another spreadsheet package to solve this problem.

Night Stalker 09-26-2002 04:27 PM

You are talking about a simple database app here. MS Access would lend itself nicely to quickly get you up and running. No real need to recreate the wheel and redeisgn a database. I wouldn't recomend Access for big time critical information but it sounds reasonable in this case. The code within Access is a watered down VB (VB Visual Basic for Applications). Access will handle the database and you can code and store your interface (forms and reports) within the same .mdb file.

Note: Not a plug for M$. I only use Access for prototyping and small scale stuff. I think it's way to buggy for larger apps.

andrewas 09-26-2002 05:12 PM

Access for what sounds like a flatfile database is overkill. And Visual Basic is evil, in whatever form. Excel is probably the easiest way to go. And also has VBA built into it.

C++ can do it though. Post the complete specification of the problem and Ill see if I can be a bit more helpful.

/)eathKiller 09-26-2002 07:06 PM

Quote:

Originally posted by andrewas:
Deathkiller.
Assuming this is a real problem and not homework, itd be easier to use Excel or another spreadsheet package to solve this problem.[/QB]
Yeah I sort of realized that and decided the teachers with older comps would just have to get something with excel on it and made a datasheet that works just fine... took me most of the afternoon tho to set it to their "Specifications" -_-

/)eathKiller 09-26-2002 07:27 PM

Quote:

Originally posted by T/-/alali:
Where did you get c++ I've been looking all over for it.
A fairly expensive program called "Microsoft Visual C++" I bought it knowing that there would come times when a compilor for DOS related code would come in handy, I sort of hoped I could end up using it but let's face it... If Microsoft did anything right it was Office... and IE [img]tongue.gif[/img]

flibulzbuth 09-26-2002 09:43 PM

Gee! Visual C++ is a breeze to use, the latest version at least. If you're masochist or broken, you can download the borland compiler for free from borland.com.

Why don't you enter all the info in a matrix (struct in C)?

number of rows = number of students

1rst column: the names

number of columns = number of results + 1 (total or average) + 1 (name, the 1rst column).

This would work well only if the total/average is always calculated in the same way. Otherwise you would have to ask the user how much each result count on the final grade (ADD a row in your matrix for it, so # of row = # of students + 1).
ie.
test 1 = .3 of the final grade
test 2 = .1
test 4 = .2
test 5 = .5

First ask for the number of students and the number of exams. Define the size and type of your matrix.

Second, ask for value of each exam on the final grade.

Create a first sub where you ask for each of the n student names, one by one.
You might want to do another sub where the user can check for any mistake he could have made and correct them.

Then do another sub where the user enters results, either of one column (exam after exam) or one row (students after students). Again, you can have a nice little sub where the user can double check and correct his input.

Do the maths, export matrix with final grade to text file. (I don't know how to save and retrieve info, but it should be easy to convert to and from a text file.)

[ 09-26-2002, 09:46 PM: Message edited by: flibulzbuth ]

/)eathKiller 09-26-2002 11:43 PM

um... thanks... now... If ya' don't mind... what's the command you'd place instead of end1; to make it go back to the begging again and start over like resetting DOS or something wihtout actually restarting the computer... I'd like to know for future reference :D

Thanks for the tips... I used my own kind of matrix tho [img]tongue.gif[/img] a spreadsheet :D turned out to be a lot easier for ME and for the teachers to use...


All times are GMT -4. The time now is 07:52 PM.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
©2024 Ironworks Gaming & ©2024 The Great Escape Studios TM - All Rights Reserved