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
ADVERTISEMENT
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
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
View Related
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
Oct 20, 2012
Is it common practice to package methods with other elements(string-s, int-s, float-s, array-s...) of struct?
Than struct acts as a class or is acting similar to class and that have no sense to me? I am new to OOP .
View 4 Replies
View Related
Apr 25, 2013
SYNOPSIS : KBJ tourist agency Sdn. Bhd wants you to write an application program to calculate the total price for their customers for a package of vacation. The following table shows the price for three destinations (transportation and accommodation) offered by the agency:
Destination TransportationAccommodation
Pulau Redang Child RM15.00
Adult RM30.00RM95 per day
Pulau Perhentian Child RM20.00
Adult RM30.00 RM100 per day
Pulau Kapas Child RM10.00
Adult RM20.00 RM120 per day
This agency company will give some discount to a group of customers with is:
a.10% discount will be given for the group that has a least 5 adults.
b.25% discount will be given for the group that has more than 5 persons (adults and children)
c.30% discount will be given for the group that has at least 15 persons.
Your application program has to display the output using this following screen layout:
KBJ TOURIST CUSTOMER INFORMATION
Customer’s name: XXXXXXXXXXXXX
Number of Children:XXXXX
Number of Adult: XXXXX
Transportation: RMXXX.XX
Accommodation: RMXXX.XX
Total price: RMXXXX.XX
This is the code i got so far but it doesn't work..:(
#include <iostream.h>
int main () {
char customerName,code,A,B,C;
int childNum,adultNum;
double rate,discount,totalPrice,a,c;
[Code] .....
View 8 Replies
View Related
Mar 27, 2014
I am working on a project that is like a banking system and needs to include making a withdrawal, transaction, deposit, query, and transaction.
Code:
#include <stdio.h>
//#define true
//#define false
//assume there is money in the account. $10,000
void deposit(){
[Code] ....
View 1 Replies
View Related
Mar 1, 2013
I just started my task with Ordering system. what should I use if I'm going to ask the user if he wants to exit the system, he will press(zero)0 to exit the program and press Y(uppercase or lowercase) to continue?
View 1 Replies
View Related
Apr 17, 2013
So I know that I can call a program by system("prog.exe"), but what do I add in when I want to pass a parameter?
View 2 Replies
View Related
Dec 22, 2014
I am trying to recreate this bash command in c code:
Code: bash-4.2$ exec 3<<<teststring
bash-4.2$ cat <&3
teststring
bash-4.2$
I've written a small program to do this as shown below:
Code: bash-4.2$ cat test.c
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
[Code].....
View 3 Replies
View Related
Sep 17, 2014
how to invoke a UNIX command within a program
I found this:
dd if=/dev/urandom of=myrandom bs=100 count=1
and I found this:
dd if=/dev/zero of=mytestfile.out bs=1 count=0 seek=1G
I want to call this command, by using the command line and typing Generate or something to that effect.
Basically, I want to be able to build random size files, content isn't important to me at this time.
View 8 Replies
View Related
Jan 20, 2014
I know there has to be a system call for a pause function. I simply want the program to pause for a few seconds before executing the next line of code. I do NOT want the user to enter a keypress, just pause the output or code execution for a few seconds.
system (pause); waits for keypress right? I just want it to wait 3 seconds before proceeding. I know it should take an argument for milliseconds right? Also, this is for a homework assignment I have already completed, just doll'in it up a bit for extra credit...maybe...
View 7 Replies
View Related
Feb 7, 2013
I want to run Unhidden.exe in drive N: and send char to that program. I use function like this
Code:
system("N:/Unhidden.exe");
It can open Unhidden.exe but it run in visual studio 2010Projects . I try to use command N: and Unhidden.exe in cmd it can run in drive N: . So I try to use function like this
system("N:");
system("Unhidden.exe");
but it not found Unhidden.exe . How to use 2 command in sytem() function ?
View 4 Replies
View Related
Feb 2, 2014
I know there has to be a system call to pause (not system("pause") execution of a program for a few seconds. I would like to give the illusion that my program is 'thinking' rather than just spit out the result as soon as the user has hit the enter key.
View 5 Replies
View Related
Sep 26, 2013
I am trying to fetch data from the USB device(say pendrive) connected to the USB port of a system. I have attached code.c file which I have wriiten for the same purpose, please find it. Here I am able to open the device file and read some random raw data which is in the log.txt file (also attached to this mail). But I want it to fetch data like minicom/teraterm does.
What methods and libraries I can use to do it successfully and how can it be done.
View 2 Replies
View Related
Apr 28, 2014
I need to program and simulate a 2 floor lift control system. How to do that ? I need to design its program only.
View 1 Replies
View Related
Nov 13, 2013
How difficult would it be to program a hash-map system where each "key" can have multiple values under indexes?
For example: "Word" -> 45(index 0) , 67(index 1) , 12(index 2). What could I start with to program this or where could I find a pre-made system that does this?
View 14 Replies
View Related
Dec 18, 2014
I have to write a function for the destruction of the planetary system "solid". With the destruction of the planetary system, the asteroids where the gap between this one and the object, is smaller that "gap" will also be destructed. (so, they have to be deleted) The asteroids for which the gap is greater are converted to free-floating planets so they have to be inserted into the tree of free-floating planets. The total cost of the transport of all the asteroids that are converted into free-floating planets in the tree of free-floating planets should be $O(n)$, where $n$ is the maximal between the elements of the tree of free-floating planets of the star system to which the object belongs and the elements of the tree of asteroids of the planetary system of which the object has identifier "solid". The field "gap" of the new tree should have the value $0$. The destructed planetary system should be deleted from the list of planetary systems of the star system to which it belonged. (The tree of free-floating planets is not a binary search tree)
I have done the following: [URL]
Is the way I deleted the nodes correct??
View 4 Replies
View Related
Feb 11, 2013
I wish to add the item 'Website' to an MFC Dialog app System Menu so that it can activate the following method:
Code:
void CMyDlg::OnWebpage()
{
ShellExecute( NULL, NULL, _T("[URL]..."), NULL, NULL, 0 );
}// OnWebpage()
I have tried this:
Code:
#define IDM_WEBSITE (WM_USER + 101)
//..
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
pSysMenu->AppendMenuW(MF_STRING, IDM_WEBSITE, _T("Website"));
}
[Code]...
The code compiles without error but and the 'website' item appears on the System Menu but it doesnt do anything.
I've inspected the following but don't really understand how it works and it seems to me there should be a simpler way to accomplish my end.
Modifying the System Menu By John Simmons 26 Jan 2007 [URL]....
View 8 Replies
View Related
Apr 29, 2014
I have a very strange problem with the system() function (on XP).
I have the following code:
Code:
char *text1 = ""A SpaceAction.bat" fred";
char *text2 = ""A SpaceAction.bat" "fred"";
int main(int argc, char *argv[]) {
printf("%s
", text1);
[Code] .....
When I run it where "A Space" is a directory with a space in the name, this is the result:
Code:
"A SpaceAction.bat" fred
F:Test>echo Testing
Testing
"A SpaceAction.bat" "fred"
'A' is not recognized as an internal or external command, operable program or batch file.
It seems that the double quotes round an argument make the parsing of the command fail.
View 1 Replies
View Related
Oct 23, 2013
I am trying to create a NFA from a regular expression. I have a grasp on reading in the regular expression and being able to make a stack from it. The part I am struggling on is mapping the characters in the regular expression to an integer indicating the variables order in the expression. I am just not sure how to go about this.
My code so far...
Code:
#include<stdio.h>
#include<stdlib.h>
#include "stack.h"
int main(void)
{
char expression[80];//array to store regular expression
[Code] .....
View 6 Replies
View Related
Aug 25, 2014
I have this bit of code that I found here: [URL] and at first regex would work, but then when I hit "[]" it wouldn't. Here's the code:
#include <iostream>
#include <string>
#include <regex>
[Code]....
View 2 Replies
View Related
Dec 11, 2013
I have written a program which uses a pid to check if the process is currently running and return a value based on the system call result.But the program core dumps
Code:
#include <stdio.h>
#include <string.h
int main( argc, argv )
int argc;
char * argv[];
{
int p_pid = 99;
char buff[1000];
}
[code]....
What is the mistake in this code and is it portable in both unix/linux , is the method secure (grepping for program name )?
View 6 Replies
View Related
Sep 15, 2013
I'm writing a program to turn the two commands "gunzip file.tar.gz" then "tar -xvf file.tar" into "x file.tar.gz", but I've ran into a problem I can't find a solution to, here are the outputs I get depending on if I use a gunzip -f flag in my system() call or not:
if I use: (void)system("gunzip ", store );
> x file.tar.gz
gzip: compressed data not read from a terminal. Use -f to force decompression.
type: gzip -h
store 1: file.tar.gz
tar: option requires an argument -- 'f'
[code]....
I don't know if the problem is something to do with my code or something to do with gunzip and if it is to do with gunzip if I can even solve it with my code? I've tried for a while to find more info and read the gunzip man file, ran "gunzip file.tar.gz" outside of my program and found that it works normally producing file.tar so I suspect the problem is related to system()?
View 3 Replies
View Related
Jan 2, 2013
Why do i get this error?
View 4 Replies
View Related
Dec 8, 2012
I have two pieces of code:
Code:
#include <cmath>;
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>
#include <iomanip>
[Code] ....
I am using the gnu glpk library to calculate a linear program for my matrices. Why I get the error message exit code 3 which apparently means "The system cannot find the path specified"?
View 12 Replies
View Related