Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

C# help

Options
  • 20-10-2004 9:00pm
    #1
    Closed Accounts Posts: 807 ✭✭✭


    been a uni for a couple of weeks and already they have loaded a bloody assisgnment onto us

    we havent been told much of it, we are expected to lean ourselves, it seems that quite a few people are struggling so frantically searching round google as it has to be done for friday :rolleyes:

    ive been stuck on something in my program now for a few days and cant for the life of me find a way round it :rolleyes:

    i have an array it stores scores and names of cricketers, i have to put 11 in

    at the end i am to display the highest score , how many achieved this score and who scored it

    im pretty sorted if i only want 1 person to be displayed, however i cant get it to display more than 1, i can make it acknowledge that more than 1 person has it, but when it comes to displaying it on the screen, i either get a mass of errors, i get the first highestscorers name twice, or every name twice :rolleyes:

    is anyone pretty good with C# who can help me out, its only a first year project so it probably sortable in a couple of minutes by anyone that knows wot they are talking out, but i dont ...coz ive never programmed properley before :(

    any help would be much appreciated, any help tonight would be GREATLY appreciated as tomorrow i ideally need to start on the write ups..(which i cant imagine taking long..but i want this damn thing sorted )


Comments

  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    ViperVenoM wrote:
    we are expected to lean ourselves

    Surprisingly, they do stop spoon feeding you when you leave secondary school. They also expect inititive to be shown.

    Now, why don't you help us help you, and show us what you've done already?


  • Registered Users Posts: 6,762 ✭✭✭WizZard


    Your code so far would be a help, definitely. They do expect you to learn yourselves, after all, Google will not be able to answer all your questions later on.


  • Registered Users Posts: 15,443 ✭✭✭✭bonkey


    ViperVenoM wrote:
    at the end i am to display the highest score , how many achieved this score and who scored it

    im pretty sorted if i only want 1 person to be displayed, however i cant get it to display more than 1, i can make it acknowledge that more than 1 person has it, but when it comes to displaying it on the screen, i either get a mass of errors, i get the first highestscorers name twice, or every name twice :rolleyes:
    If you've gotten that far, you're almost there. Sounds like you've no problem with the programming...its just a case of the logic of how to solve the problem which is missing.

    At a guess you're storing the name of the highest scorer in a string.

    Consider just appending each name together (with spaces) into one long string when the score matches, and just assigning the name when the score is greater. Alternately, you can use an array of strings to hold the top names, initialising a new array on a new highscore, or just adding to the end of the array when the score is equal to the greatest.

    I don't know if either is acceptable in terms of what you're supposed to be able to do, but they should at least give you food for thought. The big step is figuring out how to solve the problem. After that, writing the code should be easy enough...

    jc


  • Closed Accounts Posts: 807 ✭✭✭ViperVenoM


    im quite confused as how you mean im suppose to take initiative ..but im not suppose to use google?...theres nothing else that CAN help me!..had like 5 lectures on it and then this!, they dont tell me anything relavant to arrays, just to use them, they havent suggested any books to read, our uni has meant to have 1 of the largest libs in europe i went to the programming bit to be greeted by 100000000 of c# books, read a few but they are only actually telling me how to do other things..not something that focuses on this..

    spent £50 on a book..which didnt help

    but aside from all that

    i had it posted on my uni forum and i also got a reply along the lines of "initialising a new array on a new highscore" like you suggested, and...after adding the few little changes..my code "appears" to now be working! so thanks for that!
    :D

    if i run across any more trouble ill have to post my code next time then ;)


  • Registered Users Posts: 43,907 ✭✭✭✭Basq


    I know how you feel ViperVenom!

    Though i'm in my 3rd year - i've doing Visual Basic and Java before but i've only started C# this year. It's quite tricky to get into but not too difficult!

    Just wait til you approach GDI+ - it's well tricky!


  • Advertisement
  • Closed Accounts Posts: 807 ✭✭✭ViperVenoM


    oh great..i cant wait :rolleyes:

    ;)


  • Registered Users Posts: 15,443 ✭✭✭✭bonkey


    ViperVenoM wrote:
    im quite confused as how you mean im suppose to take initiative ..but im not suppose to use google?

    No-one said not to use google.
    ...theres nothing else that CAN help me!..
    Sure there is. Learning the stuff, as opposed to looking for a pre-made solution will help you. This is what the google comment was about.
    had like 5 lectures on it and then this!, they dont tell me anything relavant to arrays, just to use them,
    If you know what an array is, and you've already figured out how to store the various cricket-scores etc. in an array, and how to then read the array back to do your calculations, then you already know everything you need to know about arrays to do this project.

    I don't see the problem....either you figured this stuff out, or you were taught it, but in either case, the lecturer doesn't seem to have asked for something unreasonable.

    Look - in primary and secondary school, the teacher's job is to teach. In Uni, the lecturer's job is to give you the opportunity to learn. There's a subtle difference there, but mostly it boils down to the fact that in Uni you have to learn how to learn stuff for yourself.....cause that's how its gonna work in the real world too.
    they havent suggested any books to read,
    Well, maybe asking ppl here for suggestions would be a help?
    read a few but they are only actually telling me how to do other things..not something that focuses on this..
    Focusses on what? On arrays? I don't know of a single programming book on any programming language which donates more than a handful of pages to arrays and other such "fundamental" concepts. Maybe some of the Dummies series do, but I've never read one.

    To be honest...arrays are trivial things to deal with. There is no reason for a book to focus on them.
    i had it posted on my uni forum and i also got a reply along the lines of "initialising a new array on a new highscore" like you suggested, and...after adding the few little changes..my code "appears" to now be working! so thanks for that!
    No problem. What you seemed to be missing was - like I said - the "how to solve the problem" bit, not the "using c#' bit....if you see what I mean.

    jc


  • Registered Users Posts: 950 ✭✭✭jessy


    look into for and while loops.


  • Closed Accounts Posts: 807 ✭✭✭ViperVenoM


    yeh ok point taken ;)


    i know the program isnt hard..its only 180 lines its just understanding it :rolleyes:


    now i need to set up 3 try catch..thingys and my program will be finish!..w00t finish line is approaching

    and thx for the tip on for and while, we only just got told about them so ive got a few of them in my program now :D


Advertisement