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

If you read the prevous post you see that what I posted using

while ((ch[0] std::cin.get) != '\n')
                {
                          if (isdigit(ch[0]))
                                      ....etc
                }

True, but the code in it's entirety is too complicated and hard to follow by creating essanitally a 1-character string and the use of strtol() instead of a simple subtraction.

IOW, it's not a good example. Sorry, it's confusing.

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

"filled with errors" ??

step off my grill, dog. the code snippet -- as it is written -- *works* and it is entirely suitable for someone wanting code handed to them.

now tell me, do you always engage in such tendentious pedantry on trivial matters, or do you reserve this unappealing behavior only for the new people?

:roll:

No, I engage in supercilious bravura with any personage that imparts tenebrous erudition.

If someone attempts to correct you, don't get defensive. Think about what they said. They may have more experience than you and might be able to teach you something. :icon_wink:

After 30 years as a professional in computers, I still learn stuff here.


And as Aia said,

... don't take anything personal.
We love battles of egos over here. Make us proud. ;)

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

well I am new here ....

So? Isn't it obvious even to someone new you don't want to answer a question with invalid advice? :icon_wink:

but I didn't think the purpose of this site is to supply completely error-free and 100% syntactically-correct source code for people to cut-and-paste. thats what homework services do. im just giving ideas and a framework of code fragments on how to solve the problem.

anyhow, there's got to be some amount of effort and initiative to solve problems here. amirite?

You are absolutely correct. But if the small snippets of code you post are filled with errors in syntax and/or logic, how have you really helped someone? They get confused, then post "I don't understand why your advice didn't work!", then you have to apologize and correct your post. They've lost a day because of an invalid code snippet. That's what I'm saying. So try to verify before you post, that's all.

And of course errors slip in. But fewer will by testing/proofreading. :icon_wink:

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

yes quite, Walt.

any industry C programmer will tell you to never use scanf, even for numbers, because if anyone puts a character in there, or any other invalid non-numeric...

I am an industry programmer, and I never said scanf() should be used. Notice I said "I will agree it's a crap shoot using scanf() "? I agreed with you.

What I was commenting on was

the program *crashes*

.
Crash does not mean the program keeps running but loops forever. Crash is a term used in the industry to explain why a program exits prematurely, usually with a dump, or a system message telling you to send Microsoft the information.

as in, grinds to a screeching halt in the singlemost castastrophic event possible, and it's just begging to happen with a scanf()

Rarely does scanf() cause this problem you describe. It is known to loop forever when invalid numbers are entered. When invalid strings are entered it can cause a crash (rarely "catastrophic" thanks to memory protection) or simply overwrite values causing an invalid execution, and possibly a crash in response.

now, if they want to use it in class, thats fine. but if the lesson is specifically about validating input then I dont know how anyone can reasonably begin to think that scanf() is a possible solution for a validation excercise.

I'm saying that scanf() is exactly what shouldn't be used in such an excercise, and i would expect that students will fail the test if …

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

Yes, computers are stupid, as MidiMagic proves. He's completely right, but the computers don't know that, so they turn the fan on when they shouldn't. We need to teach the computers that they should not generate additional heat when they are actually working rather than sitting idle. They need to follow MidiMagic's rules. He's obviously studied the phenomena.

I'll call Intel later today.

~s.o.s~ commented: Heh... +20
scru commented: :P +3
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Try an IF statement.

If that doesn't help, you'll have to post your code so we can actually see what you're trying to do.

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

Please ignore all those bozos above.

The reason your loop becomes infinite is the '.' is not valid for an integer, therefore
1) cin reads the number up to the '.' and stops. The '.' is left in the input buffer
2) the next cin tries to read the '.' and can't so it returns an error which you never check, and leaves the '.' in the buffer
3) the next cin tries to read the '.' and can't so it returns an error which you never check, and leaves the '.' in the buffer
4) the next cin tries to read the '.' and can't so it returns an error which you never check, and leaves the '.' in the buffer
etc.

This would also happen if you entered 23T65.

The easies way to handle this is to stop using cin and use getline() to read the entire line as a string. Then you can pull off (convert to number) the integer part and actually throw out the rest of the line.

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

When you have all the input, just check if one of them is smaller then 0 and print a error message:

Or better yet, wrap each input in a while loop that tests for <0:

inp = -1;    // force the value to be < 0
while (inp < 0)
{
    cout << "Input Value: ";
    cin  << inp;
    if (inp < 0)    // test the new value
    {
        cout << "try again" << endl;
    }
}

...and if I don't text wrap right let me know and show me how to do it right

