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

Update:
Still have threads with no posts in almost a week marked as new.
But on the other side of the spectrum, I have threads with new posts over the last 5 hours are marked as read.

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

Using your IF statement if (word[i] == 'y' && isVowel(word[i-1]) == false && isVowel(word[i+1]) == false)
if 'y' is the first letter, what is the value of word[i-1]?

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

On Y as a consonant or vowel:
What are the rules defining this? I don't know the rule.

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

but I cannot get the words with consonants to translate correctly. I have seen lots of examples on here of Pig Latin programs, but they don't seem to follow the type of parameters that we have to use for this class. Any help would really be appreciated, as I have been working like crazy trying to get this thing right, and I simply cannot.

How are your parameters different from the standard Pig Latin? If they are so different, it really isn't Pig Latin. Isn't it just move the consonants to the end of the word and at "ay"? That's how all Pig Latin programs work.

You might want do describe what you are supposed to do and what is really happening so we have something we can understand.

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

Reformat your code so we can tell wht statements go with what DO loop.

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

So migrate to a real browser -- they're free! :twisted:

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

Even after refreshing the page or revisiting it?

--

"Over the past few days..." Refreshing/revisiting is required during that timespan.

--

Huh?

Since I am not on Daniweb 24/7 and I shut my computer down nightly, I revisit the site quite often over the span of a "few days". I'm sure somewhere in those few days a refresh happens -- like when the computer shuts down and the browser must restart the next day.

And today I have many "new" messages -- from 2-5 days ago.

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

"Over the past few days..." Refreshing/revisiting is required during that timespan.

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

Over the past couple days I've marked ModPlace and Feedback Forums as READ several times and still get 'NEW' posts.
dani2

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

What ways have you tried? It helps is to know everything otherwise we'll just tell you to try the same stuff over and over...

Did you try testing the value entered in the keypress event?

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

I have a question for a homework assignment. This is C, not C++ (sorry! i didn't know where else to go).

Maybe in the C forum? I pity the future... :icon_rolleyes:

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

how can i use F1-F12 in switch case statement??

Write a program that inputs keystrokes, then displays the values entered in HEX.

But standard C cannot input function keys, so you may be out of luck. It all depends on the compiler you are using or how much you want to tap into the system APIs.

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

Tagging sounds familiar and comfortable.

Maybe to you... :icon_wink:

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

what is the problem actually in my code?when debug ,it will crash or come out same data.


1>c:\users\lenovo\documents\visual studio 2010\projects\chemquiz\chemquiz\quiz.c(33): error C2449: found '{' at file scope (missing function header?)
1>c:\users\lenovo\documents\visual studio 2010\projects\chemquiz\chemquiz\quiz.c(512): error C2059: syntax error : '}'
1> game.c
1>c:\users\lenovo\documents\visual studio 2010\projects\chemquiz\chemquiz\game.c(29): warning C4244: 'function' : conversion from 'time_t' to 'unsigned int', possible loss of data
1>c:\users\lenovo\documents\visual studio 2010\projects\chemquiz\chemquiz\game.c(64): error C2059: syntax error : 'return'

It all depends on what is on or before lines 33 and 512 in quiz.c and lines 29 and 64 of game.c

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

When in the loop:
I is incremented by 1
J might be incremented by 2, then it's set to 5

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

Input all the numbers
Sort the numbers
Remove the duplicates
Output what's left

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

What value do you expect

sizeof(char*)

to be?

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

Compare the beginning of the string with each of the 'commands' and when you get a match test the rest of the string for the parameter(s), converting the digits to numbers if needed.

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

Find the min/max. The one that's left is the median.

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

Depends on the compiler I suppose...

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

And what do you need help with, other than learning how to format your code so we can understand it.

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

There's already a lot of links in the Starting "C"
Did you finish checking them all already?

Do you really have to ask? With every question he's proving he hasn't taken any steps anyone here has given him.

zeroliken commented: your obviously right +9
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Hello, thank you for helping me out. I'm sorry, but when I tried to compile the code it gave me an error on line 64 it said BuyTicket is undeclared (first use this function).

Good. Ignore what he wrote and do your own work. You learn nothing by having someone do your homework for you.

Follow my post and learn how to be a programmer. Follow Tygawr's post and you'll need him to write your next assignment, too.

Tygawr commented: Everyone has their own way of teaching. -1
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

By using the proper comparison in the loop statement itself, like
while (this is true)

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

Yes I can.

If you want me to do it for you, as a computer consultant I get $85 an hour.

Tygawr commented: not worth it. +0
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

First thing I see is a very complex and IMO cumbersome while statements. A while statement is supposed to test something and either enter/continue or exit the loop. It's not meant to input a lot of values and AND the return values of the inputs. Take all those inputs and do them somewhere else and use the while to control the loop.

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

yup, that did it, but just so I have a better feel for it, I seed the random number algorithm thing and then thats the first number the algorithm uses...

No, the seed designates where within the list of random numbers rand() will start. Random numbers are not calculated, they are pulled from a huge list.

a. Why was I getting 8 for every random number when I didn't seed the random number generator/what 'seed' was the generator using in the algorithm before?

Because the default seed always starts at the same place.

b. what is time(0) ? is it the number of nanoseconds that have elapsed since the program was compiled or something? and what does the '0' parameter do?

Look up the time() function. It has nothing to do with nanoseconds...

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

You need to rethink your program. If you don't understand what you are writing, you should not be writing code. You need to sit at a desk with pencil and paper and plan -- yes plan -- what you need to accomplish.

Write down what the task is.
Break that description into pieces -- like in English class, what are the nouns, verbs, and the implied parts (but don't really look for nouns and verbs -- that's English class)

Write down how you accomplish each task. Then break that down into smaller pieces until you get to the point each step is as small as it can get.

There's your design. Now run through it by hand to see if it does what you want. Write down variables as they change. YOU be the computer and that description is your code.

When that's done, works, etc., now you're ready to start coding. Take a section at a time. Do the input. Get it working completely. Add the output. Get it working. Then one more step. Get it working. Add another... ad nauseum.

That's programming! (sorry, but that's really how we do it.)

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

