7 Replies - 957 Views - Last Post: 11 October 2012 - 06:57 AM

#1 kezzapwnz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 09-October 12

Creating a Table to organise results for my Sports Competition

Posted 09 October 2012 - 09:14 PM

Hey so pretty much, I am looking at creating a program using C which will enable me to keep track of our Universities Quidditch tournament. There will be 10 teams competing, with each team playing each other once.

What i want to do is:

1.Create a table which will keep track of the games-played/wins/losses/points for/points against (possibly a net points column too)

2.Have the table arrange in order after each match who has the most points (3 for a win, 1 for a draw)

3. If teams are level on points then have the table organise by 'points net' and then again alphabetically (im assuming i will use an if else statement to do this)

what i have worked out to do so far
I know that i need to define my variables including team names, games played, wins, loses, draws, points scored, points conceded.

*I have created 2 '.dat' files.
The first is simply a list of all the quidditch team names in alphabetical order. (will remain a constant)
The second is a list of mock game results presented in the form:* "Snitchgrabbers 170 BartyBeaters 140 (continuing like this as each game result is added)

Where i need help

I am stuck on a few things. Firstly how i go about importing both of these files (I am using Microsoft Visual Basic) Atm the best i can come up with is this code:
[
" int input_status;
FILE  * fp;

fp = fopen("U:\\input1.dat","r");

if (fp==NULL)

printf("Unable to open the file");


" Furthermore, once i have these files imported i am not sure what loops i need to use to achieve what i want to achieve!*
I should mention i have basic knowledge in C coding and how loop constructs work.. I am a primary teacher so it isn't near the knowledge you guys have :)

I know that i am asking for a lot of help and i would be happy to make it up to anyone at all who is willing to spend some time to help me.. e.g. payment or a feature in our quidditch documentary which is being published... I will also give credit to you in the code for any help which is received.

Is This A Good Question/Topic? 0
  • +

Replies To: Creating a Table to organise results for my Sports Competition

#2 jimblumberg  Icon User is online

  • member icon


Reputation: 4222
  • View blog
  • Posts: 13,239
  • Joined: 25-December 09

Re: Creating a Table to organise results for my Sports Competition

Posted 09 October 2012 - 09:45 PM

Is there a reason you have selected C? You state you are using Visual Basic, why not write the program in that language?

Now since you seem to be willing to pay someone to create this program may want to consider other languages as well. Maybe C++, C#, Java, or Visual Basic.

If you don't have any actual programming questions tell me and I'll move this to either post a job or share your project forums.


Jim

This post has been edited by jimblumberg: 09 October 2012 - 09:46 PM

Was This Post Helpful? 0
  • +
  • -

#3 kezzapwnz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 09-October 12

Re: Creating a Table to organise results for my Sports Competition

Posted 10 October 2012 - 01:26 AM

Hey Jim thanks for the quick reply!

I am using C because that's the only code i have some knowledge in so i would like to further my knowledge in it. Furthermore, as this code would need to be updated with scores every week, using C and the design i have outlayed (the 2 .day files) seemed the easiest way to manage it!

I am using Microsoft Visual Studio 2010 (not basic like i previously stated).

I'd like either some help or advice on how to design the code for this (as stated in OP) i have some idea what i have to do but there are large gaps in my knowledge which i cant find info for online.

However i would be willing to pay for it to be made or help given if thats what i need to do, but being a poor uni student i doubt i would be able to afford the cost a code costs. :/ (Teaching isnt a high paying career!)
Was This Post Helpful? 0
  • +
  • -

#4 aresh  Icon User is offline

  • It's a 16-Bit World!
  • member icon

Reputation: 273
  • View blog
  • Posts: 4,176
  • Joined: 08-January 12

Re: Creating a Table to organise results for my Sports Competition

Posted 10 October 2012 - 03:26 AM

Well, if you are willing to make it yourself, then it will be great :)


My advice would be start making the program, and then ask questions when you get stuck.
Was This Post Helpful? 0
  • +
  • -

#5 jimblumberg  Icon User is online

  • member icon


Reputation: 4222
  • View blog
  • Posts: 13,239
  • Joined: 25-December 09

Re: Creating a Table to organise results for my Sports Competition

Posted 10 October 2012 - 06:08 AM

Quote

I am using C because that's the only code i have some knowledge in so i would like to further my knowledge in it.

Okay, then C it is.

Quote

Furthermore, as this code would need to be updated with scores every week, using C and the design i have outlayed (the 2 .day files) seemed the easiest way to manage it!

The code should not need to be updated, you should be updating the data, but the program code should stay the same. You would use some kind of data files to hold the previous data that you enter, but the program code would be static.

Quote

I'd like either some help or advice on how to design the code for this (as stated in OP) i have some idea what i have to do but there are large gaps in my knowledge which i cant find info for online.

Then, I too recommend that you start designing your program and when and if you need advice post the relevant information and ask specific questions.

Jim
Was This Post Helpful? 0
  • +
  • -

#6 baavgai  Icon User is online

  • Dreaming Coder
  • member icon

Reputation: 5901
  • View blog
  • Posts: 12,804
  • Joined: 16-October 07

Re: Creating a Table to organise results for my Sports Competition

Posted 10 October 2012 - 06:34 AM

The easiest way would be to use a database. If you want to stay C, then look into sqlite. A bunch of dat files is kind of last century.

If you really like dat files, then make sure you're using some kind of struct as an underlying type. If the struct has no pointers, you can just dump an array of struct in a single write. You can actually store everything in a single file, using a pattern of numberOfObjects,objects,numberOfObjects,objects,...
Was This Post Helpful? 0
  • +
  • -

#7 kezzapwnz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 09-October 12

Re: Creating a Table to organise results for my Sports Competition

Posted 10 October 2012 - 10:06 PM

Quote

The code should not need to be updated, you should be updating the data, but the program code should stay the same. You would use some kind of data files to hold the previous data that you enter, but the program code would be static.


That is what i meant! :)

I'm not a good coder at all so ive tried to create it but i just get constant errors!
I would be happy to pay someone to make it or help me make it. Just message me and let me know the cost if you want to charge.
Was This Post Helpful? 0
  • +
  • -

#8 jimblumberg  Icon User is online

  • member icon


Reputation: 4222
  • View blog
  • Posts: 13,239
  • Joined: 25-December 09

Re: Creating a Table to organise results for my Sports Competition

Posted 11 October 2012 - 06:57 AM

Okay, since you want to pay someone to do this I'll move the topic to the Post a Job forum.

Jim
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1