|
Cuu wrote:
Hi ThatsAlok
Love
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Cuu wrote:
My question is how do I print out a CHar at a specific position in DOS screen.
These three come to mind:
cout
printf()
WriteConsole() (preceded by a call to <code>SetConsoleCursorPosition()</code>)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
*first time to use classes and i need help to do this plz*
Imagine that you are ready to go shopping. You remember your list of items to buy, place some money in your wallet, and off you go. Once you have parked the car away from the loose carts in the lot, you stroll into the store, grab a cart of your own, and head toward your listed items. When you have finished selecting your stuff, you find the shortest checkout line. What happens next? You wheel the cart into the checkout area, and the clerk removes the items one at a time and scans them through the register. The clerk tells you the total cost of your purchases. You reach into your wallet and (assuming you have enough money) give the clerk the balance due, get the bags, and leave the store.
Now we need to think about a program design that models this shopping scenario. What are all the real-world objects? There is a shopper. There is a checkout clerk. The shopper has a wallet. There is also a shopping cart. And there are items that the shopper wants to buy.
How are all these objects related? The shopper has a wallet. The shopper interacts with (uses a) checkout clerk. These relationships are fairly obvious. However, the relationship between the shopper and the shopping cart is not so clear. (Remember, in a has a relationship, the object is an integral part of the containing object, whereas in the uses a relationship, the second object provides a service to the first object.) The shopper uses a cart (true enough). We can argue that the shopper must carry his or her items and the cart does this task for the shopper; therefore, the cart is an integral part of the shopper.
The Cart class can now be started. Assuming a Cart object is capable of holding up to 10 Items. The software cart also needs to keep track of how many items it contains and to have the ability to add an item into the stuff array. Also, because the data is private, we need to access the array of items. The cart should be smart enough to calculate the price of the items it holds at any point of time. Shoppers can add or return items out of his shopping carte before he checks out.
Shopper reads the items from a data file called StuffToBuy.dat. This file contains the item name, price, and quantity.
For example, our Shopper might have a list that looks like the one here:
whole wheat bread 1.99 2
vanilla Ice cream 4.59 1
honey 2.69 1
apples 0.25 6
decaf coffee 5.99 1
When the items are placed in the Cart and checked out, each item (whether the Shopper purchased one or many) is treated as a single item. Add the ability for the Clerk to report the item name and price as the items are scanned during the checkout procedure. Also, have the Clerk add a 5 percent sales tax to the total purchase amount and report the number of items scanned. The Shopper should write out the amount of money in his or her wallet before and after the shopping experience. Clerk should be able to calculate the total amount he has at any point of time and should be able to check the store’s stock at any point of time as well.
|
|
|
|
|
Your homework looks lovely. If you want people to do it for you ( and therefore to fail your exams ), go to rentacoder.com, I'll be happy to bid on it there. If you want help, try to do your own homework, and post here when you get stuck.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
umm first its not a homework...its a home work of another section as there r two sections i'm in the other one. and i jst wanna know how to do it. and compare it to mine. but thx anyway
|
|
|
|
|
i need help in the header files coz i am not sure about it. i have: cart.h clerk.h shopper.h wallet.h
i will call the wallet.h and cart.h in the shopper.h as they r part of him. i just wanted to put on the right track.
thanks,
|
|
|
|
|
I need to do something about Java now.
I know a lots MFC programmers use Java also.
I hope to find good and very popular Java forums first.
thanks for links to those Java forums.
includeh10
|
|
|
|
|
Does any one know how to prevent a window from restoring when double clicking on the title bar ?????
|
|
|
|
|
|
I'd like to start studying Win32 programming. Do you know any websites containing good material for beginners and advanced programmers? Thank you!
modified 9-Mar-17 17:25pm.
|
|
|
|
|
like msdn.microsoft.com[^] ?
I would also recommend Petzold's book "Programming Windows".
btw Codeproject is good resource for Win32 programming, too.
best regards
David 'DNH' Nohejl
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
This drives me nuts
I open a dialog in its own GUI thread.
When I press a key the action that key should do is done. BUT I also get this
annoying popping sound like I pressed an illegal key. How do I stop that?
If I return TRUE when WM_KEYDOWN message is sent to PreTranslateMessage it stops BUT then the controller that is in the dialog does not work since it needs all the key messages.
/Mathias
|
|
|
|
|
Hi,
I am hoping somebody can help mw with this problem I have:
I have a CRichEditCtrl in a dialog. I read some text in from a file. I check each line of the CRichEditCtrl to see if it contains a particular string. If the line doesn't contain the string the whole line should be disabled.
How exactly do i set the text to be protected?
Thanks
dlarkin77
|
|
|
|
|
How about a call to SetSelectionCharFormat() ? Check out the CFE_PROTECTED effect.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi all
I have a dialog based application in which I am creating a dialog with CreateDialog() function . So I have only the HWND of the new dialog. I am yet to find the ways to Load an image into the new dialog for which I am having only the HWND . ( Most LoadImage () LoadBitmap() are meant for loading a bitmap or jpg image to the parent window -thats parent dialog only )
any ideas pls
regds
Dharani babu S
|
|
|
|
|
Hi.
if the picture loaded on splash dialog or a temp Dialog
u can use BitBlit (API) function to draw image on any place
even though on disktop window.
if you does'nt know how to use it read the follwing.
BitBlt function as any bilting functions copy image from DC
(Device context) to anthoer DC
.
To draw image on your dialog you can use the follwing steps: -
1- creaet DC
HDC hdc=this->GetDC()->m_hDC;
/*this pointer to your dialog ,if u have only HWND of the dialog use*/
HDC hdc=::GetDC(dialoghwnd);
HDC temp_hdc=CreateCompatipleDC(0);
//2-load bitmap
HBITMAP hbmp=(HBITMAP)Loadimage(...);
//3-select it into temp DC
SelectObject(temp_hdc,hbmp);
//4-copy it into hdc using BitBlt
BitBlt(......);
if it is not help u im sorry
On Earth nothing impossible,
while your mind running.
Faroqtam
|
|
|
|
|
Hi faroq
Greattttt!!!!!!! It worked well . I was bit doubtful about the top, left alignment of the bitmap . It jolly well took the HWND as the parent co ordinate. Thanks a lot
regds
Dharani Babu S
|
|
|
|
|
It worked!!!!!!!Tnx a lot
Regds
Dharani
|
|
|
|
|
I am a computer engineering student and I am writing an elevator simulator. I have to write a random function which creates a random number with uniform distribution. can someone help me about my problem as early as possible.
About my work:
People have weight. this weight must be between 45 and 100. there is an avarage weight. Avarage number is given before the simulation starts.Person will get his/her weight randomly. random function must creates the person's weight with uniform distribution.
ex: avarage weight: 79
1.person's weight : 54 (Random)
2.person's weight : 86 (Random)
3.person's weight : 97 (Random)
avarage : 97
seyirdefteri
|
|
|
|
|
See if either of these help:
http://mathworld.wolfram.com/RandomNumber.html
http://mathworld.wolfram.com/UniformDistribution.html
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
In MFC I can use TRACE macro to write output window.
How to do that in non MFC app?
|
|
|
|
|
From memory there is a function named OutputDebugString() which will do this. Also have a look at AMLOG here on CP which I don't think uses MFC. There are lots of examples of logging code here on CP. I use AMLOG in Surfulater and am very pleased with it.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
Yeah, I found out about OutputDebugString() from a DirectX game programming book. I can't believe that I never saw that in any of the other beginner's books I used when I first started learning!
If I write code in my sleep, does that make me brilliant, or just a lazy programmer?
My articles
www.stillwaterexpress.com
BlackDice - the programmer formerly known as bdiamond
|
|
|
|
|
|
OutputDebugString always writes the traces, TRACE only in Debug builds.
If you are using ATL/WTL there is ATLTRACE.
we are here to help each other get through this thing, whatever it is Vonnegut jr. boost your code || Fold With Us! || sighist | doxygen
|
|
|
|