|
Google is your friend [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
CPallini wrote: Google is your friend
Im not sure!
|
|
|
|
|
You're probably right. Anyway, perhaps Google will be his new friend.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
CPallini wrote: You're probably right. Anyway, perhaps Google will be his new friend.
|
|
|
|
|
Hi, I have below a question on programming in C++ which seems complicated to me.Please help asap.
A shop wishes to have a computerised system for its cashier. The program should help the
cashier to calculate the total payment required to be performed by each customer. It also should
be able to keep record of the number of customers for a day, calculate the total income of the
shop for the day as well as the average amount spent by a customer. You can assume that for
each customer coming to the counter, the cashier can find out how many different items he/she
has purchased before inputting the details of the purchase. However, the cashier does not
know, in the morning, the number of customers that are likely to visit the shop for the day.
Write a program that can perform the required work for the cashier. Your program should have
the following features:
• It allows the input of a number n, representing the number of items to be purchased by the
customer.
• It then allows the input of n pairs of values representing the quantity and price per unit for
each of the n items. For each item, the computer needs to display the total resulting amount.
• It Calculates and displays the total payment to be performed by the customer.
After having displayed the required values for a customer the program should ask the user
whether to input for a new customer. If the answer is yes, the program should repeat the
above steps. Otherwise, it should display the following values
• The number of customers.
• The total amount paid by all customers
• The average amount spent by a customer.
Your program should perform the following validations:
• Quantity of an items should be in the range 1..10.
• Price of an item should be greater than 0 and not more than 100.00.
For input, the computer should give the user the item number and the user should enter the
values of quantity and price. The computer should immediately display the total amount to be
paid for that item. A typical user screen, for one customer, should look as
below:
Item Quantity Price Per Unit Total Cost
1 2 20.00 40.00
2 3 25.50 76.50
3 1 30.00 30.00
Total 146.50
You may use an array to store the data pertaining to the different customers.
|
|
|
|
|
Please make yourself your homework.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I'm certain BOOST already have a template for that.
boost::homework< cash_system >
|
|
|
|
|
Are you sure you can get answer to this question?
|
|
|
|
|
I can't see a question. Anyway, be a good boy and do your own homework.
"It is better to remain silent and be thought a fool, than to open your mouth and remove all doubt."
--Groucho Marx
|
|
|
|
|
Use excel...
Or even better... use the CListCtrl...
Or even better... do your homework...
|
|
|
|
|
U come early in the morning 5 'o' clock
|
|
|
|
|
Ye-ah, sure. - you wanna give me your student ID and the place of submission, so I can save you from doing any work at all. You poor, poor creature.
How far have you made it on your own? Did you get as far as Start->AllPrograms->InsertGroupNameOfCompilerOfChoice->ShortcutToIDEofChosenCompiler?
Just break down the problem into bite sized chunks and solve them one by one.
Please reply urgently asap with your progress. I'd just love hate to be unable to help somebody facing such a dilemma.
Go on - 1 rate me too, I dares ya!
|
|
|
|
|
Ask this guy.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello,
I want to change the background colour of CStatic box.
The CStatic Box is on a CMDIChildWnd and not on a dialog.
I tried by calling GetDC() of CStatic and then call SetBkColour().But it seems the DC handle is not got properly with GetDC().
But CStatic->SetFont() works properly.
If I want to change the background colour Why the windows static styles don't work while creating the CStatic windows (i.e SS_BLACKRECT, SS_WHITERECT etc)
Regards
Pritha
|
|
|
|
|
You might want to check out the WM_CTLCOLORSTATIC message.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Maybe see here[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello,
Still the background colour has not changed .I really don't understand how can an easy task of changing colours can be so difficult.Please take a look at my class and suggest me the possible errors. Sorry for the trouble.
My class is like this.
Class TableFrame : public CMDIChildWnd
{
Public :
Void PrintHeading();
Private :
Vector<CStatic*> Heading;
Protected :
afx_msg LRESULT ONCTLCOLORSTATIC(WPARAM wParam,LPARAM lParam);
};
BEGIN_MESSAGE_MAP(TableFrame, CMDIChildWnd)
//{{AFX_MSG_MAP(TableFrame)
ON_MESSAGE(WM_CTLCOLORSTATIC, ONCTLCOLORSTATIC)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
Void TableFrame ::PrintHeading()
{
int x=0;
CFont* m_pFont;
LOGFONT LogFont;
memset(&LogFont, 0x00, sizeof(LogFont));
strcpy(LogFont.lfFaceName, _T("MS Sans Serif"));
LogFont.lfHeight = 12;
m_pFont = new CFont;
m_pFont->CreateFontIndirect(&LogFont);
SetFont(m_pFont);
for(int i=0;i<m_TableDoc.GetmDataFields().size();++i)
{
CStatic* Static = new CStatic;
CString String = ColumnHead[i];
x = i*(COLUMNSPACE + 100);
CRect Rect(x,0,x+100,20);
Static->Create(String, WS_VISIBLE, Rect, this,i);
Heading.push_back(Static);
}
}
LRESULT TableFrame::ONCTLCOLORSTATIC(WPARAM wParam, LPARAM lParam)
{
HDC hDC = (HDC)wParam;
::SetTextColor(hDC, RGB(0x00,0x00,0xFF)); // text color bright blue
::SetBkColor(hDC, RGB(0xFF,0x00,0x00)); // text background color
return (LPARAM)(HBRUSH)hbr; // control background
}
Regards
Thanks
Pritha
|
|
|
|
|
prithaa wrote: ::SetBkColor(hDC, RGB(0xFF,0x00,0x00)); // text background color
return (LPARAM)(HBRUSH)hbr; // control background
}
Is hbr brush is properly initialised and lifetime of the object is valid?
if you want the background of CStatic and Text Background same then set the text background to transparent mode
::SetBkMode(hDC, TRANSPARENT); // SetBkColor(hDC, ...
|
|
|
|
|
Does your ONCTLCOLORSTATIC() get called?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello,
Thanks for your replies.
The ONCTLCOLORSTATIC()was not called when I debugged.
How do I call it?
Regards,
Pritha
|
|
|
|
|
prithaa wrote: How do I call it?
You don't. It gets called by the framework.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
for eg if i give 3 it has to generate binary states in sorting order in terms of no of 1's
|
|
|
|
|
If I understand your question correctly, see here.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Nice link, thanks
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
I got the following inline assembly code.
__asm {
MOV ECX, 0E2h
RDMSR
AND AX, 0BFF7h
WRMSR
} I have to port this to x64 code which does not allow inline assembly. What intrinsic functions should I use? Thanks!
Maxwell Chen
|
|
|
|