Please help me! I want a menu driven program in c?
-
respected people who are reading this please help me.i want a to submit a project on c which is a menu driven program for an ice cream parlor . please someone provide me the source code for it .i need file handling in it. if any programmer is reading this please mail me the source code on [email protected]'ll be really very very thankful to you .this is urgent. please
-
Answer:
You have not said what type of menu, or what options, you want for the ice cream parlor. Anyhow, here is some code, that you could add to if you need more menu items, etc. int cone_selection; printf("Welcome to the ice cream parlor\n"); do { printf("Please enter a number from the menu below\n"); printf("1 - Single cone\n"); printf("2 - Double cone\n"); printf("3 - Nothing\n"); scanf("%d", &cone_selection); } while (cone_selection < 1 || cone_selection > 3); if (cone_selection == 3) { printf("Thank you for visiting"); return 0; } char cone_string[20]; if (cone_selection == 1) { cone_string = "single cone"; } else { cone_string = "double cone"; } int flavor_selection; do { printf("What flavor would you like?\n"); printf("1 - Vanilla\n"); printf("2 - Chocolate\n"); printf("3 - Strawberry\n"); printf("4 - Bubble Gum\n"); printf("5 - No flavor\n"); scanf("%d", flavor_selection); } while (flavor_selection < 1 || flavor_selection > 5); if (flavor_selection == 5) { printf("Thank you for visiting"); return 0; } char flavor_string[20]; switch (flavor_selection) { case 1 : flavor_string = "vanilla"; break; case 2 : flavor_string = "chocolate"; break; case 3 : flavor_string = "strawberry"; break; case 4 : flavor_string = "bubble gum"; break; } printf("You chose a %s with %s flavor", cone_string, flavor_string); return 0; Hope that helps.
Yahoo! Answers Visit the source
Other answers
If you want a menu driven program might be better to go for some other language like php or java. You might be able to build a simple UI as well. Coming back to your question Here is how you generally approach for a menu driven program in c Display a list of options with the numbers before them ask user to enter the choice clear the screen present what you want to present and show the menu back again always have an exit option When i searched google for "c menu driven program" the first link had some source code and looks good to start. .../
Related Q & A:
- How do I make a python web program that is on a ubuntu server allow access to the server?Best solution by Yahoo! Answers
- I want a safe power leveling site to level my wow character to 70, could you introduce a good site.Best solution by Yahoo! Answers
- Can someone please help me to make a hotmail.fr address?Best solution by Yahoo! Answers
- I want a knife for camping are there any knives that keep a sharp blade?Best solution by Yahoo! Answers
- Please help me, got into a car accident?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.