Thanks for asking :) See this

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

I guess you meant stdio.h .

oops, yeah. thanks

and i also meant to put the last "printf" statement *AFTER* the close of the while() block.

:P

This is why we recommend you test code you post. It generally doesn't help the poster if you give bad advice --- they rarely know it's bad.

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

Not quite, jephthah. scanf() generally will crash when inputting characters into a %s format and the user types more characters than the variable can hold. In most other cases (numbers) scanf() simply stops at the first invalid character for the format. This will cause problems on the next read if more numbers are needed. But by checking the return code you can at least tell if the input failed or not.

I will agree it's a crap shoot using scanf() (see this series) and it should be avoided. And it should never be used to input strings.

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

Get rid of this feature!

There are times when ISPs go down. To blacklist someone because an ISP is down is RIDICULOUS!

I can't change my email address without losing a lot of money.

How can you lose money by changing your email address to DaniWeb? Just get a yahoo email and change your DaniWeb email to it. Won't cost you a cent.

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

Unfortunately, your code is very hard to follow. Indentation is necessary for readability, but you went to the extreme and lost readability. See this for formatting help.

Also, you are using a very dangerous command -- gets() -- click to see why.
And a few questionable commands:
system("pause");
scanf("%c", ...);

It also help to give details, as specified in the post Read Me: Read This Before Posting

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

Read this and this, please. They will help you in the long run.

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

In AccessCircle you never tested for errors on the open nor read. They are probably failing because you have the file open for writing. You also don't close the file after reading.

All IO needs and OPEN and CLOSE. And always test to make sure the OPEN, CLOSE, READ and WRITE worked.

You should not keep the file open for write all the time. Just open it when you need to write then close it. Be sure to open it for append (ios::app I believe)

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

Hmm
One book and all are theoretical? :icon_rolleyes: I guess you're out of luck.

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

i'm looking for tutorial to get started in VC++,i dont want book cause i most of the books are therautical and without code or actual implementation.

Where do you get this idea? Go to a bookstore and start looking at books. Most have code.

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

And array cannot contain 2 empty dimensions in a function. You must fill in at least the left dimension.

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

Besides, it's just reputation! WaltP, you need to stop getting so emotional about petty matters.

I'm not getting emotional. You and your friends are bullying a member. And you posted crap in this thread, I'm simply responding.

I don't know if you just can't read or what. I said to post professionally around the professional forums on daniweb. The Coffee house is not professional. People are free to do as they wish in there. However, when I do venture out into other parts of daniweb, all of my posts have been professional.

Next time learn to read. Thanks.

Excuse me? Since when is the Coffee House not professional? The Geek's Lounge is the non-professional forum. Here in feedback we conduct ourselves professionally. It's how we get information to Dani. It's not for your trying to justify petty vendettas.

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

Well then, either post more professionally.. or keep to yourself in the geek's lounge.

Is this a case of the pot calling the kettle black? You seem to be acting quite below the professional level yourself, bucko. Don't give advice you aren't going to follow yourself.

The way you're reacting to it right now seems to indicate that you're more of a "baby" than the members who are giving you the negative rep.

Do some research before airing an incorrect analysis.

In any case, what you don't seem to realize is that firstly, rep is not meant to be taken seriously. It's designed to encourage members to help other people; it's not necessarily an accurate gauge of how helpful someone has been in the community.

And new members don't know this. I would have the same concern.

The second thing that you need to realize is that rep is very subjective. People give negative reputation when they deem a post "bad";

Again, research it. See my post above and tell me if bad rep was subjectively given.

Nick Evan commented: agreed on all points +3
joshSCH commented: You are a fool, and I disagree. -2
WolfPack commented: agreed. +7
John A commented: You are once again correct. I'm sorry, I should have researched this more. +13
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Perhaps there is a reason that people are giving you bad rep? Have you ever thought of that? I mean, if people were giving you bad rep on the other site.. and people are now giving you bad rep here... it's only logical to assume that you are doing something wrong.

Yes he has. He feels they are playing childish games. And with the rep comments I've seen, he's right.

First of all, I guarantee that Dani will not disable the rep system just because you are complaining. Secondly, the rep system is not meant to be taken this seriously..

You are in no place to guarantee anything Dani might do. And the rep system is not meant to be abused, either.

And finally, all the bad rep you got was deserved.

Really? Does "Try praying, god might have pity on you and make the neg reps disappear." and "What's this? Ohh.. Ohh.. into negative rep you go!" for

Welcome to the site :)

