Thread: Program to create a points schedule for a sport

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    1

    Program to create a points schedule for a sport

    Can someone please hep me write this program in C?
    This programwill keep track of win-tied-loss and points earned records for team. There are 6 teams and each week there are three games (one game per team perweek) Enter the team numbers and game scores in an array within theprogram rather than user typing at command prompt.

    Afterreading in each week, the program should print out the win-tied-loss recordsand points earned for each team. A win is two points, tied game is onepoint and a loss is zero points. For example:

    How manyweeks of data: 3


    For week 1,game 1, enter the two teams and the score: 0 1 1 4
    For week 1, game 2, enter the two teams and the score: 2 3 1 2

    For week 1,game 3, enter the two teams and the score: 4 5 2 0

    For week 2, game 1, enter the two teams and the score: 0 2 3 0
    For week 2, game 2, enter the two teams and the score: 1 4 0 1

    For week 2,game 3, enter the two teams and the score: 3 5 4 4


    For week 3,game 1, enter the two teams and the score: 0 4 8 7
    For week 3, game 2, enter the two teams and the score: 1 5 0 0

    For week 3,game 3, enter the two teams and the score: 2 3 6 9

    League Standing after 3 weeks:


    W
    T
    L
    Team 0
    2
    0
    1
    Team 1
    1
    1
    1
    Team 2
    0
    0
    3
    Team 3
    2
    1
    0
    Team 4
    2
    0
    1
    Team 5
    0
    2
    1
    Points Table:

    Team3 5
    Team 0 4

    Team4 4
    Team1 3
    Team5 2
    Team2 0



    Modify toadd the winning percentage for each team.
    Modify tocompute and print for each team the total points scored for and against.

  2. #2

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Welcome to the forum, Hamma!

    It's up to you to get your program started, in code or pseudo code. THEN post up what you've got questions or problems with, and we will try to assist.

    So get cracking, and let us know if you have been taught structs yet, since that is one way to make this work. You might want to recall that char's are just numbers with a small range.

    If you printf("%c", 65), you see a char. If you printf() the same char variable with %d, 64, you'll see a number.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ Plot Simple Points / Graph, X & Y array points
    By Khadafi in forum C++ Programming
    Replies: 9
    Last Post: 11-11-2011, 03:47 AM
  2. Schedule Loan program?
    By Extrovert in forum C++ Programming
    Replies: 2
    Last Post: 04-22-2005, 05:29 PM
  3. Programming Sport?
    By Mecnels in forum Game Programming
    Replies: 4
    Last Post: 04-29-2003, 04:16 PM
  4. best sport
    By bob20 in forum A Brief History of Cprogramming.com
    Replies: 51
    Last Post: 11-27-2002, 10:54 PM
  5. The coolest sport.....
    By Aran in forum A Brief History of Cprogramming.com
    Replies: 37
    Last Post: 12-14-2001, 05:35 PM