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

Then NO SIR! We are not a homework delivery forum. Why take the class if you don't want to bother to learn the language?

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

Hi guys,

I'm not good at programming so would you help me with this?! No fancy codes, just make it simple.

So you want us to provide you with the answer to this program? Just make it simple. Is that correct?

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

This is my updated code

Good. Problem fixed I take it?

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

I've tried that already, that's why I'm confused about initializing variables......it says age and yearsUntilRetirement aren't being initialized.

Then you did it wrong. But since I can't see what you did, I can't help.

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

So why not
1) open the file before the loop
2) write the data to the file when you get it
3) close the file after the loop
:icon_question:

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

Thank you very much, sir! But how do I rotate to the right k positions, please? From what I see there, it rotates it to the left one time. Thanks.

So do it k-1 more times -- use a loop.

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

Print out your values in main() between your function calls. See where the values become bad.

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

yea i know but unfortunately its a requirement to check both

No, it's a requirement to have a check for both. It's not a requirement to continue checking after a failure as Vernon suggests.

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

I'm such a beginner, how do I make the function accept and integer value? Thank you for your help so far!

Put it between the ()'s like you did for the call. Check your text.

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

yeah triumphost thats what im trying to do...how can i achieve this?

You are allowed to read more than just the last post. Arbus gave you the solution.

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

Base on the code you posted, you are easily smart enough to rewrite it to use the hint.

Unless you didn't write that code. Did you?

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

where did you follow the
hint: use an integer array of size 128 and use the ASCII values of letters to index into the array to store and retrieve counts for the letters?

By not using the hint, your code is much larger than it needs to be.

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

That's because if ( time1 != 'p' || time1 != 'a' ) is always FALSE. Write out a truth table for your comparison.

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

Format your code so we can follow it.
Then tell us what's happening, don't make us guess.

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

Is there anywhere in your problem description that states you must save each input somewhere?

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

It's easiest to help you if you attempt to write option1() and if it doesn't work post that code. Then we can see what you tried and explain how to fix it.

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

Asking a question on a Forum does not give you the right to a perfectly coded answer to your question.

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

You're welcome. But for what I don't know. It's hard to answer your question since you didn't ask one.

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

Some people post here looking for help. Others post to have their problems done for them.

We've given you help. 4 different suggestions and code.
You complained. You want us to write the code for you. Sorry. That's not how this public forum works.

If you want to post more information to help us understand what you don't understand, please do. But right now, I guess we don't really know what you need.

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

Sounds like your idea will work well. Try it and see.

I don't know about stopping at whitespace, but you can certainly find whitespace after your substring is found.

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

The only thing I did not see in this thread is:
Use the difftime() function check the time difference.


But what I do see is a lot of help given and no attempt, only attitude, from the person asking for help. Please reread this thread and try using the help given.

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

Look up the methods of the string class. There's a lot you can do with it.

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

Sorry, didn't remember there was a split command. Ignore my post

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

I made the report header in the printHeaderInformation function what I don't understand is the instructions to create the table for the amortization

That statement makes no sense. You wrote all that code and don't know how to output the data from it? I guess you need to give a detailed explanation of your confusion.

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

As you show the number of birds, add the number to a running total, like totlaBirds += numberOfBirds Be sure to zero the total before starting.

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

That is where I am lost,

Your code isn't that large, you can't be that lost

if I enter months[highest] or highest[months] I get an error,

An error. Like it crashes the computer? Like it burns the roast? Like it nukes the city? Never never say "an error". We are not psychic and hate to guess.

I suppose I am not really sure how to output the month names.....

The same way you output anything, with cout << ...

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

I use instr() , mid() , right() , and left()

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

printf ("Last Digit : %d\n", p - 10 * (p / 10));

Why so complex? printf ("Last Digit : %d\n", p % 10);

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

You posted Code that makes no sense at all.

1) Output a message
2) define a string variable
3) Sort nothing since all you did was declare a variable
4) declare a prototype for a non-existant function
5) start a loop the 
   a) inputs a string
   b) outputs the string

You need to think through what you want to do and put the steps in their proper order.

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

Ah, OK...

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

I am working on a rainfall program that will ask the user to enter the total rainfall for each month, then will calculate the total rainfall for the year, the average monthly rainfall and is supposed to display the month names for the highest and lowest month. I have everything else working but my months are displaying numbers not the actual month.