is deserved? And since the second quote is yours, I want to know why that message deserved the rep you gave it? What a hypocrite you are!

And for another post letting members know of something they might find useful:
"Keeping up the pattern of red, sorry"
"dude... what's wrong with this dude?"
"Uhh.. there is free software out there that will encode DivX"
"Because I don't feel nice."

Childish bullys are picking on him, and I have lost …

Ancient Dragon commented: I agree with you Walt. +23
Sulley's Boo commented: I agree with him too! :o +4
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
The navigation menu has always been 887 pixels wide for as long as I can remember, which is accomidating to people at 1024x768 resolution.


OK, so mark this as a new request. But I honestly don't remember having to scroll to get toCoffee house before this change.

The site was also designed to have the sidebar on the right so that people at 800x600 resolution can read a page's contents without having to constantly scroll horizontally.
Since I don't use my browser full screen, the window is about 800 or so wide. "Coffee House" is beyond the 800 limit.

According to our analytics software, only 3% of our users have a resolution that is less than 1024x768. It wouldn't make sense to significantly condense the navigation menu, making it more cluttered and less effective, to cater to that 3% just so they won't have to horizontally scroll a little bit just when they wish to use the navigation menu. Especially because it's been proven that not everyone even uses the nav menu at all.

Does DANI-x.gif

really look that cluttered? Does it look "significantly condensed" and bad? I don't feel it's significantly different visually from

DANI.gif

It's readable. It looks almost identical. The only real difference that can be seen is when compared together. Keep in mind this is a compression of the original GIFs, so some detail is lost.

All I'm asking is that it be …

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

You need to be more careful and detailed when writing your posts, and you need to preview your posts before you submit them. I put "code=C++" in quotes because when I put them in brackets, the web page didn't recognize that I wanted to display the actual words. I see you just posted with the C++ code tags so that's good, but you need to indent so people can follow the logic. That's the whole point of the code tags. The code tags are pointless when the spacing is so strange.

In other words
Read the Rules -- as you were asked when you registered.
Read This because it's title says you should
and Read This to understand proper formatting.

Yes, there's some reading involved, but you want us to be able to help you -- right? The more we can understand, the better the help.

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

I for one can't follow your code because of the awful indentation. Here's some information on how to format your code so it's understandable.

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

hi guys. its me again.
after going thru my prblm i was able to get thru a few of the kinks. however, i still am
having issues with the mathematical statements.

And you still haven't bothered to read the Forum Rules yet because
1) you have a terrible title
2) you keep using web-speak
3) you can't get CODE tags right

The Rules are there so we can help you better and to allow more people to understand what you are talking about. Mny pp dn spk wb, so spk English.

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

Only output the record if client.GetAccountNumber() is the account number entered. Similar to your output while loop.

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

And why are you using goto ? That's usually a no-no for C programmers. A perfectly good alternative would be to create a while() loop that continues until a bool variable is false. When the user enters '5', your program will run case 5 in your switch() statement. This is where you set the bool variable to false , and your program will now end.

Exactly. An alternative to setting a specific bool varialbe, the while can simply test selection with 5. Either way works fine.

And I don't want to correct your code tags a third time. How to use them is in the links I posted before AND on the background of the box you've entered both your posts.

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

Wow.. really? Does it really matter that much? It's a damn menu bar!

When I want to see all the choices without scrolling, then it damn well does matter! Go soak your head! :)

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

I'm trying to make a program that asks the user what he/she wants to do, but when invalid inputs are entered, the program does not tell the user right away.

Meaning what? Like you enter 6 for selection and have to enter your two numbers before you are told 6 is wrong? If so, test the selection before asking for the two numbers.

Also, the sentinel value does not work.

What sentinel?

Have you read the recommended reading, like the Rules (mentioned when you signed up) and the post titled Read Me: Read This Before Posting. It's titled that for a reason.

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

WaltP, why the vitrol? I've already make my opinion known that I think Narue's was fine to begin with...

Vitriol? How so? I disagree, and backed up Narue's position. If you want the value 7 to be bit flipped and get 7, that's fine. I (and I'm fairly sure the OP) would want E0000000h.

Whenever you (or anyone) find yourself spouting off about the one true way of looking at things you almost always make yourself automatically wrong. The closest thing the OP said about his operational domain was to refer to MSB and LSB... So where, exactly, is MSB? It makes a significant difference!

If you think so. But I still hold that there was only one way to interpret "I Need To Flip The Bits In An Integer". Feel free to think differently. As the OP hasn't responded, your opinion is certainly valid.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
> And I still feel the images should be made a little shorter. I don't understand what you mean.
... Also, the second bar seems longer than before, requiring more horizontal scrolling. Can the bar images be horizontally compressed by about 1/5th?

So rather than

how about


It makes the bar shorter so it fits better in smaller windows,

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

I guess i was in a hurry while writing this post, so i did mess up. Heading should have been Calculater in C++. Anyways, the code that i posted is not working and I can't seem to figure out whats going wrong. the same approach was used in the book, thats what i actually meant. I just twisted it a little to suit my needs.
I hope this clears things up. :)

