C program for restaurant menu

Hi, I guess I'll post here with my problem as well my introduction. I've coded in Java in high school for 2 years but my teacher was horrible so I decided to wait till college to take another programming class. Well I'm Programming Fundamentals and have been assigned a program in which we have to code a menu Here are the "Instructions:" 1.

Create the menu below. All code is to be logically broken down into appropriate user-defined functions to accomplish the necessary tasks.

How to turn on auto rotate on chromebook

The menu continues to display until the user enters a valid menu selection this will be done through the default switch statement. When a user makes a valid selection he has the option to select another item from the menu until he is finished ordering at which time his bill will be created and tax of 7. You are to generate the output below. I have spent the past few hours figuring everything out since I've missed the past 2 classes.

The only problem I seem to be having is ending the program by hitting 'E'. If anyone has any suggestions, feel free to comment or whatever. Move the menu lines into another function -- maybe named menu -- so that main will be easier to write. Then write a loop that include menu.

That works, though it doesn't match what Ancient Dragon had in mind. His idea has the menu function also asking for the choice from the user.

You could have a function that just displays it or one like his that asks for the choice as well. If you want to ask for the choice too, as Ancient Dragon suggested, your function header would be something like this:. I've changed it a little but it's still iffy. It's probably because I don't understand creating functions very well, I've been reading about it in my book but still When I run it, it only asks once and then proceeds to the output at the bottom.

I think I have this loop wrong. Ah, looks like you are supposed to enter,or 'E' while looking at the menu. If it is, make the menu function return a char, so it'll be the same except the header will be this:. You'll also change choice from "int" to "char" in your while loop and you'll put all of your options in single parentheses.

You'll add an option for 'E' in your switch statement. If you are supposed to repeatedly go through the menu, don't set done to true for options 1 through 5. Delete those lines. I've commented them out above.

This will keep you going through the loop over and over until you press 'E'. Well, I emailed my teacher and asked her whether or not I can use my own functions and she said she didn't want me to since she hasn't taught them in class yet.

So I took it out but still managed to get the program working pretty well. Only one minor crash that is caused when you enter something other than ,,E. I assume it's due to the string and character comparison and nothing is stored in char choice and when it's executed the switch statement has nothing to retrieve from char choice. Oh well, I don't think my teacher will really mind.If you wish to enjoy the degustation menu, please be advised that all guests at the table must dine from this menu.

A La Carte Lunch Menu. Available 7 days per week.

Subscribe to RSS

We serve High Tea 7 days a week. Bookings for high tea are essential. It is recommended you book at least 24 hours in advance. You may book by calling us on 08 Monday to Friday arrivals are from pm pm, and we require the table back by pm.

We recommend larger parties 8 guests or more arrive by 2pm to allow you the maximum time at your table. High tea is not offered on Fridays in December except for Fridays after Christmas. We recommend larger parties 8 guests or more arrive at 1pm to allow you the maximum time at your table.

Please provide all dietary requirements such as gluten-free or vegan at least 48 hours prior to your reservation.

c program for restaurant menu

Please note, our high tea is more sweet than savoury in its design. Skim or soy milk available upon request. C Restaurant has a responsible service of alcohol policy. C Restaurant Menus. All menus are subject to change. Please discuss with your waiter if you have any special dietary requirements.

With all credit transactions, there is a 1. Dining with a party of 8 guests or more? Have a look at our set menu options!

Function Menus. Wanting to book for an upcoming holiday or special event?Tutorial Belajar Coding. Toggle navigation Menu. Seperti yang dulu saya menggunakan pemilihan switch case untuk menu-menu makannya tapi sekarang ditambah perulangan Do While.

Oke kita langsung saja. Di gambar kedua ada proses di dalam menu casenya menentukan harga awalnya lalu menghitungnya dengan jumlah porsi dan menghitung total keseluruhan serta jumlah kembalian dari uang yang dibayarkan.

Ini gambar ketika program dijalankan. Dan dibawah ini adalaha source code lengkapnya. Semoga postingan kali ini juga bermanfaat, silahkan tuliskan komentar dan pertanyaannya dibawah jika ada yang salah atau kurang jelas, daftar kan juga email kalian untuk terus mendapatkan update terbaru tutorial pemrograman dan source code dari coding maniak.

Email This BlogThis! Share to Twitter Share to Facebook. Muhammad Ramdhani December 4, at PM. Mad Arief January 31, at AM. J February 19, at PM.

Siri za mapenzi

Subscribe to: Post Comments Atom. Powered by Blogger. Author Mad Arief "life is only once, so don't choose to be mediocre, do whatever you need to do and die without regret" -Mad Arief- View my complete profile. Report Abuse. Postingan Terbaru. Total Pageviews. Popular Posts. Newsletter Were this world an endless plain, and by sailing eastward we could for ever reach new distances.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service.

The dark mode beta is finally here.

c program for restaurant menu

Change your preferences any time. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. I have managed to get my menu to work, but I don't know how to stop the program on the exit selection in the menu I have made.

Also note that your current approach reads a single character only. In case you don't want numbers with more digits invoke the selection based on their first digit, read int instead:. LihO and sharth have the proper solution, however if the idea is to exit the program when they input 5 then I'd suggest doing this with the case:. Simply set the selection variable to meet the condition that you already have to exit the loop:.

Learn more.

Restaurant Menu

Asked 6 years, 6 months ago. Active 2 years, 8 months ago. Viewed 35k times. Mitch Honsa Mitch Honsa 21 1 1 gold badge 1 1 silver badge 2 2 bronze badges. Active Oldest Votes. Change while selection! LihO LihO It's not best practices to have multiple returns in a method. It would be better to use a bool or int that would exit the condition statement. LihO I agree in this small program there isn't much of an issue, but it's not a good habit to get into.

