Graeme Hendry

Graeme Hendry

  • NA
  • 1
  • 712

need pseudocode changed into c#

Mar 24 2016 6:14 PM
hi i am new to coding and im trying to make a program from the following psuedocode i have been trying but i am struggling to do it
 
Menu Program
Begin
GetMenuChoice( name)
Begin
variable
choice
Display(“newline, newline, Hi “ + name + “Welcome to this little menu system, newline, newline”)
Display(“tab-------------------------MENU-----------------------------newline,newline,newline)
Display(“tab1. Show all integers, inclusive, between two user entered numbers(1-00) newline)
Display(“tab2. Enter three integers and show the highest newline”)
Display(“tab3 Exit newline, newline)
Display(“Pick one of the choices”)
Read(choice)
Return(choice)
End GetMenuChoice
ShowRangeOfNumbers( low, high)
Begin
variables
count
For count = low to high step 1
Display(count + “ “)
Endfor
Display newline
End ShowRangeOfNumbers
ShowHighestOfThreeIntegers(number1, number2, number3)
Begin
Variables
highest
If (number1 > number2 and number1>number3)
highest = number1
else
if(number2>number1 and number2>number3)
highest = number2
else
highest=number3
endif
return(highest)
end ShowHighestOfThreeIntegers
main program
begin
variables
userName
menuChoice
highest
lower, upper
value1, value2, value3
Display(“Enter your full name”)
Read(usernName)
Convert userName to uppercase
Do
menuChoice = GetMenuChoice(userName)
switch(menuChoice)
begin
case 1 : Display(“Enter lower number”)
Read(lower)
Display(“Enter upper number”)
Read(upper)
ShowRangeOfNumbers(lower, upper)
Break out of switch
case 2: Display(“Enter first number”)
Read(value1)
Display”Enter second number”)
Read(value2)
Display(“Enter third number)
Read(value3)
highest = ShowHighestOfThreeIntegers(value1, value2, value3)
Display(“Highest number is “ + highest);
Break out of switch
case 3: Break out of switch
end switch
while(menuChoice not = 3)
end main
end Menu Program
 

Answers (1)