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
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.
Yes I know but still not sure how to make a program for this problem
Well, how far did you get? What did you have trouble with?
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
OK. I would do it in a loop. Then the condition for exiting the loop would be the -999
Also, that is not supposed to be an s. It is a 5. \(F=\dfrac{9C}{5}+32\)
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."
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.
Im lost so is anything that I did correct?
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.
Here, this diagram may help.
yes that does help. putting it a diagram explains it better
How did the psudocode go after that?
Join our real-time social learning platform and learn together with your friends!