Click here to Skip to main content
15,892,537 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionWhile Statement Issue. Pin
Mike Certini12-Jan-11 17:53
Mike Certini12-Jan-11 17:53 
AnswerRe: While Statement Issue. Pin
David Crow12-Jan-11 17:57
David Crow12-Jan-11 17:57 
GeneralRe: While Statement Issue. Pin
Andrew Brock12-Jan-11 18:06
Andrew Brock12-Jan-11 18:06 
GeneralRe: While Statement Issue. Pin
Mike Certini12-Jan-11 18:23
Mike Certini12-Jan-11 18:23 
GeneralRe: While Statement Issue. Pin
Andrew Brock12-Jan-11 18:35
Andrew Brock12-Jan-11 18:35 
GeneralRe: While Statement Issue. Pin
Mike Certini12-Jan-11 18:48
Mike Certini12-Jan-11 18:48 
GeneralRe: While Statement Issue. Pin
Malli_S12-Jan-11 19:02
Malli_S12-Jan-11 19:02 
GeneralCorrected Version. Pin
Mike Certini12-Jan-11 19:27
Mike Certini12-Jan-11 19:27 
Malli,

Thank you for your input. I found a number of corrections on other boards. As a result here is the corrected version:
#include <stdio.h>
#include <conio.h> 

#define Artichoke 1.25
#define Beets .65
#define Carrots .89
#define Discount .05
#define Shipping1 10.00
#define Shipping2 8.00

int main(void)
	{
	char ordercom;
	char type;
	float pounds;
	float gross;
	float poundTot = 0;
	ordercom = 'Y';
	while(ordercom == 'Y')
		{
		printf("*******************************************************************************************************************\n");
		printf("Determine What You Want To Buy\n");
		printf("1) (a)\t	Artichokes\t		        3) (c)\t   Carrots\n");
		printf("2) (b)\t	Beets\t				4) (q)\t   Quit\n");
		printf("*******************************************************************************************************************\n");
		printf("\n");
		printf("Select The Type Of Vegetable You Want:\n");
		scanf("%c",&type);
		fflush(stdin);
		printf("Select The Amount Of Pounds You Want To Purchase:\n");
		scanf("%f",&pounds);
		fflush(stdin);
		switch(type)
			{
			case 'a' :
				{
				gross = pounds * Artichoke;
				ordercom = 'Y';
				break;
				}
			case 'b' :
				{
				gross = pounds * Beets;
				ordercom = 'Y';
				break;
				}
			case 'c' :
				{
				gross = pounds * Carrots;
				ordercom = 'Y';
				break;
				}
			case 'q' :
				{
				ordercom = 'N';
				break;
				}
			default  :
				{
				ordercom = 'N';
				break;
				}
			}
		}
	
	}

GeneralRe: Corrected Version. Pin
Andrew Brock12-Jan-11 19:34
Andrew Brock12-Jan-11 19:34 
GeneralRe: Corrected Version. Pin
Andrew Brock12-Jan-11 19:37
Andrew Brock12-Jan-11 19:37 
GeneralRe: While Statement Issue. Pin
Andrew Brock12-Jan-11 19:31
Andrew Brock12-Jan-11 19:31 
AnswerRe: While Statement Issue. Pin
Luc Pattyn12-Jan-11 18:05
sitebuilderLuc Pattyn12-Jan-11 18:05 
GeneralRe: While Statement Issue. Pin
Mike Certini12-Jan-11 18:17
Mike Certini12-Jan-11 18:17 
QuestionDisabling popup menu item Pin
David Crow12-Jan-11 8:01
David Crow12-Jan-11 8:01 
AnswerRe: Disabling popup menu item PinPopular
User 742933812-Jan-11 8:29
professionalUser 742933812-Jan-11 8:29 
GeneralRe: Disabling popup menu item [SOLVED] Pin
David Crow12-Jan-11 8:54
David Crow12-Jan-11 8:54 
AnswerRe: Disabling popup menu item Pin
Niklas L12-Jan-11 21:18
Niklas L12-Jan-11 21:18 
QuestionRe: Disabling popup menu item Pin
David Crow14-Jan-11 3:20
David Crow14-Jan-11 3:20 
AnswerRe: Disabling popup menu item [modified] Pin
Niklas L16-Jan-11 20:47
Niklas L16-Jan-11 20:47 
AnswerRe: Disabling popup menu item Pin
JohnCz14-Jan-11 12:56
JohnCz14-Jan-11 12:56 
Questionpreallocating logging files for performance purposes Pin
Alan Kurlansky12-Jan-11 4:36
Alan Kurlansky12-Jan-11 4:36 
AnswerRe: preallocating logging files for performance purposes Pin
Richard MacCutchan12-Jan-11 5:05
mveRichard MacCutchan12-Jan-11 5:05 
AnswerRe: preallocating logging files for performance purposes [modified] Pin
Andrew Brock12-Jan-11 5:15
Andrew Brock12-Jan-11 5:15 
AnswerRe: preallocating logging files for performance purposes Pin
jschell12-Jan-11 8:39
jschell12-Jan-11 8:39 
Questionhow to show bookmarks in a popupmenu? Pin
yogish29312-Jan-11 0:47
yogish29312-Jan-11 0:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.