Question: The WhatsLeft Function We will be writing a simple program that figures out how many cherries are left. The program will ask the user how

The WhatsLeft Function We will be writing a simple program that figures out how many cherries are left. The program will ask the user how many cherries they bought and how many cherries they have eaten. Then the program will call a function that returns how many cherries are left and the program will display the result. This is a simple program and could all be done in main. However, we want to see how to organize a program using a function and a library so we will add the function declaration and the function implementation in the library as explained. In Questions 2-4, you will be writing the code that would go in the following files. library.cpp library.h main.cpp. For this question we will work in library.h. To Do: Write the function declaration for a function called WhatsLeft. This function takes two float parameters passed by value. amount of fruit purchased (in pounds) amount of fruit eaten (in pounds) The function returns one float. amount of fruit left (in pounds) This declaration would go in the file library.h. You can assume the following code is already in library.h. You will need to add the code listed above

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 Programming Questions!