Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please solve using C++ 6.4 Procedure 6.4.1 Exercise 1: If...Else... Structure Write a program that first prompts a user to select a type of candy

Please solve using C++ image text in transcribed
image text in transcribed
6.4 Procedure 6.4.1 Exercise 1: If...Else... Structure Write a program that first prompts a user to select a type of candy from a list. Then it will prompt the user on how they will pay for the selected candy. The program will output the correct change based on the selected candy and payment entered. REQUIREMENT: Use the if..else statement for decision making (not the switch statement). Sample Output 1: Select a candy from the list below: 1 = Snarties ($0.50) 2 - M&M's Selection? 2 How are you going to pay for these M&M'a? 1 - Loonie 2 - Toonie Selection? 1 You will get the following change: $ 0.25 Your program should contain: 1. Your name, lab #. program description and comments for blocks of code: You can use the single line comment 1) or the multi line comment (...) 2. Good spacing of sections of code 3. Proper indentation of lines of code 4. Good variable names (descriptive, but not too long) NAIT CP 1149 Lab 6 - Conditional Statements Page 6,5 6.4.2 Exercise 2: Switch Structure Repeat Exercise 1. REQUIREMENT: Use the switch statement for the main decision making on the options selected (you may also need some if statements). Your program should contain: 1. Your name, lab #. program description and comments for blocks of code: You can use the single line comment (()) or the multi line comment (* 2. Good spacing of sections of code 3. Proper indentation of lines of code 4. Good variable names (descriptive, but not too long)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions