Write a program that uses a function that takes as


Problem

The Candy Bar structure contains three members. The first member holds the brand name of a candy bar. The second member holds the weight (which may have a fractional part) of the candy bar, and the third member holds the number of calories (an integer value) in the candy bar. Write a program that uses a function that takes as arguments a reference to Candy Bar, a pointer-to-char, a double, and an int and uses the last three values to set the corresponding members of the structure. The last three arguments should have default values of "Millennium Munch," 2.85, and 350. Also the program should use a function that takes a reference to a Candy Bar as an argument and displays the contents of the structure. Use const where appropriate.

 

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Write a program that uses a function that takes as
Reference No:- TGS02635188

Expected delivery within 24 Hours