c program for restaurant menu

It can make debugging a pain, as a return in the middle of a method can be overlooked and a breakpoint at the end can be missed. Michael Gaskill 7, 10 10 gold badges 35 35 silver badges 38 38 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook.

Subscribe to RSS

Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Featured on Meta. Feedback on Q2 Community Roadmap. Technical site integration observational experiment live on Stack Overflow. Question Close Updates: Phase 1. Related Hot Network Questions. Question feed. Stack Overflow works best with JavaScript enabled.The receipt should contain, the list of items ordered, the amount.

On this project, only use. You can approach this project in your own unique way, and include as many functions as you desire, but your project should contain at least the following. A Display Menu function that has a welcome line and displays at least 5 menu items and their prices.

See more: restaurant menu project examplesrestaurant digital menu project downloadproject android restaurant menufree restaurant menu templates for wordrestaurant menu template freerestaurant menu designrestaurant menu templatesfree printable restaurant menu templatesrestaurant menu categoriesrestaurant menu samplerestaurant menu makerdesign project restaurant menuphotoshop restaurant menu projectdisplay restaurant menu iphonerestaurant menu freelance projectrestaurant menu entry projectproject restaurant menuitalian restaurant menu projectclass project making restaurant menucan find restaurant menu project.

May I get more details over the chat? I have 3 year experience in it so if you are worry about your project then I am best choice for [login to view URL] one can do this work better than me. Relevant Skills and Experience. Hello, i understand your program requirements clearly and can help you write this code using only functions and no loops or array. Relevant Skills and Expe More.

The email address is already associated with a Freelancer account. Enter your password below to link accounts:.

Palla di vetro

Your program should display the items sold at the restaurant and their prices, It should allow the customer specify how many items off the menu to be ordered, with a maximum of 3 items off the menu. The customer can order as many of each item as possible. The receipt should contain, the list of items ordered, the amount of each item, the price of the item, the tax for the order, and the final total.

On this project, only use concepts covered in this class up until this project was assigned. Looking to make some money? Your email address. Apply for similar jobs. Set your budget and timeframe. Outline your proposal.

c program for restaurant menu

Get paid for your work. It's free to sign up and bid on jobs. Awarded to:. DemonDeveloper I have 3 year experience in it so if you are worry about your project then I am best choice for [login to view URL] one can do this work better than me.

Link Accounts.

Restaurant Menu Program

I am a new user I am a returning user. Email address. Username Valid username. I am looking to Hire Work. Username or Email. Password I forgot my password.Online menu maker that lets you instantly create printed and website menus like a pro. Start with built-in menu designs. Use powerful designer features without needing technical skills.

Say good-bye to clunky text boxes and grids. Simply drag and drop items to the menu and iMenuPro does the rest.

The result? Beautifully formatted menus, every time. Only iMenuPro has Menu Stylesa design system so simple you can change the look of your entire menu with one click. Easier than Word, more flexible than templates. Have daily specials? Keep a database of foods with rotating seasonal specials on file and ready to go. Make price changes and last-minute substitutions anytime. Get creative by swapping backgrounds, borders, colors, accents or fonts.

Upload your logos or experiment with built-in Artisan images without wasting time. Box or highlight any item on your menu to draw attention to high-profit offerings.

Accented items typically see increased order rates helping you increase your profits. With iMenuPro's Live-Sync you can change your printed menu, your website menu, and your social media menus across the web, simultaneously — like magic. No more inconsistent word documents! The best technology for running a restaurant or bar iMenuPro Instant Specials Have daily specials?

Express Yourself Get creative by swapping backgrounds, borders, colors, accents or fonts. Highlight Items Box or highlight any item on your menu to draw attention to high-profit offerings. Brie Shelley, Bevspot bevspot.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service.

The dark mode beta is finally here. Change your preferences any time. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information.

I'm writing a program that displays a fast food menu. The user selects an item, then enters the quantity of that item, and can continue selecting items with specific quantities until done.

I have to use several methods. What I'm having trouble with is calculating a running total. This is my first Java class so I only know the basics. I put the running total in a while loop so it'll keep adding a subtotal to it, but when I call done the runningTotal is 0. What's the best way to keep track of the running total while using multiple methods?

Also, I'm open to any criticism or clean up in my code. Thank you. Also the price returned by the itemPrice needs to be added into the runningTotal variable.

Can you drink turpentine to get drunk

This is how your main method should look like. You are not required to call the subTotal method, once the user is done. You reset runningTotal to 0 every iteration. I have attached a working example. I moved the total calculation to your subTotal method where it adds every subTotal as they come in. Learn more. Asked 4 years, 6 months ago. Active 1 year, 7 months ago. Viewed 44k times. Michael Romero Jr. Active Oldest Votes.

Also the price returned by the itemPrice needs to be added into the runningTotal variable; This is how your main method should look like. Done 1 You've ordered a burger Enter quantity 2 Subtotal: 4. Done 2 You've ordered fries Enter quantity 1 Subtotal: 1. Done 4 3.

YoungHobbit YoungHobbit Ryan Ryan 1, 2 2 gold badges 17 17 silver badges 31 31 bronze badges. This will bring the exact output. Rohan Tripathy Rohan Tripathy Sign up or log in Sign up using Google.

Food Menu in c -simple project 3

Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog.


comments

Leave a Reply

Your email address will not be published. Required fields are marked *