Ask your own question, for FREE!
Computer Science 14 Online
OpenStudy (anonymous):

Can someone show me how to do a top down psuedocode for Allow the user to entera series of temp in degrees in celcius(c) terminated by the input-999 for each one find the corresponding temperature in degrees fahrenheit(f) the conversion formula is F=9*c/s+32

OpenStudy (e.mccormick):

Psudocode just means it is text sayng what will happen. It does not need to be real code. So even if the language uses something like `Syspem.out.println("print this line");` in psudicode you can do `print "print this line"` and it is fine.

OpenStudy (anonymous):

Yes I know but still not sure how to make a program for this problem

OpenStudy (e.mccormick):

Well, how far did you get? What did you have trouble with?

OpenStudy (anonymous):

I put Declare F as an integer Declare C as an interger input <-999 for (9*c/s+32) thinking it is all wrong totally confused

OpenStudy (e.mccormick):

OK. I would do it in a loop. Then the condition for exiting the loop would be the -999

OpenStudy (e.mccormick):

Also, that is not supposed to be an s. It is a 5. \(F=\dfrac{9C}{5}+32\)

OpenStudy (e.mccormick):

Also, look at the order. "Allow the user to entera series of temp in degrees in celcius(c) terminated by the input -999" A series, in math, is an ordered list of numbers. In in computers, this would be an array. So it is saying to take in an array that terminates when they enter -999. Then they say "for each one find the corresponding temperature in degrees fahrenheit(f)" which is just what you need to do tp the array. Finally, they end with a hint on the math needed to actually do that "the conversion formula is F=9*c/5+32."

OpenStudy (e.mccormick):

Now, you could look at it one temperature at a time until they enter -999, but I think the problem would have been worded differently for that. The until -999 part would have been after everything else in the instructions.

OpenStudy (anonymous):

Im lost so is anything that I did correct?

OpenStudy (e.mccormick):

Well, like I said, you would use an array. So the input would be an array of F integers, not just a single integer. The variable for C you can find each time it is output, so it being an int (not array) is fine. The calculation would be inside the output loop.

OpenStudy (e.mccormick):

Here, this diagram may help.

OpenStudy (anonymous):

yes that does help. putting it a diagram explains it better

OpenStudy (e.mccormick):

How did the psudocode go after that?

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!