Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C programming questions. 1. Why do functions have prototypes? 2. What is the purpose of a formal parameter? 3. What is the purpose of an

C programming questions.

1. Why do functions have prototypes?

2. What is the purpose of a formal parameter?

3. What is the purpose of an actual parameter?

4. What is the NOT principle? Why is it important?

5. Why would you use a formal parameter to get data into a function when you could use a symbolic constant instead? Explain.

6. List the advantages and disadvantages of cohesive functions.

7. If given the choice between writing your own function or using a library function, can you think of situations where it would be preferable to write your own?

8. Why would you want to use a void function? Give some examples.

9. What are the advantages of top-down design?

10. Do cohesive functions promote or discourage code reuse? Explain your answer.

11. Explain in your own words what is meant by procedural abstraction.

12. A light year is a unit of astronomical distance that measures how far light can travel in one year, defined as 365.25 days, which is about 9.4507 x 1012, or about 5.878 trillion miles. A parsec is a unit of astronomical distance, equal to about 3.26 light years. One parsec corresponds to the distance at which the mean radius of the earth's orbit subtends an angle of one second of arc. Since the numbers grow so large so quickly, it's often easier for astronomers to work with parsecs, and convert them back to light years, or even miles, when needed. Write a function to convert parsecs to light years.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions