Need help with this Pseudocode
-
Hi I am in a college programming class and I am kind of confused how to write this pseudocode. It says "Write the pseudocode for problem 9-2.5" 9-2.5- Prompt the user to input a temperature in the Fahrenheit scale. Then display its equivalent in the Celsius scale. Repeat until a temperature of 9999 is entered. Example Preudocode: INPUT length, width LET area = length * width OUTPUT area or LET count = 1 LET total_area = 0 DO WHILE count < = 4 INPUT length, width LET area = length * width LET total_area = total_area + area LET count = count +1 LOOP OUTPUT total_area
-
Hi I am in a college programming class and I am kind of confused how to write this pseudocode. It says "Write the pseudocode for problem 9-2.5" 9-2.5- Prompt the user to input a temperature in the Fahrenheit scale. Then display its equivalent in the Celsius scale. Repeat until a temperature of 9999 is entered. Example Preudocode: INPUT length, width LET area = length * width OUTPUT area or LET count = 1 LET total_area = 0 DO WHILE count < = 4 INPUT length, width LET area = length * width LET total_area = total_area + area LET count = count +1 LOOP OUTPUT total_area
What exactly are you confused about? What have you tried so far?
The difficult we do right away... ...the impossible takes slightly longer.
-
What exactly are you confused about? What have you tried so far?
The difficult we do right away... ...the impossible takes slightly longer.
-
It amounts to simply writing down the steps necessary to complete the task. Since it's pseudo code, you don't need to be technically accurate. What is the first thing that has to happen to solve this problem? What is the second thing? Hint: 1. User enters number 2. First step to calculate answer 3. Second step to calculate answer
The difficult we do right away... ...the impossible takes slightly longer.
-
Hi I am in a college programming class and I am kind of confused how to write this pseudocode. It says "Write the pseudocode for problem 9-2.5" 9-2.5- Prompt the user to input a temperature in the Fahrenheit scale. Then display its equivalent in the Celsius scale. Repeat until a temperature of 9999 is entered. Example Preudocode: INPUT length, width LET area = length * width OUTPUT area or LET count = 1 LET total_area = 0 DO WHILE count < = 4 INPUT length, width LET area = length * width LET total_area = total_area + area LET count = count +1 LOOP OUTPUT total_area
Here's one clue: when you want to have a loop that is guaranteed to be executed once, that construct is: Do ... While. In this case consider: Do // code // code While (the user has not entered 9999)
"What Turing gave us for the first time (and without Turing you just couldn't do any of this) is he gave us a way of thinking about and taking seriously and thinking in a disciplined way about phenomena that have, as I like to say, trillions of moving parts. Until the late 20th century, nobody knew how to take seriously a machine with a trillion moving parts. It's just mind-boggling." Daniel C. Dennett
-
Hi I am in a college programming class and I am kind of confused how to write this pseudocode. It says "Write the pseudocode for problem 9-2.5" 9-2.5- Prompt the user to input a temperature in the Fahrenheit scale. Then display its equivalent in the Celsius scale. Repeat until a temperature of 9999 is entered. Example Preudocode: INPUT length, width LET area = length * width OUTPUT area or LET count = 1 LET total_area = 0 DO WHILE count < = 4 INPUT length, width LET area = length * width LET total_area = total_area + area LET count = count +1 LOOP OUTPUT total_area
There is no standard for writing pseudo-code, so you almost free to write without bounds of language syntax (however I saw universities with there own standard, and if you have something like this at your college, you should use it). Read about the idea of pseudo-code - start here http://en.wikipedia.org/wiki/Pseudocode[^] This is one sample to the '9-2.5' problem...
GET temp_f
WHILE temp_f != 9999
COMPUTE temp_c = (temp_f - 32) * 5/9
PRINT temp_c
GET temp_f
LOOPI'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
-
There is no standard for writing pseudo-code, so you almost free to write without bounds of language syntax (however I saw universities with there own standard, and if you have something like this at your college, you should use it). Read about the idea of pseudo-code - start here http://en.wikipedia.org/wiki/Pseudocode[^] This is one sample to the '9-2.5' problem...
GET temp_f
WHILE temp_f != 9999
COMPUTE temp_c = (temp_f - 32) * 5/9
PRINT temp_c
GET temp_f
LOOPI'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
-
There is no standard for writing pseudo-code, so you almost free to write without bounds of language syntax (however I saw universities with there own standard, and if you have something like this at your college, you should use it). Read about the idea of pseudo-code - start here http://en.wikipedia.org/wiki/Pseudocode[^] This is one sample to the '9-2.5' problem...
GET temp_f
WHILE temp_f != 9999
COMPUTE temp_c = (temp_f - 32) * 5/9
PRINT temp_c
GET temp_f
LOOPI'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
You're not supposed to do the work for him!
The difficult we do right away... ...the impossible takes slightly longer.
-
You're not supposed to do the work for him!
The difficult we do right away... ...the impossible takes slightly longer.
I believe in innocent. His not asked just because his lazy but because he don't know how to ask even. So beside to give him some - not very bright - solution I tried to point him to the right direction...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
-
I believe in innocent. His not asked just because his lazy but because he don't know how to ask even. So beside to give him some - not very bright - solution I tried to point him to the right direction...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
It's quite clear from the original question that this is a college assignment. So by giving him the answer you are not really helping him. It's much better that people like him learn to think for themselves and at least try to work out the answer.
Veni, vidi, abiit domum