You probably forgot to seed it.

In other words, you didn't use srand()

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

A character doesn't detect EOF. Reading the file detects EOF.

Based on what little you posted, that's about all we can say.

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

how can i check if the number is positive or not by using switch statement

Use the % operator in the SWITCH statement. You know what values you will get so use those values in the CASE statements.

please who know the answer help me and answer the question

Please don't be so pushy. this statement is completely unnecessary and can be read as rude. Just so you know.

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

Not a clue what you are asking. Maybe some details will help in understanding.

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

my problem is I can't get it to generate random comments. also how do i get it to play again and count the number of winning and losses

What random comments?
Put a loop around the area you want to repeat.
Before the loop set wins/losses to 0
Update them at the bottom of the loop
Also, at the bottom ask if you want to play again. The answer controls the loop.

Be sure to initialize the variables at the top of the loop that need to be initialized for each game.

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

Didn't know there was a forum rule stating I had to state that I already did a search. Just fingured we could assume I did a search since it says all over the place that we should search before posting :p

Actually, you are in the minuscule minority. Extremely few people do a search so it's natural for us to assume you didn't either. In fact, many will ask a question with two visible threads already started on the exact same question. All they had to do was read the other threads, but they are too lazy to look.

Sorry you got lumped into the unwashed millions, but that's how it goes. Just let us know next time what you've done so we know you are in the intelligent group, and not with the monkeys... No insult intended... :icon_wink:

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

You need to explain the problem you are having. We can't help you if we don't know what you need help with.

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

Thanks for assuming I didn't do a search but its ok, I forgive you.

Gee, thanks. And I forgive you for leaving out important information...

We didn't learn anything about strings in class yet so I can't do that.

Then you can't do it yet. Wait until you learn strings.

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

[boilerplate_help_info]

Posting 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?
[*]If you have errors, post them! We can't see your screen.  We can't read your mind. You need to tell us what happened.
[*]Do [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 …
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

This has been answered so many times you should just do a search.

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

Also, we frown on people posting working answers for others that they can simply use to pass their course. We call that cheating. Therefore, from now on, please help then find their own solution, not post a solution for them.

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

#1: See this about gets() #2: See this[/url] about reading a single character with scanf()/fscanf()

Read a character.
Use a switch to test if it's a TERMINATOR
If so, read next character 
[
   if it's a secondary terminator character read one more 
   [
        if it's a tertiary terminator
        [
            you've found the end of a sentence 
        ]
        else
        [
            you've found nothing...
        ]
    ]
    else
    [
        you've found nothing...
    ]
]
else
[
    you've found nothing...
]
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

for (int i=0; i<=0; i++) -- look carefully...

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

Yeah, what he said, too.

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

When you go outside the bounds of an array, you simply overwrite variables you shouldn't. You get an exception when you've overwritten enough to leave your dataspace and try to write outside of the program's assigned data space.

Expand your loop to 100 or more and you'll probably get your exception.

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

Where are _delay_ms and _delay_us defined?

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

Model the atmospheric layers of Jupiter

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

In fact, it means upload this book here or any site, to me
Amazon i can't buy this books because it's expensive

That's illegal. That's also stealing.

There are enough free resources on the web for you to learn the beginnings of C. Just start doing it.

thines01 commented: Right! +13
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

After you find a word, search again starting just after the first letter of the found word.

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

BAT files cannot access the clipboard.

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

I know I haven't tried to read the data in here, but everything I'm doing is wrong and I'm just hitting my head against a wall searching the internet.

If you haven't tried to read the data, you haven't done anything wrong -- yet!

And until you actually attempt to read the data, we can't help you fix what you did wrong.

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

Why can't you subtract the [number of tickets entered] from the [number of tickets left] (which starts at 50) and check if the new [number of tickets left] is < 0?