Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You friend, Cathy has a small business and knowing that you have taken a program

ID: 3645625 • Letter: Y

Question

You friend, Cathy has a small business and knowing that you have taken a programming class wants you to create an application for her. Her company is called Cathy's Candles. Cathy's Candles offers candles in three styles - tea lights, votives and pillars. The colors available are Federal Blue, Sunflower Yellow, Christmas Red and Milky White. The scented candles have an additional charge.

We will make some assumptions - the credit card information of the customer is already in file, so only the name of the customer and their customer id will be obtained for this application. Only known customers are placing orders. At this point, Cathy's Candles cannot handle new customers since it is a small scale operation. Each order is processed only for one style, color, scented / unscented candles at this time. If the customer wants to place another order, a new run is needed.

Style Base Price Scented Price(Additional)
Tea Lights 5.75 1.00
Votives 8.75 2.00
Pillar 12.75 5.00

2. Prompt the user to enter Y or y for Yes, N or n for No. The question asked is "Do you want scented candles?" If the user enters any other character, they should be prompted until they enter the correct choice. Note: n is an acceptable character.

Explanation / Answer

#include <cstdlib>

#include <string>

#include<iostream>

#include<math.h>

using namespace::std;

int main(){

char x;

cout<<"enter the color,F or f for Federal Blue, S or s for Sunflower Yellow, C or c for Christmas Red and M or m for Milky White"<<endl;

cin>>x;

for(int i=1; i<=4;){ /*initiating infinite loop */

if(x=='F'|x=='f'|x=='S'|x=='s'|x=='C'|x=='c'|x=='M'|x=='m'){

break;}

else{

cout<<"invalid choice enter again"<<endl;cin>>x;}

}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote