Programming Exercises

1:Write a C++ program that requests and displays information as shown below. Note that the program should be able to accept first names of more than one word. Also note that the program adjusts the grade downward, that is, up one letter. Assume the user requests an A, B, or C so that you don't have to worry about the gap between a D and an F.
What is your first name? Betty Sue
What is your last name? Yew
What letter grade do you deserve? B
What is your age? 22
Name: Yew, Betty Sue
Grade: C
Age: 22
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 ...

Get The Waite Group's C++ Primer Plus, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.