Question: C programming Problem 5 Mass and energy cannot be created or destroyed rather, energy and mass are transferred from one state or location to another.

C programming

Problem 5

Mass and energy cannot be created or destroyed rather, energy and mass are transferred from one state or location to another. Create a function that will take two numbers that represent the energy contained in each item. The function must take two numbers and be of type void nothing is returned. In the function, ask the user for input that represents how much energy should be transferred from object 1 to object 2. This is a perfect world with a perfect energy transfer system. Use pointers to solve this problem. For full credit, the problem should look like this:

1. Have the amounts of energy be gathered and stored in main.

2. Create pointers that point to the variables that are created.

3. Send those pointers to the energy function.

4. Have the energy function ask the user how much energy should be transferred.

5. Transfer the energy value using pointers. NOTHING SHOULD BE RETURNED FROM THE FUNCTION. IT SHOULD BE A VOID FUNCTION.

6. Then, in main, print how much energy is in each item.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!