Create a program to test a function


Assignment:

Given: To locate the nearest numbered cross street for a given avenue address, the following algorithm can be used: cancel the last diget of the address, divide by 2, and add or subtract the number given in the following abbreviated table:

1st Ave. add 3
2nd Ave. add 3
3rd Ave. add 10
4th Ave. add 8
5th Ave. up to 200 add 13
5th Ave. up to 400 add 16
6th Ave. (Ave. of the Americas) Subtract 12
7th Ave. add 12
8th Ave. add 10
10 Ave. add 14

Create a function that uses a switch statement to determine the number of the nearest cross street for a given address and avenue number according to the preceeding alogorithm. Then write a program to test your function.

 

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Create a program to test a function
Reference No:- TGS01933675

Now Priced at $20 (50% Discount)

Recommended (93%)

Rated (4.5/5)