ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 2 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 03 May 2017 My Price 8.00

The Jumpin' Java Bean coffee shop

 
-2down votefavorite

Here are the instructions: The Jumpin' Java Bean coffee shop charges $2.00 for a cup of coffee and offers the add-ins shown in the table at the end of the lab. You must use a two-dimensional array for the add-ins.

Design the logic and write a C program that allows a user to enter ordered add-ins, by number not name, allow for multiple add-ons and a sentinal value to stop the add-on prompts. After each item, display its price or the message "Sorry, we do not carry that item" as output. After all items have been entered, display the total price for the order. Keep the program running for other customers until told to stop.

I am having a lot of trouble with the declarations and add-ons (really everything in general), I was hoping you guys could give me some feedback.

Here is what I have so far:

#include 
#include 

main ()
{

int num; 
char ValidItems=""; 
double price; 
int itemsFound = 0; 
int itemsNotFound = 0; 
double totalPrice = 0; 
int no = 999; 
char[] validItems = { "Whipped cream", "Cinnamon", "Chocolate sauce", "Amaretto", "Irish whiskey" }; 
double[] validPrice = { 0.89, 0.25, 0.59, 1.50, 1.75 }; 
int sub; 


string msgNo = "Item not found"; 

printf("What would you like in your coffee?"); 
while (item != 999) 

sub = 0; 
bool foundIt = false; 
price = 2.00; 
while (sub 

if (validItems[sub] == ValidItems) 

foundIt = true; 
price = validPrice[sub]; 
break; 

sub++; 


if (foundIt) 

//Console.WriteLine(msgYes); 
printf("Your total is ${0}", price); 
itemsFound = itemsFound + 1; 
totalPrice = totalPrice + price; 

else 

printf(msgNo); 


printf("Would you like anything else? (NO to quit)"); 



printf("Your order: {0} Total Price: {1:n}", 
itemsFound, totalPrice); 
Console.ReadKey() 
}

Answers

(11)
Status NEW Posted 03 May 2017 01:05 AM My Price 8.00

-----------

Attachments

file 1493775677-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)