473,395 Members | 2,079 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

cashiering program for my project., this cashiering program is Mc Jollibee....

hello..
I make a cashiering program but I dont know how would this program go back after the transaction..
this is the program I made...

Expand|Select|Wrap|Line Numbers
  1. #include<iostream.h>
  2. #include<conio.h>
  3. main()
  4. {float a, b, c, d, CD=50, FF=25, SD=15, AM, T, Vat, AD, CH, TCR, TFF, TSD;
  5.  textbackground(Lightmagenta);
  6.  clrscr();
  7.  textcolor(RED);
  8.  gotoxy(35,3)
  9.  cprintf("MC JOLLIBEE");
  10.  gotoxy(32,4);
  11.  cprintf("Cashiering System");
  12.  gotoxy(8,7);
  13.  textcolor(RED);
  14.  cprintf("PRODUCTS");
  15.  gotoxy(30,7);
  16.  cprintf("PRICE");
  17.  textcolor("BLACK");
  18.  gotoxy(7,9);
  19.  crintf("Chicken w/ Rice");
  20.  gotoxy(7,11)
  21.  cprintf("French Fries");
  22.  gotoxy(7,13);
  23.  cprintf("Softdrinks");
  24.  gotoxy(29,9);
  25.  cprintg("50.00");
  26.  gotoxy(29,11);
  27.  cprintf("25.00");
  28.  gotoxy(29,13);
  29.  cprintf("13.00");
  30.  textcolor(RED);
  31.  gotoxy(62,14);
  32.  cprintf("--------");
  33.  gotoxy(52,16);
  34.  cprintf("total");
  35.  gotoxy(52,18);
  36.  cprintf("10% Vat");
  37.  gotoxy(52,19);
  38.  cprintf("---------");
  39.  gotoxy(46,20);
  40.  cprintf("Ammount to Pay");
  41.  gotoxy(52,22);
  42.  cprintf("Cash");
  43.  gotoxy(62,23);
  44.  cprintf("---------");
  45.  gotoxy(52,24);
  46.  cprintf("Change");
  47.  gotoxy(48,9);
  48.  cin>>a;
  49.  gotoxy(48,11);
  50.  cin>>b;
  51.  gotoxy(48,13);
  52.  cin>>c;
  53.  gotoxy(67,9);
  54.  TCR=CR*a
  55.  cout<<TCR;
  56.  gotoxy967,11);
  57.  TFF=FF*b
  58.  cout<<TFF;
  59.  gotoxy(67,13);
  60.  TSD=SD*c
  61.  cout<<TSD;
  62.  gotoxy(67,16);
  63.  T=TCR+TFF+TSD
  64.  cout<<T;
  65.  gotoxy(67,18);
  66.  Vat=T*0.1;
  67.  cout<<Vat;
  68.  gotoxy(67,20);
  69.  AP=T+Vat;
  70.  cout<<AP;
  71.  gotoxy(67,22);
  72.  cin>>d;
  73.  gotoxy(67,24);
  74.  CH=d-AP;
  75.  if(d<AP)
  76.   cout<<"Invalid";
  77.  else
  78.   cout<<CH;
  79.  getch();
  80.  return 0;
  81. }
and my problem is how can I put Date and how can I repeat this program to the next transaction of cashiering by adding "Do you want to go next Transaction? [y]es [n]o"

hope you can help me
thank you..
Sep 25 '12 #1
3 3497
weaknessforcats
9,208 Expert Mod 8TB
You need to use a loop. Probably a do-while loop. At the end of the loop you ask whether to continue and while the answer is yes you return to the start of the program.

You will also need to solve how to store data for multiple customers.

BTW: You are using the C++ cin>> but the rest of the program is written in C. I suggest you pick one language or the other and stick to that one.
Sep 25 '12 #2
where did put the loopings?
Sep 26 '12 #3
weaknessforcats
9,208 Expert Mod 8TB
Here's the logic:

Expand|Select|Wrap|Line Numbers
  1. do
  2. {
  3.  
  4. //  your code goes here
  5.  
  6. } while ( next transaction == yes );
  7.  
I recommend you read up on loops. There are many examples on the Internet.
Sep 26 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Berislav Lopac | last post by:
I am looking for a good project management program, with as much of the following features as possible: * Web based * open-source, or at least free * has a good gantt chart module *...
3
by: fripper | last post by:
I want to write a sort of "program manager" (in VB 2005) from which users can select from a list of other programs I have written ... and then when the user exits that program have control come...
8
by: priyachari | last post by:
Hi , Can anyone suggest me how to read the contents from an Array from C program while the array is actually populated from another program in C++ More specifically, what i like to do is read...
1
by: Netaro | last post by:
Well... So, i have a program. A normal program, which does something, and so.. and i have another program, which wants to run the first program.... So, there are 2 questions about that problem...
1
by: Jim Langston | last post by:
Windows. Situation: Using a Python program called OpenRPG. I have a program that displays form data (a character sheet) in C++. I am able in the C++ program to build a string and copy it into the...
1
nguyenthao
by: nguyenthao | last post by:
How to convert a Pascan program to C program?
9
by: Fsunka | last post by:
Hey, I have a project due around February 28. I have to create a program that asks the user for the number of players that want to play bingo. Then it creates that many bingo cards. Then it calls...
8
by: TxAg03 | last post by:
I ran an outside program that launched another program. I created a process for the launcher program and waited for that to exit, but what I need is to have it wait for the 2nd program to exit. ...
2
by: xinnie | last post by:
Ok guys, I need to write a project management program including the datas like who did what, when, in what time interval, when was the deadline, what is the process etc etc, the list goes on. I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.