User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 427,168 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,067 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 2379 | Replies: 4
Reply
Join Date: Apr 2005
Posts: 2
Reputation: kparnell is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
kparnell kparnell is offline Offline
Newbie Poster

Help Need Urgently - C++ Gui

  #1  
Apr 22nd, 2005
I got this assignment to do, but i cant so it, i have tried everything i know in C++ programming and its not working. Can someone help me please.

Write a Graphical User Interface program that simulates the activities of a vending machine. The program should allow for full user input. The requirement for the assignment is as follows:

· Allow the user only to input 5p,10p, 20p,50p, 1.00 notes as legal tender.

· Candy cost 80p , Sugar Rock cost 1.20p , Babydiamond cost 70p.

· The program should be able to calculate the customer’s change given that a discount of 10% is given for more than three items bought.

· The program should be fully validated and generate Pop-up menus, activate on mouse or key events for user input.

· The ability to come up with a creative and original interface design
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2004
Posts: 6,333
Reputation: Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of 
Rep Power: 28
Solved Threads: 458
Super Moderator
Narue's Avatar
Narue Narue is offline Offline
Expert Meanie

Re: Help Need Urgently - C++ Gui

  #2  
Apr 22nd, 2005
What have you tried? Prove that you've made some sort of attempt or you won't get much help.
I'm a programmer. My attitude starts with arrogance, holds steady at condescension, and ends with hostility. Get used to it.
Reply With Quote  
Join Date: Apr 2005
Posts: 2
Reputation: kparnell is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
kparnell kparnell is offline Offline
Newbie Poster

Re: Help Need Urgently - C++ Gui

  #3  
Apr 22nd, 2005
i am just learning this, i dont even know how to add a textfield.

i have a dialog box though.

include <windows.h>
#include "resource.h"

BOOL CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR cmdParam, INT nShow)
	{
	DialogBox(hInst, MAKEINTRESOURCE(IDD_DIALOG), NULL, (DLGPROC)WndProc);
	return 0;
	}

BOOL CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
	{
	switch(uMsg)
		{
		case WM_INITDIALOG:    // This message is send to the window when its been created
		break;							   // You can do any initialization stuff here

		case WM_COMMAND:       // When something happens in the dialogbox, eg. a button is clicked
			switch(wParam)
				{
				case IDC_BUTTON1:  // ID of the control something has happened to. eg. button was clicked
					MessageBox(hWnd, "Button 1 Clicked", "", 0);
				break;

				case IDC_BUTTON2:
					MessageBox(hWnd, "Button 2 Clicked", "", 0);
				break;
				}
		break;

		case WM_CLOSE:         //This message is sent when the application is closing
			EndDialog(hWnd, 0);  //We call this function to close the dialogbox
		break;
		}

	return false;
	}
<< moderator edit: added [code][/code] tags >>
Reply With Quote  
Join Date: Sep 2004
Posts: 32
Reputation: letmec is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 2
letmec's Avatar
letmec letmec is offline Offline
Light Poster

Re: Help Need Urgently - C++ Gui

  #4  
Apr 23rd, 2005
try some programming on mouse handling and keyboard handling and definitly on graphics. Mouse handling is very easy but keyboard is in some way is difficult. First try to make your own controls like command-button, Menus and textbox(Very important and tricky).
Reply With Quote  
Join Date: Dec 2004
Posts: 79
Reputation: eagleeye is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
eagleeye's Avatar
eagleeye eagleeye is offline Offline
Junior Poster in Training

Re: Help Need Urgently - C++ Gui

  #5  
Apr 30th, 2005
Originally Posted by kparnell
i am just learning this, i dont even know how to add a textfield.


Try this site for a tutorial for some "window controls", like "Edit Controls" (textfield)
http://winprog.org/tutorial/controls.html
Hope it's useful, it was for me.
I'll try to be smarter, if you try to be nicer.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C++ Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 8:49 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC