Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

i understand that i can't use a varname outside the functions\class's with '::' operator

Make the variable static and you can use it outside the class with :: opertor.

class MyClass
{
public:
   static int x;
 };

int MyClass::x = 0; // static variables must also be declared like globals

int main()
{
    MyClass::x = 1;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Do you know how to do file I/O? If not then you need to read a tutorial or your textbook about it. To alter or delete a patient from the text file, the text file has to be completly re-written, there is no way to modify or remove strings from a text file. So you will have to read all the patient data into memory, make whatever changes you need in memory, then rewrite the file.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Doesn't it know from the index?

what index?? I think the third parameter to the function is the number of characters in arrayb. not the index in arrayb that needs to be checked. Lets say the user enters the letter 'a', the letter 'a' is then appended to the other letters in arrayb. How's CompareLetter() supposed to know which letter in arrayb the user just entered?

Why not just pass the letter to CompareLetter() instead of the entire array of characters entered? For example:

int CompareLetter(char arraya[], char LetterToCheck)
{
    if( strchr(array1,LetterToCheck) != NULL)
       return 1;
    return -1;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

How does that vBulletin hack affect PFO, if anything?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I see the return statement on line 16, but nowhere else. What happens if the test on line 10 fails -- what will the function return??

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

It's almost a waste of time learning win32 api because it has been supersedded by .NET Framework. Your time would be more well spent by learning Windows Forms using CLR/C++, C# and VB.NET languages, all which use .NET Framework functions. It wouldn't surprise me if win32 api was someday (in the next 10 years) obsolete and no longer supported.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

For detailed explanation of each argument you need to read this article. There are two functions -- CreateWindow() and CreateWindowEx(). If you compare the arguments of the two functions the only difference is the first argument, which are additional window styles not used in the first function.

cambalinho commented: thanks +2
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

what part(s) of the assignment don't you understand? Post your attempt to at least begin the assignment.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Have you tried to google for borderless windows? I found several possible solutions, here's a youtube video (don't know if it's what you want or not)

cambalinho commented: thanks for all +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

AFAIK there isn't such an option. Why would you want a borderless window? Maybe you want something like a spliter window??

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I think I'd rather just die a natural death now then wake up 1000 years from now, or be reincarnated with my current memory. Or be instantly transported to 1000 years from now Les Visiteurs comes to mind :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

the DefWindowProc() is on right place

Maybe, depending on what you want the program to do after the switch(). Probably in most cases it should be like below. But that won't work if there is more code to add after the switch.

LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch(msg)
    {
        case WM_CLOSE:
            DestroyWindow(hwnd);
            break;
        case WM_DESTROY:
            PostQuitMessage(0);
            break;
    }
    return DefWindowProc(hwnd, msg, wParam, lParam);
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

setprecision() is in effect until you call the funcion to change the value for floats and doubles. Assuming rate is either float or double, on line 3 call setprecision(0) to not display any decimals. Then on line 4 you have to call setprecision(2) again.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Oh, now I understand. The arrayb is just a string of letters in any order. In that case you can use a function such as strchr() to see if a letter in arrayb is contained in arraya.

int CompareWord(char arraya[], char arrayb[], int size)
{
    int flag = 1; // assume all letters in arrayb are in arraya
    int i;
    for(i = 0; i < size; i++)
    {
       if( strchr(arraya,arrayb[i]) == NULL)
       {
           flag = -1;
           break;
       }
    }
    // now return the result
    return flag;
}

it can return the position of the correct letter to main so I can fill that letter into wip (words in progress) by replacing one of the astericks with that letter in

Then why are you passing the entire arrayb instead of a single letter? How is the function supposed to know which letter to compare? And if that's what you want it to do then use a different function name that better describes it's purpose.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I have been absent from our programming lessons ... I have googled everything I could about this subject but I have only had this 1 day to get this fixed before handing it in tomorrow.

As George Takei (from Star Trek) would say -- Oh Myyyy! Maybe you should have just dropped the course.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Noah & the flood also never happened.

How do you know? Was you there? Probably a better translation would be that Noah's flood covered the world "as he knew it". It would have to rain for a lot longer than 40 days and 40 nights to actually flood the whold world as we know it today, and then it might have to empty all the oceans.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

CompareWord() returns on the first character. If the first character of each array are the same then CompareWord() returns i, which will always be 1, otherwise it always returns -1.

Is there only one word in each of the two arrays? e.g. not a sentence? If so, then you need to set a flag to indicate the two words are the same so that the function will compare all the characters in the word

int CompareWord(char arraya[], char arrayb[], int size)
{
   int flag = 1; // assume arrraya == arrayb
   int i;
   for(i = 0; i < size; i++)
   {
      if( arraya[i] != arrayb[i])
      {
         flag = 0; // not the same
         break; // exit the loop
       }
    }
    return (flag == 1) ? 1 : -1;
}

Or, an alternative way to do it is to just call strcmp(). Assumes both arrays are null-terminated strings and only contain one word.

  int CompareWord(char arraya[], char arrayb[], int size)
    {
       return (strcmp(arraya,arrayb) == 0) ? 1 : -1;
    }
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Home made beef stew.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The example code is MFC (Microsoft Foundation Class), which is VC++ c++ class. But the explanation about the mousewheel would apply to any compiler that uses win32 api functions.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Moon landing

I watchecd that on TV. Interesting, but not earth shattering.

Go to a harvest celebration by North American First Nations before the arrival of Europeans.

You wouldn't see much because there weren't any.

ride in a Viking longship

They'd probably slaughter you :)

Plus the conditions at the beginning of the universe were pretty unpleasent so you likely would not live to tell anyone about it.

Maybe, and maybe not. Maybe God said "Abracadabra!" and Poof! the universe was instantly created just as we see it today. And, BTW, that was only 10,000 years ago.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Did you read the article I posted? Or did you just dismiss it because it had too many words?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I agree with you on the price, it is expensive but it makes up for it in productivity in a work environment. It sure doesn't worth buying Office to track your monthly expenses or your milage.

I have both, OpenOffice and Microsoft Office 365. I rarely use OpenOffice because M$ Office is so much better. And Office 365 lets you store data either on your local computer or on the cloud so that you can easily access the files from other computers or from mobile devices. It's kind of nice to create a shopping list on my computer then access it with my smart phone while in the store shopping.

And the price of Office 365 is probably about a third of what it was for previous editions because it's now an annual subscription so you get upgrades for free every year or whenever Microsoft issued one. With one license I'm allowed to install it on 5 devices (computers, tables, and/or shart phones running Windows 8).

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I would like to see the beginning of creation -- verify once and forall the existance of God. And verify how the universe was created.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

int year = argv[1];

argv[i] has to be converted to an integer before it can be assigned to int variable. There are several ways to do it, this is probably the simplest, but most error prone. atoi() does not produce an error even if argv[i] does not contain numerical digits.

int year = atoi(argv[1]);

A better solution is to use strtol() because you can detect errors with it. You can also use it to convert digits with different bases, such as hex and octal numbers.

char* endptr = 0;
int year = strtol(argv[i],&endptr,10);
if( *endptr != 0) 
{ // test to see if argv[i] contains only numeric digits
  printf("Error\n");
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

scanf_s("%ch", &answer);

Should be just "%c", not "%ch".

fflush(stdin);

Nonstandard. fflush() is guarenteed to work only with stdout and other output streams. Some compilers support stdin, but that won't work with all compilers. When learning to program it's best to stay with standard C functions and not compiler-implementations.

line 12: you need to increment the value of i so that it will point to the next element of the array. You can do that in the same line as line 12 or on another line before the end of the loop, either is correct
scanf_s("%d", &array[i++]);

line 16: array[n];

That is a do-nothing statement. You might as well delete it.

line 18: What's the value of n at that point? Answer: 0, as initialized on line 3. I think you need to set n = i just before line 18 and after line 17.

lines 18-23: Too much work going on there. Think how you would calculate the average of several numbers with pencil & paper -- you don't calculate the average every time you add a value to the sum so why are you doing that in this loop?

You might as well delete variable count because it's final value is the same as n. Then move line 22 down so that it's outside the loop.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Here is a good tutorial that explains exactly what you are looking for.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Had dinner at LotaWatta Creek this evening. Meatloaf with Gravy, Green Beans, and Mashed Potatoes & Gravy. It's a local restaurant that is always busy.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

One way to speculate what such a pill might do is to read about the life of Dr Who (BBC TV series). The first Doctor said he was just a kid when he left grade school at the age of 50. At another time, when asked what he was a Doctor of, he said he had a Ph.D. in everything.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Women will simply fill in a form saying they are doing so, and it will be signed off by a midwife.

And I was beginning to thins USA was the only nation with stupid laws :) The idea is honorable, but not very practical.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I want to know how the species is doing 1000 years from now

Humans might be extinct by then and you might get eaten by a big bird of some sort.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I wouldn't want such a pill -- think about it, I wouldn't get Social Security for another 900 or so years!

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Here's why macros are evil critters.

cambalinho commented: thanks +2
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

It's nice to see all you people love your mothers so much.

<M/> commented: ROFL +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

How is it less expensive to have no insurance?

The penalty tax is soo low that it's not worth getting the insurance for some people. Here are the rules.

  1. Year one: 1% of income or $95.00
  2. Year two: 2% of income or $325.00
  3. Year three and beyone: 2.5% of income or $695.00

Compare that with a $10,000+ policy.

how are you going to pay for the treatments with no insurance?

I agree with you that paying the penalty instead of buying insurance is a huge risk.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The public is being flooded with lies from Republicans

You mean the lie that people who like their present insurance won't have to change it???

So you first state that they are using SNAP to buy items that are not covered under SNAP

Seems like a conflict, but isn't. Suppose I have a bunch of tickets to get free food then trade them to someone for drugs. Or suppose I have a good friend who is a cashier and gets him to give me unauthorized stuff for those tickets.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Here is a cute video I just found about ACA.

I have to ask, if Obamacare is as bad as the Republicans say it is, why do they have to make up so many lies in order to discredit it? Surely the truth would suffice.

I think everyone is just scared of unknown future. It might just be less expensive not to get any insurance and pay the small penalty tax. The USSC said the penalty is a "tax".

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Why would anyone abuse SNAP

To buy booze, street drugs, and other things that are not covered under SNAP.

How would you being a WalMart cashier beable to tell if the people were abusing it or not

Because there is a list of items that people can get. If it's not on the list, then it can't be bought with SNAP (or WIC).

Even if this imaginary abuse is going o

Nothing "imaginary" about it.

Why is that a bad thing?

It's not a bad thing -- the bad thing is the abuse of the system, not that people can get free food.

And its not like SNAP is can be spend on drugs or jewlery or other unnecessary luxuries.

In theory, yes. In practice, maybe or maybe not.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Can you explain to me how Republicans

Nope, I'm not Republican, although I have voted Republican presidents just as I have voted for Democratic presidents.

defund SNAP

Yes, because it doesn't work due to too many people abusing the system, I've seen it with my own eyes when I was a recent WalMart cashier for 5 years.

keep millions of Americans from receiving affordable, basic health care

What makes you think they already receive health care? Just walk into any emergency room in USA and you will see people who have no health care insurance.

loosen gun laws so that even more people die

No one wants to do that. Republicans are agains gun control, not deregulation. I favor some regulation such as banning assult weapons not because such regulations will magically remove them from the hands of criminals but because it gives law enforcement ammunition to arrest people who have them.

AD - you are obviously opposed to the ACA.

I'm not opposed to the idea of ACA, from what I've heard it is just a bad law. One father said of TV just this morning that it will cost him at least another $500.00 per month. Insurance companies have cancelled the policies of several million Americans, leaving them with no insurance at all. I don't know how anyone can say that is an improvement.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Maybe you have the wrong friends??

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The point of these requirements is to prevent wasting tax dollars

Like the $500.00 hammers? Or like reroofing a bunch of buildings one day and tearing them down the next day?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

This has nothing to do with "artificial intelligence" -- just a simple homework assignment. You posted the assignment, now what is your question(s). We are not going to do your homework for you.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

why is products a float instead of an integer. How can you have anything but an integer for the number of products??? You can't have something like 2.5 products. And what data type is 'p' declared to be?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You need to put a loop around the entire program, such as from line 20 to about line 373 (just before the return statement).

It's hard to believe you are not allowed to use functions! No programmer in his/her right mind would write that big of program without using functions to make it more readable.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Here is an article about elipses. There must be at least one parameter before the elipses. For example:
void foo(int x, ...);

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

First thing you need to do is write out everything the program has to do -- schetch out the screens, menus, and describe the functions that it must have and what they are to do. Only after you have finished that can you begin coding it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You should use SetWindowLongPtr() so that it will be compatible with both 32 and 64 bit version of MS-Windows.

cambalinho commented: thanks +2
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

AFAIK there is none. Here is the list of valid styles. There are many other styles but they are specific to window type such as buttons, dialog boxes, check boxes, etc.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Read this Amazon.com article. I don't know if the kindle can read that file format, but the article explains how to transfer them.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

This article might be of interest to you. Codeproject.com has one of the largest repositories of free Windows code that you will find on the internet. You will find examples of almost anything you want to do there.