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... - #include<iostream.h>
-
#include<conio.h>
-
main()
-
{float a, b, c, d, CD=50, FF=25, SD=15, AM, T, Vat, AD, CH, TCR, TFF, TSD;
-
textbackground(Lightmagenta);
-
clrscr();
-
textcolor(RED);
-
gotoxy(35,3)
-
cprintf("MC JOLLIBEE");
-
gotoxy(32,4);
-
cprintf("Cashiering System");
-
gotoxy(8,7);
-
textcolor(RED);
-
cprintf("PRODUCTS");
-
gotoxy(30,7);
-
cprintf("PRICE");
-
textcolor("BLACK");
-
gotoxy(7,9);
-
crintf("Chicken w/ Rice");
-
gotoxy(7,11)
-
cprintf("French Fries");
-
gotoxy(7,13);
-
cprintf("Softdrinks");
-
gotoxy(29,9);
-
cprintg("50.00");
-
gotoxy(29,11);
-
cprintf("25.00");
-
gotoxy(29,13);
-
cprintf("13.00");
-
textcolor(RED);
-
gotoxy(62,14);
-
cprintf("--------");
-
gotoxy(52,16);
-
cprintf("total");
-
gotoxy(52,18);
-
cprintf("10% Vat");
-
gotoxy(52,19);
-
cprintf("---------");
-
gotoxy(46,20);
-
cprintf("Ammount to Pay");
-
gotoxy(52,22);
-
cprintf("Cash");
-
gotoxy(62,23);
-
cprintf("---------");
-
gotoxy(52,24);
-
cprintf("Change");
-
gotoxy(48,9);
-
cin>>a;
-
gotoxy(48,11);
-
cin>>b;
-
gotoxy(48,13);
-
cin>>c;
-
gotoxy(67,9);
-
TCR=CR*a
-
cout<<TCR;
-
gotoxy967,11);
-
TFF=FF*b
-
cout<<TFF;
-
gotoxy(67,13);
-
TSD=SD*c
-
cout<<TSD;
-
gotoxy(67,16);
-
T=TCR+TFF+TSD
-
cout<<T;
-
gotoxy(67,18);
-
Vat=T*0.1;
-
cout<<Vat;
-
gotoxy(67,20);
-
AP=T+Vat;
-
cout<<AP;
-
gotoxy(67,22);
-
cin>>d;
-
gotoxy(67,24);
-
CH=d-AP;
-
if(d<AP)
-
cout<<"Invalid";
-
else
-
cout<<CH;
-
getch();
-
return 0;
-
}
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..
3 3497
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.
where did put the loopings?
Here's the logic: - do
-
{
-
-
// your code goes here
-
-
} while ( next transaction == yes );
-
I recommend you read up on loops. There are many examples on the Internet.
Sign in to post your reply or Sign up for a free account.
Similar topics
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
*...
|
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...
|
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...
|
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...
|
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...
|
by: nguyenthao |
last post by:
How to convert a Pascan program to C program?
|
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...
|
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.
...
|
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...
|
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
|
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...
|
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...
|
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...
|
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,...
|
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...
|
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,...
|
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...
|
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,...
| | |