Question: MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++

MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .
Lab Assignment-Strings/Arrays/Structures - 1. Write a program that asks the user to enter his or her first name and then last name, and that then constructs, stores, and displays a third string, consisting of the user's last name followed by a comma, a space, and first name. Use char arrays and functions from the cstring header file. A sample run could look like this Enter your first name: Flip Enter your last name: Fleming Here's the information in a single string: Fleming, Flip 2. The CandyBar 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 declares such a structure and creates a CandyBar variable called snack, initializing its members to "Mocha Munch", 2.3, and 350, respectively. The initialization should be part of the declaration for snack. Finally, the program should display the contents of the snack variable
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
