Hello, this is my first post on these forums. I'm taking a CPSC 100 course to supplement the science part of my degree, and I've been having a lot of trouble since the midterm, when the profs for the class switched (they have completely different teaching methods). Since then, I've been lost.
I've got some questions that are due within the next 24 hours, and I've given up tampering with them myself, and I can't find anyone around here for help. Thus I find myself on these forums.
Anyways, I'll cut the crap. I'm having problems with simple things like pass by values - I can't seem to get my head wrapped around them. The questions on my current assignment are similar to this:
"Write a program that determines which of 5 geographic regions within a major city (north, south, east, west, central) had the fewest reported automobile accidents last year. It should have the following two functions, which are called by main.
int getNumAccidents() is passed the name of the region. It asks the user for the number of automobile accidents reported in that region during the year, validates the input, then returns it. It should be called once for each city region.
void findLowest() is passed the five accident totals. It determines which is the smallest and prints the name of the region, along with its accident figure."
Now my problem is I can't figure out the "is passed the name" part of the thing. I don't know how to write something that can be used all five times, for the five sectors etc...this is such an elementary this, which is why I'm so vexed that I can't get it.
All I've got so far is some experimental code that makes no sense...If I make any progress, I'll post it on here.
Any help is *greatly* appreciated. I want to pass this course, and the lectures aren't doing anything for me - I've been learning the last bit by reading the book, which is a very bad way for me to retain knowledge.
Thanks!
.Sen.