Where are you outputting the Month Names?

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

Why?

Since I'm not a Facebookie not a Tweetie, I'm honestly curious as to why all this linking is a good thing. What does it really do for a member? for DaniWeb?

jonsca commented: I know it's that you just don't want people to see your pictures of you partying in the club. Personally, I'm trying to hide my faux celebrity status. +0
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

No, you can close this. It's your thread.

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

Interesting post. You might want to work on your formatting, though. It's inconsistent.

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

Also, one of your do-while s is testing repeat1, but the variable is never set nor read. It contains garbage.

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

Formatting is still crap...

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

It seems that you don't really want help because in 3 posts you've told us nothing about your problem and have ignored two requests for an explanation.

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

This statement on line 78 while((choice=='y') && (choice!='Y')); seems to do nothing -- unless choice is 'y' or 'Y' in which case you have an endless loop.

Please reformat your code. We can't tell where one loop ends and another starts. There are too many blank lines that simply hide the structure. And your indenting is too inconsistent to help in understanding.

Use the link to format so it's readable. And follow the other link I gave you too.

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

These are questions for you to consider, not to tell me:

Where do you ask for YES or NO?
Where do you accept the answer? Into what variable?
Where is the end of the loop that requires the answer? What makes it continue/exit?

Do all these lines make sense in the order you wrote them?

Also, see this

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

In order to get help, you need to ask a question, not just post code and hope we can figure out if there's an error and what it might be..

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

i don't really have a time limit on this, it's not an assignment, so if there's a source you know about i can read up on these complicated things you're telling me I have to do if i don't want a work-around, i am open for that kind of thing. I can create the buttons from code already, just need to change their color.

You're kidding, right? AndreRet already gave you code to do it. What more do you want?

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

I don't quite comprehend each, character, words and alike...

You're kidding, right?
For each, words, and alike, check a dictionary.
For character, check your class text.

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

Still can't read you code. Again format it. It's not hard.

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

It looks to me like everyone miss this line in your instructions:

train construction commands from standard input (i.e. just use read).

Your instructor told you what command to use for input, didn't he?
I agree fgets() is better. Then again, maybe he meant it only as an example.

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

I ask a user to input {2 + (3-6) * 8} as a string.
then I want every each of the string in array :
ar[0] = {
ar[1] = 2
ar[2] = +
ar[3] = (
and so on until }

how do I implement this in c++?

Every each? Each is not a noun. You mean every character.

Just input it into a string. By definition ar[0] will be the first character. That's true for strings and char *s.

what about a user input "My Name is Marianne" as a string.
then every each of the string in array of words :
ar[0] = My
ar[1] = Name
ar[2] = is
and so on until Marianne.

word, not each.

Make an array of strings and place each word into each element.

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

You didn't pass your file pointer into fn_out() . You created another one which was destroyed when the function ended. Pass fp into your open function.

Also, see this about scanf() and this about fflush()

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

There is some error, due to which I am getting wrong answer.

1) If "there is some error" then you have a mistake. We are not psychic. What's the error?
2) Format your code. We can't help you if we can't follow the code.

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

The time() function is not used by the rand() function. It's only a way to seed the srand() function with a different value every time it's called. rand() returns a value from 0 to RAND_MAX (32767 on many systems).

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

See my previous post.

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

I'm getting a LN2019/LN1120 error, and I have no clue why... any suggestions?

My guess if you did something wrong somewhere in that 100 lines of code that the compiler didn't like and it gave you a cryptic error message that no one understands because we aren't compilers.

Try posting the exact error message and the line number -- based on your post -- and maybe we'll have a better idea.


Looking back on your previous threads, the first responses have been:

What are the messages that the compiler is telling you? Learning how to interpret them is an important skill. Start with the first error. If you can't figure out what it means, post it with the line number.

What's your first problem?

You'll have better luck with some explanation, not just posting code and asking us to figure out what it does. Pinpoint as close as you can where the problem seems to be, and what the crash circumstances are.

Basically, what you have here is the same as taking your car to the mechanic, saying "Fix", and walking away.

>> Run the program, it just says there's syntax errors.

It either runs or there are syntax errors. If there are syntax errors, it won't compile, so it can't run. There could be a RUN-TIME error, but that's not a syntax error. What's the exact error message, what's the line number, and is it a run-time error or a compile error?

Why do you …