-
March 24th, 2010, 10:11 PM
#1
any ideas how to write this function?
I need to write a function named:
int getNumAccidents()
the function is passed the names of a region within a city (north, south, east, west) The function also asks the user for the number of car accidents in that region, then returns that number. The function will be called once for each region.
I cannot figure out how to do this without using a void function. Because I have to ask the user to input an accident figure, it runs the cout statement asking for the numAccidents when I just want to return the figure, not run the whole content of the function.
anyone have some ideas?
-
March 24th, 2010, 11:01 PM
#2
Re: any ideas how to write this function?
nevermind im on to something.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|