Archived

This topic is now archived and is closed to further replies.

Help with Newbie Homework

This topic is 5501 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Here are the details of the program: "Requirements: Calculate the handicap of two bowling teams using functions. Details: Each team, designated by a capital letter, is made up of FIVE players. The handicap between two teams is awarded to the team with the lower avg., and is calculated as: 0.8 * (team Aavg. - team Bavg.) if team B has the lower avg. The result is ROUNDED to the nearest integer. You will first write a FUNCTION to calculate a player average in the following way: read the number of games previously bowled by the player from the keyboard. If this number is less than three, the player''s avg. is taken as 120. Otherwise, read all the values, and return the player''s avg. as a decimal value. This function prompts for input by asking for the player scores for a team BY NAME. Using calls to this function for every player on the two teams, write a program to calculate the handicap between two teams, and print the team names, the handicap, and which team receieves it. Extra Credit: Also write a function to calculate the team avg. This function will call the function to get the five player avgs." ------ Now, my problem is how to get the function to read all the values, and return the player''s avg. as a decimal value. It''s probably because it''s late and I''m tired, but I''m stuck there. Also how would I compare the two values between the two team avg''s. The answer is probably obvious, but it''s not clicking in for me. Thanks for any help.

Share this post


Link to post
Share on other sites
this is not the place to ask people to do your homework for you, i wouldnt be surprised if no one helped you, i dont mean to be offensive but its true, you have to learn how to do your own homework, and your in a world of shit if thats college or university homework cause u should know all of this already

,Matt

-= kill one your a murderer, kill thousands your a conquerer =-

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Um...for starters don''t try coding a solution to a programming problem when you are tired. It will only lead to an endless debugging nightmare and a really bad headache.

Second, the questions you are asking sound like they might already be answered in the chapter of your textbook you are currently studying (my guess is functions?).

Thirdly, returning a value is accomplished in several ways. Probably the best way is to make your function of type ''double'' or ''float'' (since you need to return a ''decimal'' value as you call it), and return a local var of the same type (i.e. double answer; ... <code> ...; return answer

As for the comparisons you are to make, I might not be understanding your question fully, but I would say you might use the comparison operators? (>, <, !=, ==, etc...).

Hope this helps ya out. I''m with the other dude though...don''t post hw problems here and expect people to do your hw for you...

-Q

"How long have you been playing Nark of the Garfunk dude?"
- Jay

Share this post


Link to post
Share on other sites
never call yourself a "Newbie" and never include these words in the title of your post "homework"(!!!) "please", "help me", "HEELLLPPPPP!!!" cause you are risking yourself to be flamed by evil people


[edited by - xaxa on November 18, 2002 11:23:46 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
...yeah, at least, those of us out there who have learned the newb lesson of trying to code half-assed and at the last minute, and now we are seeing other newbies make the same mistake!!!



-Q

Share this post


Link to post
Share on other sites
quote:
Original post by samosa
this is not the place to ask people to do your homework for you,


He isn''t asking for anyone to do his homework for him, he''s aksing for help with part of it and there''s nothing wrong with that. In fact asking for help is a good thing. I don''t know how the system works in other contries but where I live it''s a REQUIERMENT to know where to look for help and information.

Share this post


Link to post
Share on other sites
And ignore the APs (Anonymous Posters), because they are usally full of crap and are afraid of posting under their screen name in order to remain anonymous when posting something they consider might ''stain'' their otherwise non-existant reputation

LibGDN - By developers, for developers

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Programmer One
Make the function recursive.


...gee, that makes it all clear now doesn''t it? :-P

No offense dude, but someone with the name "Programmer One" trying to tell this guy to ignore what I said because I am

quote:
usually full of crap


is just so stupid it''s funny. You must be one of those people who waits until the last minute to do programming assignments as well.


-Q

Share this post


Link to post
Share on other sites