Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following function uses reference parameters to compute the size of a chain in feet and inches given the size of the chain in inches,

image text in transcribed

The following function uses reference parameters to compute the size of a chain in feet and inches given the size of the chain in inches, and returns the total cost of the chain. Rewrite the function so it uses pointers instead of reference parameters. double chain (int totalinches, int \&feet, int \&inches) i feet = total Inches /12; inches = totalinches 12; return feet* 3.49+ inches* .30; \} Use the main function to demonstrate your functions. Declare two int variables f and i and set them to 0 . Input the size of chain in inches. Then call the chain function so the values computed for feet and inches get stored in f and i. Then output the result, and new values of f and i. Use cout fixed setprecision ( 2 ); to format the cost to two decimal places. Ex: If the input to the program is: 30 the output is: 2 feet and 6 inches. Cost: $8.78 Your program must define and call a function named chain with three parameters in the order described above, that returns a double value

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

OCA Oracle Database SQL Exam Guide Exam 1Z0-071

Authors: Steve O'Hearn

1st Edition

1259585492, 978-1259585494

More Books

Students also viewed these Databases questions

Question

=+6. What does the invisible hand of the marketplace do?

Answered: 1 week ago

Question

=+ 4. Why should policymakers think about incentives?

Answered: 1 week ago