Question: In C++ write a class called biscuits which contains two private member variables for the ID(char) and price(double). Create a public accessor and a mutator

 In C++ write a class called biscuits which contains two private

In C++ write a class called biscuits which contains two private member variables for the ID(char) and price(double). Create a public accessor and a mutator for each private member variable. Write a non-member function outside of the class shoes called cheapestBiscuits () which takes in an array of Biscuits Objects and its size as parameters and returns a Biscuits objects that costs the cheapest price. In your main() test your Biscuits class and non-member function cheapestBiscuits() after declaring an array of biscuits object initializing the array with hardcoded values and display each element of the array. Sample output: Biscuit A costs $1.25 Biscuit B costs $2.02 Biscuit C costs $1.50 The cheapest biscuit is Biscuit A for $1.25

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!