No, not at all. "code that i posted is not working" tells us nothing at all. What is not working? Why do you think it's not working -- what are the clues? What is supposed to happen?

The main problem is inputting the expression...I need help on how to input the expression without the need to press enter after each operand or operator...Any help would be gr8!

Better. Lerner is correct. Input using getline() . If you can't use stringstream, look at each individual character and process it as you need (digits will become operands, nondigits should be operators)

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

Yeah, so? My crystal ball cannot reach into your computer to see your current code.

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

Avoid using Miracle C. The Miracle would be if it works correctly at all. There are plenty good free compilers to choose. Look in the starting C post at the beginning of the forum.

I went to their website for the first time today. It claims MC is still under development, but nowhere is there a list of changes, nor a date. The site could be 15 years old...

The compiler is also shareware and cost $19 to register.

I agree with Aia, though. Historically, it's been terrible so get a good free compiler (not necessarily in recommended order):
Code::Blocks
MSVC++ Express
Open Watcom C++/Fortran
Bloodshed DevC
Turbo C++ Explorer 2006
Borland 5.5

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

If you look at Narue's, though, it's got a nice little optimization yours lacks.

True, but I try to keep it extremely simple for the newbies. They'll get into the optimization end of thing when they're ready. I'm sure instructors would look questioningly at a new student handing in code optimized in such a professional (advanced/expert) way.

But hers is much cooler! :icon_smile:

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

>But why don't IMG tags work?

I would guess it has something to do with this:
http://www.daniweb.com/forums/post329034-4.html

I guess that makes sense... :icon_redface:

Dani:
Update on the update:
With the forum index on the HOME page, I have no 'real' problem with the HOME page default, just a philosophical one. Especially if you can implement the read folder double-click.

And I still feel the images should be made a little shorter.

The new page layouts look really good. I like the idea that the code snippets and blogs follow the second-line topic.

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

WaltP,

To answer your question about it remembering your setting on the top bar when you select a different item, I had thought about that when designing it. However, I ran into the problem of what if you had Code Snippets selected on the top and then selected Tech Talk or Site Management on the bottom. Not all of the features are available for all categories.

Not a user friendly decision, IMO. If the feature is available, stick to it. If it's not, what's the most obvious feature to enter when selected. I don't think it's fair to force a double mouse movement/click when changing forums.

Secondly, tutorials, code snippets, blog entries, and the link directory all have vertical navigation menus that contain all of the other categories for that feature, which would make the navigation menu remembering the top setting redundant.

Then don't remember it there.

To answer your second question ... attach an image and then use [attach]ATTACHMENT ID #[/attach] bbcode.

OK, here goes:
[attach]5038[/attach]

OK, it works. But why don't IMG tags work?

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

I checked my old Borland C++ compiler, you may have to add the .h to your includes!

#include<iostream.h>
#include<cstdlib.h>

as for the second error its because your calling rand() which is in the file math.h try including that the compile again

Ahhh, all these clueless people.

Obviously iostream worked. But cstdlib didn't. Change it to stdlib.h instead. We won't even mention math.h

You might consider upgrading to at least Borland 5.5

Or one of these that have an IDE:
Code::Blocks
MSVC++ Express
Open Watcom C++/Fortran
Bloodshed DevC

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

I had a long response but decided to recap very simply:

All you need to do is post a question that we can answer. Rather than doing that you got huffy at us. Sorry 'bout that, but we can't respond to a non-question.

If you'd like to start again and actually post code and ask an answerable question, we'll still help. We just won't write the programs for you. Simple as that.

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

> As my case in point, your function is woefully broken in that it completely fails to do what it's supposed to do, which is reverse all of the bits. (emphasis added)

Well, that depends entirely on what you mean by "all".

Not really. There is only one acceptable definition of "all" in this case

> It doesn't work because in your quest for simplicity, you fail to take leading unset bits into account, when in the reversal they become critical.

Yes, of course, you are right. So then:

Nothing like fixing a bug with a kludge. If you think about it, you'd find this is more straight forward:

unsigned long reverse_bits( unsigned long value )
{
    unsigned long result = 0;
    size_t n = NBITS( value );  // interesting -- I'll let you get away 
                    // with this assuming NBITS is defined for your 
                    // compiler

    while (n--)        // saves messing around later
    {
        result <<= 1;
        result += value & 1;
        value >>= 1;
        n--;
    }

  return result;
  }

Before complaining too loudly you should have noticed that my algorithm and yours are nearly identical.

Nearly may be true -- and immaterial. Nearly correct and correct are quite a bit different. I'd want my pilot to be "exactly" correct. If he's "nearly" correct, we might be landing short of the runway. But he did everything "nearly" right... :icon_rolleyes:

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

I also like the split bar, but when you click on something on the second bar, the top bar resets to HOME. IMO it needs to remember the setting. In my case, i always want FORUM.

Also, the second bar seems longer than before, requiring more horizontal scrolling. Can the bar images be horizontally compressed by about 1/5th?

[img]http://wpattinson.com/img/home.gif[/img]
[img]http://wpattinson.com/img/sitemanagement.gif[/img]
[img]http://wpattinson.com/img/softwaredevelopment.gif[/img]
[img]http://wpattinson.com/img/webdevelopment.gif[/img]

How do you insert am image in this forum?

I'm liking the new split bar across the top. Because my mouse moves so damn fast across the screen, it used to select the forum drop-downs instead of the main screen.

So slow it down. You have the power! :icon_wink:

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

Use the mod (%) opreator followed by the divide (/) operator to check each digit.

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

I am starting to develop a calculator in C++ which accepts the expression in the form:
2+3 or
2/3 ,etc. ( for the time being, only two operands and one operator) Once i get that done, I will begin the process of continuely expanding it :)

Good idea.

The problem I am having is, that I read the book by Stroustrup, and there was an entire chap on it on Low level input. And since I have read that, my brain has gotten trapped and I continuely am adopting the same procedure to make my own program.

What the heck does that mean?

Are you another one that didn't read the post titled Read Me: Read This Before Posting? Don't leave it to us to figure out what's wrong. You need to tell us.

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

ah
and I was thinking it was my logic...
thnx very much it works perfectly now

No it doesn't. Try answering the question with "Supercalifragilisticexpialidocious". Chances are the program will crash because you are stuffing 34 characters into a 4-character array.

Instead of char use the C++ string . Then you can compare using ==, and your input won't crash your program.

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

I agree with you.
But, first this isn't my assignment, but a friend's of mine.

Exactly. It's her assignment, not ours. We are not going to do her work for her. We don't get the grade.

She doesn't even know why she should study c++, but she has to.

So, it's a requirement for her to study C++? And you feel that's stupid so it's better to have us do her work? Think again. A requirement is a requirement. If she can't do it, change to a school that doesn't have that requirement.

Even the professor she has tryies to help them but she doesn't have a clue about c++. That's why she is asking for help.

No, she's not asking for help. You're asking us to do it for her. That's not help. That's charity.

Anyway, it's your call.

No, it's her call. Wouldn't be better to have her post, instead of you? After all, who has the problem? Maybe she can follow the rules better than you since she has the code.

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

You must have missed reading the Rules as requested when you registered, as well as the post titled Read Me: Read This Before Posting at the top of the forum...

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

Hi, thanks for the reply. When I compile it, it says error in that statement, and so the program can't run, of course no output.

OK... When I take my car to the fixit shop and and say "it doesn't run right" what's the first question they're going to ask me?

Please tell us every thing we need for understanding, as suggested in the post titled Read Me: Read This Before Posting. I think it's title means something :icon_wink:

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

I've already written the code but the nested for loop if you didn't see it above.

No, you wrote

for (int i=0; i<nrecs; i++) {
		cout << recs[i].getName(buf) << endl;

     psuedocode that i'm having a hard time with:
  //      for each year in required range
         //print record's data for that year
	}
}

and I suggested:

Initially, ignore the 1000. Just print the data as you see it. You can then add the divide once you get the rest running.

So finish writing the loop and print some data.

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

Does it matter? Try writing the code and maybe we'll have a better idea when we see what you're trying to do.

Suggestion: Initially, ignore the 1000. Just print the data as you see it. You can then add the divide once you get the rest running.

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

It depends on what the 'fail' is. I assume it's because (this is a fact not an assumption) the parameters for the pow() function are not integers. But I might be wrong that that's what your 'failure' is.

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

And your problem is...?

When asking for help, you really need to explain why you need help. And "because it's wrong" or "because it's due" are not acceptable.