Function that uses a switch statement

Assignment Help Basic Computer Science
Reference no: EM1380798

Question: To locate nearest numbered cross street for a given avenue address, the following algorithm can be used: cancel last diget of the address, divide by two, 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

Write 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.

Reference no: EM1380798

Questions Cloud

Identify and analyze the perceived and real benefits : Relative advantage is the degree to which a new technology is perceived to be superior to current technology. An company is more likely to adopt new technology when it perceives greater relative benefit compared to current technology.
Estimate the marginal return : Estimating the Marginal Return to Schooling Suppose Carl's wage-schooling locus is given by the following schedule and Human Capital Investment
Calculation for programming and machine independency : Assume f is a function that returns the result of reversing string of symbols given as its input, and g is a function that returns concatenation of the 2-strings given as its input. If x is the string abcd,
Create a program that reads number of dooflingies : The shipping clerk at Rinky Dooflingy Corporation is faced with the problem: Dooflingies are very deilicate and must be shipped in special containers.
Function that uses a switch statement : To locate nearest numbered cross street for a given avenue address, the following algorithm can be used: cancel last diget of the address, divide by two,
Question about flight function : An airline vice president in charge of operations requires to determine whether the current estimates of flight times are accurate. because there is a larger possiblity of variations due to wether and air traffic in the longer flights.
Describe any other factors you would consider in making : Describe any other factors you would consider in making a decision to continue or discontinue doing business with this organization. State the process you would follow to make your decision, provide your decision, and explain the decision making s..
Discuss the process you would apply to determine : Discuss the process you would apply to determine whether the procedure falls within the RN scope of practice and how you would go about introducing the new procedure with physicians and fellow nurses.
Creating an oracle : The clique problem itself is NP-hard. Thus you may not wish to have an oracle that runs in exponential time. Consider approach to approximate the solution.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Explain data by state of computer-s electrical switches

Differentiate between computer data represented by the state of computer's electrical switches and meaningful information which is displayed to user.

  Explain how to structure worksheet including titles

Explain how you will structure the worksheet, including the titles, column headings, and formulas to calculate the time it takes to make each size of cage.

  Explain diagnosing and troubleshooting excel-based problems

How does versatility of Excel affect application support? Because of its versatility, write assumptions should be made when diagnosing and troubleshooting Excel-based problems?

  How computer technology has changed our society

How have the major players including the government either made these statements true or false? What are examples of why or why not.

  Drawing crow-s foot erd using a specialization hierarchy

Given the following business scenario, create a Crow's Foot ERD using a specialization hierarchy if appropriate.

  Interface perating system with uninterruptible power supply

Windows XP Professional can interface through the operating system with an Uninterruptible Power Supply (UPS).

  Determine the size of data register

If the computer in this exercise uses the same size word for data and instructions determine the size of each data register? What is the size of the instruction register.

  Find probability of having no umbrella if it rains

When rain is forecast, Mr. Pickwick takes his umbrella. When rain is not forecast, he takes it with  probability 1/3. Find the probability that Pickwick has no umbrella, given that it rains.

  Explain two standard apis supported by jaxp

Explain two standard APIs supported by JAXP (Java API for XML processing) and give a comprison between two mechanism.

  Calculate performance of cache and the average cpi

Assume the instruction cache miss rate is 0.5% and the data cache miss rate is 1%. Calculate the performance of the cache (CPU execution time) and the average CPI.

  Describe history of portfolio design in graphics design

Describe the history of portfolio design in the graphics design industry, and role of a graphic designer. Discuss current trends in portfolio design, and the possible future technologies for the industry.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd