/*	Ashok Patel
	CPSC 1011 Lab, 001, Sept 15, 2022
	Lab # 3
	Conditional Statements-Loops lab
	This lab will ask users to select either 'a' for apples, or 'o' for oranges or 
	enter a q to quit. This will run a loop until the user enters a q. The 	default 	output if no letter is entered or one that is not recognized, then it 
	will tell the user that they entered an invalid letter.
*/

#include <stdio.h>

int main(void) {

	char Input;
	
	do {
	printf("Enter an a for apple or o for orange, or q to quit:");
	scanf(" %c", &Input);
	
	if(Input == 'a'|| Input == 'A') {
	printf("You chose apples!\n");	
	}	
	else if(Input == 'o' || Input == 'O') {
	printf("You chose oranges!\n");
	}
	else if (Input == 'q' || Input == 'Q') {
	printf("Good bye!\n");
	}
	else {
	printf("You entered an invalid letter.\n");	
	}
	}
	while(Input != 'q' && Input != 'Q');
	
	return 0;
}
