17.03.2021

Category: C program to calculate total price

C program to calculate total price

Need support for your remote team? Check out our new promo! IT issues often require a personalized solution. Why EE? Get Access. Log In.

c program to calculate total price

Web Dev. NET App Servers. We help IT Professionals succeed at work. Medium Priority. Last Modified: This program can be used in any of the 50 States of U. Start Free Trial.

c program to calculate total price

View Solution Only. Author Commented: This should be an easy program to write. Commented: Mayank S Principal Technologist. Try to work out some code on your own and if you face errors, etc then ask us. We can give you hints as to how to proceed, but not the entire program.

If so, then you can try it once on your own and see However, I see that somebody has been kind enough to you to give a entire code, but I hope that you don't expect this from everyone, everytime you post a question.

No comment has been added lately, so it's time to clean up this TA. Tinchos EE Cleanup Volunteer. Not the solution you were looking for? Explore More Content. Explore More Content Explore courses, solutions, and other research materials related to this topic. Answer - NO!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.

What I am doing wrong? I want to calculate the total prices of the items and display it. I have described my problem below with the for loop. I want to calculate the total prices of the items but when I started tracing the program. It is not executiong the for loop of function calculate. That is why I am unable to add the values present in price variable and unable to store it in variable Total.

Which is completely nuts. T has no meaningful value after the loop, ok, it points to the last element in i[]. But why should the last element be capable of summing up all items?

That is a member function of item, how should it ever be capable of summing up the prices of other items that are stored in the same container. Your items do not know anything about the fact that they have fellow items in the same container. Btw, if you follower advise 1 the compiler would have mentioned to you that there is something wrong. Guidance: The summing can not be a function of the item class. Either you make a new container class which provides summing and other stuff to you as well as managing the array of items or you write a free function or as a first step code the summing itself in your main.

Learn more. I want to calculate the Total price of the items [closed] Ask Question. Asked 2 years, 6 months ago. Active 2 years, 6 months ago.You can Compile and Run this program javac Expenses. Good post…. Share more post like this…. Calculate phone prices. Nice post share…Keep posting Recycle your laptop. NET Certificate in. Monday, February 27, Write a program to calculate the total expenses. Email This BlogThis!

Share to Twitter Share to Facebook. Newer Post Older Post Home. Unknown April 30, at PM. Unknown June 11, at AM. Unknown June 19, at AM. Unknown November 22, at AM. Poonamvd February 21, at AM. Unknown August 4, at PM. Btech Bikram August 2, at PM. Unknown November 12, at AM. Recycle Device December 5, at AM. Recycle Device December 7, at AM. Subscribe to: Post Comments Atom. Popular Posts Write a program to calculate the total expenses. WAP to calculate the monthly telephone bills as per the following rule: Minimum Rs.

Plus Rs. Addition of Two Number using servlet and jsp. Write a program to calculate the total expenses. Social Profiles.

Popular Tags Blog Archives. Net 4 Java 1. NET 1 Wordpress 1 c 1 oracle jdbc Connection 1 struts using net beans 1 struts with data base 1. Dilip Bari. Powered by Blogger. About Me Unknown View my complete profile. Total Pageviews. Insert value in database using PreparedStatement How to use Array in java.

c program to calculate total price

Break String To Word in java.Your POS system should allow unlimited orders from any number of guest. Each guest should be able to order a drink, an appetizer, an entree, and a dessert. The program should present a total. In addition, the program should allow user to add to the order, delete from the order, and separate orders.

Creativity is advised. This is the current project that I have been assigned and I have no clue where to even start it. We have briefly covered arrays and I am not sure how to even go about writing code for this project. I am not asking anyone to code it for me, but if you could please help me look at some things that would allow me to understand how to write the code for this I would greatly appreciate it. The purpose of school work is to learn how to think.

To analyze problems, and come up with appropriate solutions. Break the problem up into parts. Identify classes of objects in the system, what their properties should be, and what their behaviors should be. Solve the problem intellectually and symbolically, then you will be ready to start writing software to implement the solution.

I'm unsure what you mean by that.

I need to write a Program for a restaurant. Using C. Need to add some items

The furthest we have covered was using arrays and I don't know how to fill the array with numbers that the user inputs based on how many guests there are. When is your assignment due? You will need some way to hold the name of the item ordered and quantity of each item. Your program will also have to have some way to calculate total price of each guest's bill.

To do that you will have to have another array of menu item names and their prices. You can do that with a structure that contains item name and price, or two arrays, one for names and the other for prices. Which one you choose will depend on if you know how to use structures or not.

