need code for finding avenues

J

jonathan.dyer

here is the problem

write a function tht uses a switch statement to determine the number of
the nearest cross street for a given address and avenue number
according to the preceding algorithm. the write a program to test the
function.

1st ave +3
2nd ave +3
3rd ave +10
4th ave +8
5th ave up to 200 +13
5th ave up to 400 +16
6th ave -12
7th ave +12
8th ave +10
10th ave +14.
 
A

Alf P. Steinbach

* (e-mail address removed):
here is the problem

write a function tht uses a switch statement to determine the number of
the nearest cross street for a given address and avenue number
according to the preceding algorithm. the write a program to test the
function.

1st ave +3
2nd ave +3
3rd ave +10
4th ave +8
5th ave up to 200 +13
5th ave up to 400 +16
6th ave -12
7th ave +12
8th ave +10
10th ave +14.

Yep, that's in the FAQ: see FAQ item 5.2 (you can find the FAQ at <url:
http://www.parashift.com/c++-faq-lite/>).
 
D

Default User

here is the problem

write a function tht uses a switch statement to determine the number
of the nearest cross street for a given address and avenue number
according to the preceding algorithm. the write a program to test the
function.

That's not a problem for me, as I don't have do the homework. You do,
so it would be a good idea to show us what you've done so far, and
explain what is giving you problems.




Brian
 
J

Jim Langston

here is the problem

write a function tht uses a switch statement to determine the number of
the nearest cross street for a given address and avenue number
according to the preceding algorithm. the write a program to test the
function.

1st ave +3
2nd ave +3
3rd ave +10
4th ave +8
5th ave up to 200 +13
5th ave up to 400 +16
6th ave -12
7th ave +12
8th ave +10
10th ave +14.

Yep. That's a problem. But, we don't answer problems here, we answer
questions. And I don't see a question.

If your question is "will someone do my homework for me?" the answer is
"No."

Now, try to write the program. And when you get stuck post what you've
tried that didn't work.

int main()
{
}

is not enough :D
 
S

Steve Pope

write a function tht uses a switch statement to determine the number of
the nearest cross street for a given address and avenue number
according to the preceding algorithm. the write a program to test the
function.
1st ave +3
2nd ave +3
3rd ave +10
4th ave +8
5th ave up to 200 +13
5th ave up to 400 +16
6th ave -12
7th ave +12
8th ave +10
10th ave +14.

You left out Broadway. You need to find the cross-streets
for addresses on Broadway also.

Steve
 
O

osmium

write a function tht uses a switch statement to determine the number of
the nearest cross street for a given address and avenue number
according to the preceding algorithm. the write a program to test the
function.

1st ave +3
2nd ave +3
3rd ave +10
4th ave +8
5th ave up to 200 +13
5th ave up to 400 +16
6th ave -12
7th ave +12
8th ave +10
10th ave +14.

Can you do this with pencil and paper? The first step is to get the probem
in your head. Can you draw a schematic map of this city? Your narrative
mentions avenues and streets and addresses but there are no streets or
addresses in your table. Units are important. Is 3 a street? Is there a
"minus 12th street"? Is 200 a street?
 
R

red floyd

[blatant do-my-homework redacted]

You know, I believe that the US Army has an honor code, and having
someone else do your homework is most likely a violation of said code...
 
O

osmium

red floyd said:
[blatant do-my-homework redacted]

You know, I believe that the US Army has an honor code, and having
someone else do your homework is most likely a violation of said code...

The post was from Google groups, there is no reason to believe the address
you are referring to wasn't totally bogus.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,114
Latest member
GlucoPremiumReview
Top