C++ :: Billing Program For A Bakery

Jul 25, 2014

So, the point of this program is to make simple billing program for a bakery. The program starts by having the cashier enter in the prices for single muffin, a half-dozen, and a dozen muffins. Then, the cashier enters in the amount that the customer wants. Based on the amount entered, the program will return the best offer. (For example, if the customer wants 11 muffins, but the price of 11 individual muffins is greater than the price of a dozen muffins, the program will recommend the customer by a dozen muffins). I'm having trouble getting my program to do the calculations correctly. I think my algorithm is correct, but it's not displaying properly.

#include <iostream>
#include <iomanip>
#include <cstring>
using namespace std;
class Bakery {

[Code] ....

View 7 Replies


ADVERTISEMENT

C++ :: Program To Compute And Print A Billing Statement For Each Patient

Oct 17, 2013

Community Hospital needs a program to compute and print a billing statement for each patient. Charges for each day are as follows:

a. room charges: private (P) room = $125.00; semi-private (S) room = $95.00; or ward (W) = $75.00
b. telephone charge = $1.75
c. television charge = $3.50

Write a program to get data from the keyboard, compute the patient’s bill, and print an appropriate statement. Typical input (nut yours do not have to be identical to this) is the following:

How many days was the room occupied? 5
What type of room? P
Telephone used during the stay? N
Television used during the stay? Y

Keep in mind that the user needs to know that the input can be any integer number of days for the length of stay, either (P, S, or W) for the room type, and either (Y or N) for both telephone and television options.

A statement (which yours MUST be identical to) for the data given follows:

Community Hospital Patient Billing Statement

Number of days in hospital: 5
Type of room: Private
Room charge:$ 625.00
Telephone charge:$ 0.00
Television charge:$ 17.50

TOTAL DUE = $642.50

View 3 Replies View Related

C++ :: Program For Billing System - Regular Package Function

Jan 5, 2015

I have programmed a program for billing system. I have used parameters and arrays. All the functions are working except a one function. (Regular package function).

#include <iostream>
#include <fstream>
#include <string>
#include <ctime>
using namespace std;
void main(int &minutes, int &minutesd,int &minutesn) {

[Code] .....

View 3 Replies View Related

C/C++ :: Create Billing System Without Using Pointers - Array Calculations

Feb 17, 2014

I am trying to create an billing system "without using pointers". This is my class assignment. In this,

1) User inputs the name
2) The system asks how many items he has purchased
3) Displays a bill number [just a random number]
4) System asks for the item names the user purchased and stores them in an array (of max 10 (ten) inputs (or items))
5) After each item the user inputs, the system asks for the price of the item (stored in an array of numbers)
6) The total bill is calculated, by adding the sum of all prices in the array

I am having terrible difficulties in coding #4 and #5. Somehow, they aren't going well together. Here's what I have:

#include<stdio.h>
#include <stdlib.h>
int main() {
char item[10][10], answer = 'y', name;
int price[10], total_item, total_price = 0, i, j, a, total_bill = 0, max_items = 10, max_char = 10;

[Code] ....

You might find a lot of unused variables

View 10 Replies View Related

C++ :: Program With Do-while Loop To Restart Program And Validation

May 11, 2013

I am having problems at the end of the program with the do-while loop to restart the program and the validation.

#include <iostream>
#include <string>
#include <iomanip>
#include <cstdlib>
#include <time.h>
using namespace std;

[code]....

View 3 Replies View Related

C/C++ :: Program Which Removes Notes From Program File

Mar 10, 2014

so my homework assignment is to make a program of which removes any notes in a program file.

for example, you run my program it will ask for a filename, when entered it opens the file, copies everything in it and removes any double forward slashes (//) and anything after that up to the new line character ( ) and anything between /* and */ including the /* and */.

i created the entire program and it removed the // and anything after that up to the new line character but will not remove anything after the first / when it finds a /*. This includes the */ at the end of the comment.

the section of code that removes the comments is

//this loop removes all notes
for(i=0;i<buf.st_size;i++) {
if((filecontent[i]=='/')&&(filecontent[i+1]=='/'))//removes notes using //
{
for(i=i;filecontent[i]!='
';i++)
filecontent[i]=' ';}

[Code]....

i know that the section that removes the multi line comments would not remove the final */ at the end if it did work, i was planning to fix that later once it removed the comment.

View 6 Replies View Related

C++ :: Transform Program To Program Using Class

May 15, 2014

I have my program to load info about students from .txt file

Mrkvicka Jozef 2 1.75 2.1 0.4 1 0.49 1.27
Hrasko Jan 0.1 0.38 1 1.2
Mladek Peter 1.6 0.4 2 1.3 1.8
Petrzlen Robert 0.6 0 1.1 1.1 0.6 0.59
Horvath Ivan 1.6 0.8 0.7 1.3 1

My program is ruuning perfectly only problem is that i must transform it to program uses class, class student . Am very beginer in using classes, so far i do very easy programs using classes.

so far i have this

#include "stdafx.h"
#include "student.h"
student::student(vector<STUDENT> studenti) {
vStudent=studenti;

[Code] ....

I try to make it but its too difficult for me. in that student.h and student .cpp is 50 errors..

Here is my code

#include "stdafx.h"
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <fstream>
using namespace std;

[Code] ....

View 13 Replies View Related

Visual C++ :: Program Run In Another Program

Jul 22, 2014

I want to make a program which can run in another program. My program have structures flowing:

while (1) {
check (keypressed);
{
do something;
}
}

But check(keypressed) function only active in my program, It can't run in another program.

View 7 Replies View Related

C++ :: SDL - Can't Run Program Outside Of IDE

Sep 4, 2013

I've been working on a small SDL program and decided I wanted to throw the program on to a disc so I could show some people what I'm working on. However, when I try to run the executable, the program crashes and under more details it says that the fault lies on SDL2_ttf.dll .

Why does this program work inside of VS2012e and not in windows?

What I did :

Set the program to release, hit f6, and then tried to run the executable from windows.

Additional information :

Compiler : Visual Studio 2012 express
O/S : Windows 7 64bit
SDL lib : 32 bit version

View 8 Replies View Related

C :: How To Get Program To Write Itself

Aug 27, 2013

For instance Code: int counter;
counter =0;
FILE *pfile;
pfile= fopen("g:myprog.txt" "w");
while (counter >100)
{ fprintf (case counter{something})}; how do I do this?

View 11 Replies View Related

C :: How To Get Average Of Program

Mar 20, 2013

Cannot divide the real output of the AVERAGE.:

Code:

#include<stdio.h>
#include<conio.h>
struct student
{
char Name[50];

[Code]....

View 7 Replies View Related

C :: How To Get Output Of Program

Dec 8, 2013

how to get the output of this program.. I'm not completely lost but I need it in the simplest terms.

Code:

/*Recursive Trace
Written by Ron
April 2006
*/

[Code]....

View 9 Replies View Related

C :: Have A Program Where It Ask For Three Numbers

Feb 1, 2013

is there anyway to have a program where it ask for three numbers and you shows which which number is the largest and which is the smallest, e.g.

Enter 1st number: 30
Enter 2nd number: 10
Enter 3rd number: 30
Largest = 30
Smallest = 10

View 12 Replies View Related

C :: Natural Log Program

Oct 16, 2014

I am working on a program to compute the natural log of numbers using several different methods, but I am having a couple of issues. Firstly, when using Borchardt's Algorithm I almost always end up with nan as a result, even though I am pretty sure I got the formula correct. Also, in my lnDemo.c file It doesnt give me the correct answer and the second time around I get a segmentation fault.

Code:

//myLog.h-------------------------------------------------------
//These functions will compute or aproximate the natural log of a number
//This method will use a formula to compute it
int lnFormula(double x, int m,double *result);

[code]....

View 7 Replies View Related

C :: Program Is Not Terminated

Feb 26, 2014

I have written the below code,

#include "stdio.h"
int main() {
int c;
while((c=getchar()) != EOF) {
putchar(c);
}
}

The above program is not terminated.how to terminate it?

View 3 Replies View Related

C# :: How To Add More Than One Database In A Program

Mar 5, 2014

Is it possible to add more than one database in a C# program if so, how?

View 7 Replies View Related

C :: Program That Runs On A PC But Not On Another

Mar 6, 2015

I'va create a c program that scans the web from a root it works on mypc but dont works on another pc of my friend.I have created this project with Visual Studio 2013 disabling extension to obtain standard ansi c project.

View 2 Replies View Related

C :: Age Identifier Program?

Jul 2, 2013

I have an issue with a switch case in my program. I execute it and it does fine all the way up to where it says, "Answer (1, 2, or 3): ". When I enter 1, 2, or 3, it gives me' "Not an input choice!" from the default of the switch case.

NOTE: I use Code::Blocks on Windows XP.

Here is the code:

Code:

#include <stdio.h>
#include <string.h>
int main() {

[Code].....

View 8 Replies View Related

C :: Using More Than One If Subroutine In One Program

Mar 20, 2014

Can we use more than one 'if' subroutine in one program. I am trying to implement this but if I run the two subroutines at the same time the lower subroutine directly shows "invalid grade". But if I run one at a time then they work perfectly fine.

Why is this happening? Does the compiler think that its the same "if" routine. If so how do I segregate it???

Code:
printf("Enter a score:");
scanf("%d",&gr);
if(gr>=80 && gr<=100)
printf("A Grade
");
if (gr>=60 && gr<80)
printf("B Grade

[Code] ....

View 8 Replies View Related

C :: Program Not Printing Exactly

Mar 9, 2013

I expected this program to print out:

Code: Enter your desired monthly salary: $2000___
Gee! $2000.00 a month is $24000.00 a year. Instead, it printed out:
Code: Enter your desired monthly salary: $2000___

Gee! $2000.00 a month is $24000.00 a year. I don't understand how it got the extra nextline in the middle.

Here is the code:

Code:

#include <stdio.h>
int main(void) {
float salary;
printf("aEnter your desired monthly salary:");

[Code].....

View 2 Replies View Related

C++ :: Program To Calculate BMI

Oct 7, 2013

I'm trying to successfully run a program that calculates your BMI but, although it runs, it is not giving the the correct math. Instead, it gives me the number i've submitted as my weight as an answer. I'm using Visual Studio 2008 and the formula: weight / (height/100)*2

Here is my code

#include <iostream>
#include <cmath>
using namespace std;
int main() {
int weight;
int height;
double BMI;

[Code] ....

View 2 Replies View Related

C++ :: Roman Num To Int Program

Dec 20, 2013

Basically i am really close (i think) and the numbers im getting when i run it are weird like for instance i should get back a one if i enter in I or i but instead im getting like 178976087.

MAIN:

#include "stdafx.h"
#include "iostream"
#include <iomanip>
#include "romanType.h"

using namespace std;
int main() {
romanType r;

[Code] .....

View 5 Replies View Related

C++ :: Program To Get Sum Of Series

Feb 26, 2013

Why isn't this program working?

#include<iostream.h>
#include<conio.h>
void main() {
clrscr();
int n;
float x, t, sum=0;

[Code] ......

View 15 Replies View Related

C++ :: Use Value 0 To Terminate Program

Mar 20, 2013

"Allow the user to enter an integer, between 1 to 9 only. You may use the value ‘0’ to terminate the program. Then display the output as follows:

Sample Run 1
Enter an integer (1-9):4
1
121
12321
1234321

Sample Run 2
Enter an integer (1-9): 20
You have entered an invalid entry, please try again.

Enter an integer (1-9): 0

(Try to use remark to explain function and process area)

View 3 Replies View Related

C++ :: Running A Program Outside IDE

Jul 23, 2014

after you have compiled a program can you run it without an IDE?

View 17 Replies View Related

C++ :: How To Know If Classes In Program Are Being Used

Aug 13, 2014

In this program the intention is to create a menu driven program for a pizza restaurant. I have to use a class called Pizza and have to include at least three public functions; one is called SetSize, another one is called Display, and the last one is called ComputePrice. A small pizza is worth $10, a medium is $14, and a large is $17. Each topping is worth 2 dollars. I know that the program runs correctly, but I have doubts over the classes and function actually being utilized correctly or at all.

Program:

#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
class Pizza {
private:

int size;
int style;

[Code] .....

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved