Problem Statement Write a program to help Florence decide which snacks and beverages to serve her friends. Use selection statements to determine the proper snack and beverage recommendations the program will make. Florence, the hostess, will be prompted for the following information for each guest name, age, and if they like chocolate o If the guest likes chocolate, it should also ask if they like nuts.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Write and test the code to solve the problem statement below. Be sure to test your code with
values provided in the Expected Input & Output.
Problem Statement
Write a program to help Florence decide which snacks and beverages to serve her friends. Use
selection statements to determine the proper snack and beverage recommendations the
program will make.
Florence, the hostess, will be prompted for the following information for each guest
name,
age, and
if they like chocolate
o If the guest likes chocolate, it should also ask if they like nuts.
The program will provide output based on the following criteria:
Florence will serve one (or all) of the 3 candy options
SNACK
CRITERIA
Doesn't like chocolate
Likes chocolate, but not nuts
Skittles
M & M's
Peanut M & M's
Likes chocolate and nuts
Florence can serve one (or all) of the 3 drink options
BEVERAGE
AGE
5 or under
6 - 20
21 and over
Juice
Soda
Wine
Additional Requirements:
• For this lab use strncpy to store the name of the snack and the name of the beverage into
C-string variables for each guest before their preferences are output.
• For this lab use toupper to make the responses for chocolate and nuts case insensitive.
• Code 1 section at a time and test with cerr statements.
o Comment out your cerr statements before you generate your final output
→ do not delete them for this lab.
• Properly document your code and use appropriate structure & style throughout.
Steps
1- Start by determining the input and output in the problem statement
2 - Design the algorithm with you partner so you are both on the same page
3 - Write the input section then test it
4 - Write the processing to determine the snack then test it thoroughly (all branches)
5 - Write the processing to determine the beverage then test it thoroughly (all branches)
6 - Complete the output section and test
Transcribed Image Text:Write and test the code to solve the problem statement below. Be sure to test your code with values provided in the Expected Input & Output. Problem Statement Write a program to help Florence decide which snacks and beverages to serve her friends. Use selection statements to determine the proper snack and beverage recommendations the program will make. Florence, the hostess, will be prompted for the following information for each guest name, age, and if they like chocolate o If the guest likes chocolate, it should also ask if they like nuts. The program will provide output based on the following criteria: Florence will serve one (or all) of the 3 candy options SNACK CRITERIA Doesn't like chocolate Likes chocolate, but not nuts Skittles M & M's Peanut M & M's Likes chocolate and nuts Florence can serve one (or all) of the 3 drink options BEVERAGE AGE 5 or under 6 - 20 21 and over Juice Soda Wine Additional Requirements: • For this lab use strncpy to store the name of the snack and the name of the beverage into C-string variables for each guest before their preferences are output. • For this lab use toupper to make the responses for chocolate and nuts case insensitive. • Code 1 section at a time and test with cerr statements. o Comment out your cerr statements before you generate your final output → do not delete them for this lab. • Properly document your code and use appropriate structure & style throughout. Steps 1- Start by determining the input and output in the problem statement 2 - Design the algorithm with you partner so you are both on the same page 3 - Write the input section then test it 4 - Write the processing to determine the snack then test it thoroughly (all branches) 5 - Write the processing to determine the beverage then test it thoroughly (all branches) 6 - Complete the output section and test
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY