WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Hello Again

in the line 28 ERROR (Expected Array)

why???

Probably because on line 28 you used a command that requires an array and you didn't use one.

Since
1) You didn't use CODE Tags
2) You didn't bother to tell us what line 28 is
we can't very well tell what you did wrong. You'll have to post useful information for our understanding.

hkdani commented: Shows understanding in the basic concepts of Visual Basic programming. And based on experience quickly points out valuable insights. +6
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I'm just waiting to hear the Democridiots. They're a hoot!

As for charging the rich 5% more -- why? Make the tax laws sensible.
Line 1: What did you make?
Line 2: Deductions - few and sensible, not hundreds of pages worth.
Line 3: What's left?
Line 4: Multiply by 20%
Line 5: Send it in.

Everybody does the same form, from $10,000 to $10,000,000,000 income.

Why penalize the rich just because they are worked harder (smarter) than the non-rich?

hkdani commented: Not only is WaltP smart. He has common sense. +0
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

[boilerplate_help_info]

Posing requests for help must be well thought out if you want help quickly and correctly.  Your post did not meet the criteria for quality help. You may get some posts, but are they going to be useful?  Check your post with these checkpoints - what is it [i]you[/i] missed:
[list=1]
[*]Ask a question that can be answered. Do not ask
- What's wrong with my code?
- Why doesn't this work?
- Anything else that does not give us useful information
[*]Post your code.  If we don't know what you did, how can we possibly help?
- Use [b]PROPER FORMATTING[/b] -- see this
- Use CODE Tags so your formatting is preserved.
If we can't follow your code, it's difficult to help. We don't care that you're still working on it. If you want us to read it it must be readable
[*]Explain what the code is supposed to do.  If we don't know where the target is, how can we help you hit it?
[*]Explain what actually happened! If we don't know where the arrow went when you shot it, how can we tell what went wrong and how far from the target you are?
[*]To [b]not[/b] ask for code. We are not a coding service. We will help you fix your code. 
    If anyone posts working code for you, they are a cheater. 
    If you use that code [i]you[/i] are a cheater.
[*]Do [b]not[/b] bore us with how new you are. We can tell by …
NathanOliver commented: Nice +10
alwaysLearning0 commented: well said. +5
Narue commented: I'm gonna steal this for the Read This First thread. ;) +17
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Agreed. And what's a wid? Is it some sort of elf or gnome? We speak English here.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Output the numbers to the printer
Cut the numbers from the paper
Sort them on the table
Tape them together when sorted.
:icon_twisted:

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

>>But instead of showing A, 2, ..., J, Q, K, it shows 1 to 13.
How can I convert 1, 11, 12, 13 back to A, J, Q, K?

You'll have to use conditionals (i.e. an "if" statement) and alter the output based on the value.

I would use an array instead.
Now it's showing 1 to 13. Set up an array string cardVal[] = "A", "1", "2",... "10", "J", "Q", "K"}; and use the value that is currently being displayed as an index into the above array and print the string instead.

Fbody commented: Not a bad idea. :) +13
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

How is it impossible if the compiler has it. It is obvious that it can be written in Assembly. Well in that case I am in the wrong forum. Thanks!

If other forums explain how this can be done, please come back and explain it to us and we will apologize profusely. We will also learn something even we don't know.

NathanOliver commented: I guesss he does'nt get it. +9
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

What part of non-portable is difficult to understand?

I don't understand what your talking about.
I need something like _getch(); using just the standard libraries(or less). And no Operating System specific libraries/headers.

Clear and succinctly:

There is nothing, repeat nothing like getch() that is
1) portable
2) not O/S specific
3) not compiler specific
4) standard
in C++ NOTHING. Period.

sergent commented: . +6
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Now, how to figure 3.75 degrees.

Easy. Draw a circle. Take away everything that isn't 3.75 degrees.

Nick Evan commented: indeed +0
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I'm writing a reverse Polish calculator. If the input is 1 2 - 4 5 + *, the output should be 9, but I'm getting -9.

[u]1 2 -[/u]  [u]4 5 +[/u]  [u]*[/u]
   1-2    4+5
   [u]-1      9    *[/u]
        -1 * 9
          -9

Looks right to me.

minimi commented: Thanks! +2
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I have tried doing a while loop, but it does not seem to work...

Why? Since we can't see your computer, you have to tell us what you see. Are your braces in the wrong place?

Try formatting your code better. You are getting confused because you can't see your blocks correctly.

Shouldn't you display each roll? That's what happens at the casino -- you get to see each throw of the dice, not just the winning/losing roll.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
if (sumd==4 || sumd==5 || sumd==6 || sumd==8 || sumd==9 || sumd==10) {
            d1 = rand()%6+1;
            d2 = rand()%6+1;
            sumd = d1 + d2;
            if (sumd==7) {
                printf("You rolled a 7, you lose.\n");
                lostp++;
            }
            if (sumd==4 || sumd==5 || sumd==6 || sumd==8 || sumd==9 || sumd==10) {
                printf("You rolled your points, you win.\n");
                winp++;
            }
        }
    }
}

The logic above is wrong. If you first rolled a 5 (sumd = 5), you get into this section. Then 3 possibilities exist:
1) You now roll a new value (sumd = 7) and loose, which you count.
2) You now roll a new value (sumd = 8) and your next big IF is true. But you did not roll your point. You rolled an 8. 8 != 5.
3) You now roll a new value (sumd = 12) and neither IF is true. So you did not even count this turn.
So if on your first roll you roll a point, you make 1 more roll and you're done.

Look at the instructions again. What are you supposed to do when you roll a point?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Let's put this in perspective. I will rewrite your question and see if you think your request is appropriate.

Hello, I am new to being a doctor (3rd year student) and I would like to perform my first surgery something similar to open heart surgery obstacle is how to find a patient willing to let me do the surgery, I know how to hold a scalpel and I know where the heart is, but how do I get through the rib cage to get at the heart??

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

What open source software for PDAs/smart phones (like Blackberry )is best for student attendance monitoring/tracking? Any specific/brand of software? Or any possible specific hardware for that software?

If there was a best there wouldn't be choices...

peter_budo commented: Bullseye, but that doesn't mean you are the best ;) +0
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

As long as I have C++ installed on my workstation, it will not die ..

Ahh, then BASIC is safe, too. I have it installed on my computer...

Sky Diploma commented: Hehe :) Me too ! +0
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I guess you may also need a lamp and cant see a toileteries for grooming oneself after using the toilet

We're programmers. We work from the light from the screen. And since we got no girls (being nerds), we don't need no groomin' neither.

ProgrammingGeek commented: Haha +0
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Ahh, OK.

By the way, see this and this

sergent commented: Time for me to start learning Cobol +0
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Yeah! I was going to mention the fact that COBOL is the worst language in the world and yet most internal software depends on it. It is one of those old, spaghetti-code languages that has about a billion person hours invested and limps along because -er- no one knows how it does what it does using computed goto statements for gawds sake.

Sigh

It's very obvious you have never studied COBOL with this asinine synopsis of the language. For what you want to do, it may be a bad language. But that is far from the truth. The reason it's still around is because it is a very good language for what it does and the arena it's used in. Believe me, if it was bad for the reasons you stated, it would have been replaced long ago. The fact that it's hasn't been shows it's usefulness.

Even the (IMO) gawd-awful RPG language, it does what it's supposed to. Effectively.

MooGeek commented: Soo true +0
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Then hide the quick-reply on threads that are older than N days.

And from the standpoint of "significant number", as far as mods are concerned, yes.
And from the standpoint of "other forums", who cares. We are not "other forums". We are allowed to be better than them.

I worked with a warehouse storage system which guaranteed no more than 1% misstored (lost) merchandise. Sounds insignificant. When you calculated that 1% it came out to hundreds of pallets of merchandise. No longer insignificant.

mitrmkar commented: Very good point on"other forums". +0
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I'm addicted to Mountain dew but I stopped drinking coz I was afraid I'll get a diabetes :(

Watch out for the withdrawal symptoms -- an uncontrollable urge to pick up a banjo and play Foggy Mountain Breakdown by the cee-ment pond.

ProgrammingGeek commented: Haha! +0
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

extern the variables in question. Look it up...

valestrom commented: Made me look, but still very helpful +1
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

sizeof() returns a binary value. Decimal and Hexadecimal are simply display values of those binary values to the user. If you see hex values it's because your cout has been told to display the value as hex.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

C++ will not and should not die because I just started learning it...

That's the most compelling reason why C++ cannot die. Jingda just started using it!

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Do NOT use the registry. As a new programmer you may destroy your system.

As debasisdas said, "The simplest thing to do is to check system date on start up." Which means you need to look up the Date functions in VB. There are at least 2 that will help you.

faroukmuhammad commented: I did't see that coming +4
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

No it's not good. Doing his homework for him is NOT good. It's called cheating, something we try to avoid on these forums.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I found it. It was something I did....

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Hi, everyone!
I'm kind of in a hurry. I need to know for tomorrow how can I open a file and get the file name.

This was posted on March 6th, 2008!!!!!

Stop resurrecting this zombie for no reason! Better yet, go ahead and try! Mwahahaaaaa!!! :icon_twisted:

Card commented: Thankyou +0
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Or to ask a more appropriate question, "Do you have any links to reputable sites that review hosting companies?"

.kaine commented: Good Reply. +0
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

The reason you continuously loop when you enter bad input is because you're trying to accept a number, but are receiving a char, and your input buffer is overflowing.

It's not because of an input buffer overflow. When you try to read a non-digit into an integer, the read fails. The input buffer remains the same. Next time you try to read, since that character is still there, the input fails again. And again. And ... you get the idea.

1) Test your read to see if it was successful. Don't ask How? Look it up. It's part of cin error checking.
2) If it fails, clear the input buffer as Duki's link suggests. Be sure to process the error in your code. Don't just go on your merry way and execute the code as if nothing happened.

Also, I would recommend using a switch rather than multiple IFs.

So would I, but only if you've learned them.

Duki commented: Thanks for the correction. :) +10
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

OK What gives?
1st post - a sh*tload of errors with no context
2nd post - code with no commentary, no questions, two days later
3rd post - worthless bump for no apparent reason
4th post - another worthless bump for no apparent reason

This thread is about to be closed...

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Hello..
I searched the forum for a thread that explains how to rename your username, but I couldn't find any.. How can I assign a new name to my membership here?
Thank you.

And you didn't find one thread titled something like "Please change my username?" You certainly didn't look hard.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

what is the code in timer if the user enter a negative number
a dialog box will appear saying that is invalid !!

You wouldn't put a dialog box in a timer.

NEED THE ANSWER ASAP
THANK YOU

We don't feel your emergency is our emergency. We will answer when we can.
AND DON'T SHOUT AT US!!!

faroukmuhammad commented: It seems like you've understood his question. Pls PM me with explanation. Thanks in advance. +4
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

My apologies but that's the way I felt on his reaction :)

Sorry....

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Well I thought making this rule would encourage other users to post more and be more active on DW. Does it make sense now?

No. How would it encourage more activity? If I want to have my user name changed one of two things will happen:
1) If I have to make 48 more posts, I will go elsewhere and forget DaniWeb.
2) If I have to make 48 more posts, I will post 48 lame-assed posts anywhere I can just to get my 50.

Alternatively, I all I have to do is ask, I would think "Gee, this is a nice place, they are helpful. I'll stay around and become part of this community."

jonsca commented: Only 47 more to go! Just kidding, WaltP, but that was too easy. +0
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Actually, please ask a question - one that can be answered, preferably.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

One step at a time. Start with the menu.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

is the better?[/url]

Much!!!! :)

well i was taught to use flushall(); when i have problem with gets() so i tried here[/url]

You were taught wrong.
1) See this about gets() .
2) See this about fflush() , which is a subset of fflushall() . Neither are guaranteed to work on input streams. Only output streams.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
//enter the given rang from keyboard
//u will get prime no from given range
//safwan hashmi
//email was here
//13-11-20103
//prime_rng.cpp
...

Very bad code:
1) terrible formatting - inconsistent
2) using code that at least 15 years old
3) using headers that ate at least 10 years old and have been replaced
4) using functions that no compiler uses to this day
5) Massaging your ego and giving out code that allows the OP to cheat

Good Job!

And thank you for posting your email address so web-bots can harvest it and add you to thousands of SPAM lists.

Ketsuekiame commented: Point well made +8
HASHMI007 commented: stupid +0
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

You need to look up the file and directory routines of your compiler and/or operating system that's the starting points for this program then write some test programs to test what you are learning make them small and simple notice what happens when you don't bother writing in sentences just cramming all your sentences together makes it hard to understand you

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

No, I'm talking about the Do provide evidence of having done some work yourself if posting questions from schoolwork assignments section.

You must be under the mistaken impression we are a homework service. We are not. You do the work, we help solve problems - in a teaching manner, not a rewrite it for me manner.

>>Thing is, i need it for tomorrow evening
As the saying goes, "Poor Planning On Your Part Does Not Constitute An Emergency On Our Part".

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

But you have already called it in the if loop! What's the problem?

What's the problem?
1) Formatting is non-existent.
2) main() is wrong.
3) fflush(stdin) is undefined.
4) Using scanf to read a character -- see the entire scanf series for maximum info.

That's what I see.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Tell you what. You comment each line whith what you think it means and we'll help you correct it.

And use CODE tags!!!

Salem commented: well said +17
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Please help on easy C++ recursion.. PLEEASE!

Don't beg. It makes you sound desperate and needy, and people will avoid your post.

Try printing out some values in the function to see what is happening as it runs.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I don't see any down-reps for you in the past month. All + rep back to June 10, where you must have been doing something people didn't like.

On the other hand you have been giving bad rep to a bunch of members in a Geek's Lounge thread.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

You are so close, you have it solved, but your problem is that you need one last line of code for your GCD function:

GCD = X
End Function

Thanks for helping. I'm sure the OP has been waiting for the past 6 years for you add that piece of info so he can finish his project. :icon_rolleyes:

debasisdas commented: :) +13
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

what is the matter with this code?

For one, it's a bad title for a thread.
For two, no CODE Tags.
For three, bad formatting.
Four, old code practices from the 1980's.

First things first.
1) Read the Member Rules. Make an effective title for your thread.
2) Code Tags are described all over the site. Find them. Read them.
3 & 4) See this, this, this, and this.

The first error is a "declaration syntax error"

Given 53 lines, does this error as it is make sense?

The second says"declaration is not allowed here".

Where's here? If you were given this information -- and only this information -- what could you do with it?

Salem commented: 4 excellent points +17
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
Sodabread commented: I like your answer better. +7
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I wrote two programs, but I'm in dire need of the third and be honest with you I could not at all to write the third program

1) Learn to format your code so it can be read and followed easily
2) See this
3) We won't write it for you. Most of us don't need the grade.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

SO what do you want included in the loop? Point to the line that needs to be inside to loop that isn't already.
Finish your do-while loop.

In fact, start over. Get the program running in small pieces, stop trying to write the whole thing and clean up the problems later.
1) Start by writing the loop. Input the Y/N and continue or not based on the input.
2) Next, add the menu. Make sure it still loops properly.
3) Add the switch statement. Test it again....

Programming this way is faster and you understand each piece much better.

aiwasen commented: Thanks,i'll try +1
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Of course. Delete the node you are pointing to.

The question doesn't say you need to clean up the next-pointer in the previous node, which you can't do, but too bad. Stupid requirements cause problems.