I wish to relate on some Pseudo Code if you Please !!!

Recommended Answers

All 7 Replies

Post your pseudo code, ask your question and we'll see...

//Variable declarations:
Declare Integer choice = 0
Declare Integer ammmunition = 5
Declare Real fuel = 200.0

//main selection menu
While choice !=4
//display menu
Display "Menu Selections:"
Display "1-Fire Weapon"
Display "2-Move Forward"
Display "3-Move Backward"
Display "4-Exit"
Display "Enter Your Selection"
Input choice

//check menu selecton
If choice == 1 Then
Fire Weapon()
Display "How Far In Feet Is Your Target?"
Input feet
If feet <= 20
Display "Target Distroyed"
If feet <= 40
Display "Target is Partially Disabled!"
If feet > 40
Display "Target Unharmed!"

//This is were things get a little tricky !!!

Else If choice == 2 Then
moveForward()
Else If Choice == 3 Then
MoveBackward()
Else If Choice == 4 Then
Display "GoodBye!"
Else
Display "Invalid input-Please try again!"
End If
End While

What do you want to do with this pseudo code ?

Grib, i have a feeling this is for some kind of python assignment.

Essentially that pseudo-code works. I really never found pseudo-code that useful in python though. The actual code is just so similar to it that it almost makes no sense to make it. :)

Yes, well

Forward
promt to enter how fay to move, haw far away is any obsacles , if obstacle is blocked print message "You are Blocked, object is ? distance"
if not blocked then print " Move forward at your leizure!"

Yes this is my first term in psuedocode so please be gentle !!!

//This is An Up Date !!! Just review and see if you notice anything out of the ordinary and yes when i get this one I need to disiphur in Python !!!

//Also assumming all indentations are two spaces inward !!!

//Variable declarations:
Declare Integer choice = 0
Declare Integer ammmunition = 5
Declare Real fuel = 200.0
Declare Interger feet = 200
Declare String obsticles

//main selection menu
While choice !=4
//display menu
Display "Menu Selections:"
Display "1-Fire Weapon"
Display "2-Move Forward"
Display "3-Move Backward"
Display "4-Exit"
Display "Enter Your Selection"
Input choice

//check menu selecton
If choice == 1 Then
Fire Weapon()
Display "How Far In Feet Is Your Target?"
Input feet
While choice == 1 Then
If feet <= 20
Display "Target Distroyed"
If feet <= 40
Display "Target is Partially Disabled!"
If feet > 40
Display "You Missed!"

Else If choice == 2 Then
moveForward()
Display "How Far Would You Like to Move in Feet?"
Input feet()
Diplay "Are there any Obsticles in Your Way?"
Input obsticles
Set obsticles = y, n
While choice == 2
If obsticles = y then
display "Obsticles In Way, You Must Move Backward!"
Else obsticles = n then
Display "Coast is Clear, You May Proceed!"
Else If Choice == 3 Then
MoveBackward()
Display "How For Would You Like to Move in Feet?"
Input feet()
Diplay "Are there any Obsticles in Your Way?"
Input obsticle
Set obsticles = y, n
While choice == 2 Then
If obsticles = y Then
Display "Obsticles In Way, You Must Move Forward!"
Input obsticles
Else obsticle = n Then
Display "Coast is Cleear, You May Proceed!"

Else If Choice == 4 Then
Display "GoodBye!"
Else
Display "Invalid input-Please try again!"
End If
End While

//If this is right, the more I write the more it seems to fall into place ?
//New Update !


//Variable declarations:
Declare Integer choice = 0
Declare Integer ammmunition = 5
Declare Real fuel = 200.0
Declare Interger feet = 200
Declare String obsticles
Set feet = fuel

//main selection menu
While choice !=4
//display menu
Display "Menu Selections:"
Display "1-Fire Weapon"
Display "2-Move Forward"
Display "3-Move Backward"
Display "4-Exit"
Display "Enter Your Selection"
Input choice
Else choice <> 4
Display "Please Enter Another Selection!"

//check menu selecton
If choice == 1 Then
Fire Weapon()
Display "How Far In Feet Is Your Target?"
Input feet
While choice == 1 Then
If feet <= 20
Display "Target Distroyed"
Else If feet <= 40
Display "Target is Partially Disabled!"
Else If feet > 40
Display "You Missed!"
End If
End While

Else If choice == 2 Then
moveForward()
Display "How Far Would You Like to Move in Feet?"
Input feet()
If feet >= 201
Display "Out Of Fuel
End If
Diplay "Are there any Obsticles in Your Way?"
Input obsticles
Set obsticles = y, n
While choice == 2
If obsticles = y then
Display "Obsticles In Way, You Must Move Backward!"
Else obsticles = n then
Display "Coast is Clear, You May Proceed!"
End If

Else If Choice == 3 Then
moveBackward()
Display "How Far Would You Like to Move in Feet?"
Input feet()
If feet >= 201
Display "Out Of Fuel
End If
Diplay "Are there any Obsticles in Your Way?"
Input obsticle
Set obsticles = y, n
While choice == 2 Then
If obsticles = y Then
Display "Obsticles In Way, You Must Move Forward!"
Input obsticles
Else obsticle = n Then
Display "Coast is Cleear, You May Proceed!"

Else If Choice == 4 Then
Display "GoodBye!"
Else
Display "Invalid input-Please try again!"
End If
End While

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.