Structures are preferable because they let you keep related items name and prices together easier. The assignment is due Tuesday and I have been struggling with it since last Tuesday.

I am familiar with cin and cout, but the only knowledge I have with arrays is how to fill them with random numbers or how to pre set it with numbers.

I don't know how I would hold the value of the item ordered either. Here are a few examples of character arrays. You will have to include string. How then would I allow the user to input different values at each array. In theory, I believe the program should work as if the waiter were to take the orders for a certain amount of seats.Sign in to post your reply or Sign up for a free account. By using this site, you agree to our updated Privacy Policy and our Terms of Use.

Manage your Cookies Settings. Join Now login. Ask Question. I have to write a program that asks for a cost-per-item, number of items purchased, and a discount rate. Then it should calculate the total cost, tax due, and amount due. Any suggestions would be helpful. Also, how do I put the discount rate as a percentage?

Expand Select Wrap Line Numbers. Sep 7 ' Post Reply. Share this Question. I am not really sure what a code tag is? I also figured out the percent question. Thanks for the help.

Sep 11 ' You see button in a message editor,well those arr code tags.

Table of Content

Question stats viewed: replies: 3 date asked: Sep 7 '07 Follow this discussion. Follow us to get the Latest Bytes Updates. Savage I have to write a program that asks for a cost-per-item, number of items purchased, and a discount rate. Also please use code tags for your code. Oh,and one more question: " Also, how do I put the discount rate as a percentage? Savage Sep 7 '07 reply. P: Sep 11 '07 reply.

C Program to Enter Cost Price and Selling Price and Find Profit or Loss

Savage I am not really sure what a code tag is? Savage Sep 11 '07 reply. Cancel Changes.Remember Me? Thread: Printing Receipt using C programming. Printing Receipt using C programming. Hi guys, Danial here. I wanna ask any experts here know how to print the output of the receipt using C programming language, based on the billing system that I had created using C.

I was thinking can I use character array to call back the output to the receipt from the food menu item from the functions? Thanks for your help and I really appreciate it. Originally Posted by danial I had created Anyway, font abuse snipped. If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut. If at first you don't succeed, try writing your phone number on the exam paper.

Ok guys, below are my C programme Coding. How can I print the food menu item on the receipt produced once an ordered is made, and can anyone help me to how to make a order cancellation function for it? Thanks and appreciate it very much. When you get to your total function, you want something like Code:. Originally Posted by Salem.

Not a full rewrite, but you need to store the details of the order in some sort of array or list: Code:. Originally Posted by anduril Well the problem you have at the moment is you do NOT store how many of each thing you've ordered.

Program to calculate the total expenses. ---06---

You just store the total. So you need to update your code so you store how many you've ordered not the total price.

Then you work out the price as you print the receipt. Similar Threads Help printing array in ascending order in C programming? By celticpride in forum C Programming. Replies: 5 Last Post:PM. Replies: 2 Last Post:PM. Replies: 6 Last Post:PM.

Replies: 10 Last Post:PM. Total newb to programming here Question about the many programming languages. By tsubotakid1 in forum A Brief History of Cprogramming. Replies: 11 Last Post:AM. All times are GMT The time now is PM. All rights reserved.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.

It then asks for an age for each of the tickets. Then it should be able to calculate the total cost of the tickets using these prices:. I'm using a while loop to get the user to enter multiple ages and an if statement to assign prices to the different ages. Learn more. Asked 5 years, 7 months ago.

c program to calculate total price

Active 5 years, 7 months ago. Viewed 7k times. Then it should be able to calculate the total cost of the tickets using these prices: If the owner is over 15 years old then the ticket costs Otherwise, if the owner is at least 8 years old then he pays Children younger than 8 years can get a ticket for free.

My question is how do I get it to calculate the total price of the tickets? Johba Johba 3 1 1 silver badge 3 3 bronze badges. It was that simple huh. Thank you sir. Active Oldest Votes. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name.

Email Required, but never shown. The Overflow Blog. The Overflow How many jobs can be done at home? Featured on Meta.

Community and Moderator guidelines for escalating issues via new response…. Feedback on Q2 Community Roadmap. Triage needs to be fixed urgently, and users need to be notified upon…. Dark Mode Beta - help us root out low-contrast and un-converted bits. Technical site integration observational experiment live on Stack Overflow.

Related Hot Network Questions. Question feed.


thoughts on “C program to calculate total price

Leave a Reply

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