Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Calculator Pseudocode

calculator pseudocode python help

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1 MattLR

MattLR

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 27 June 2014 - 05:39 AM

Hey guys, just looking for some help on writing some pseudo code for my calculator which i made on python 3.3. I want it to be similar to my hangman pseudocode which can be seen here:

INPUT name
PRINT “Welcome + name”

INPUT difficulty
IF difficulty = 1:
	Words = “easy words”
IF difficulty = 2:
	Words = “medium words”
IF difficulty = 3:
	Words = “hard words”
IF difficulty = 4:
	quit()

user INPUT guess
IF guess is in word:
	correct_guesses = correct_guesses +1
	OUTPUT guess into secret word
	
IF guess is not in word:
	incorrect_guesses = incorrect_guesses +1
	print hangman_pics

IF incorrect_guesses = 7:
	game over = true
	input “would you like to play again?”
	IF input = yes:
		restart code
	IF input = no:
		quit()

IF correct_guesses = to len(word):
	game over = true
	print “Congratulations!”
	input “would you like to play again?”
	IF input = yes:
		restart code
	IF input = no:
		quit()

The link to my calculator is attached and i would like the pseudo code to be based on it. Thanks!!

 

Matt Le Riche

 

 

Attached Files



#2 Ritwik I the programmer

Ritwik I the programmer

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 244 posts

Posted 27 June 2014 - 06:01 AM

Conversion from python to pseudocode isn't at all difficult. But the point is, why would someone want to do so I have no idea(if this is a homework assignment, you have my sympathies). Speaking in a general way, Python is pseudocode. While doing the whole assignment for you would be against forum policy, I can give you a hint. Look for how you would convert the above psudocode into python code, what rules you would use. Then reverse them, and work on the given code.


I can believe, but why should I?





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download