Create the logic for a program that continuously prompts a user for a numeric value until the user enters 0. The application passes the value in turn to a method that squares the number and to a method that cubes the number. The program displays the results before reprompting the user. Create the two methods that square and cube a number passed to them, and then return the calculated value.

1 answer

square(n) {
return n*n
}

cube(n) {
return n*n*n
}

Loop
prompt "n: "
read n
exit loop if n == 0
s = square(n)
c = cube(n)
print n,s,c
end loop
Similar Questions
  1. Create the logic for a program that continuously prompts a userfor a numeric value until the user enters 0. The application
    1. answers icon 0 answers
  2. Pseudocode -Create the logic for a program that continuously prompts a user for a numeric value until the user enters 0. The
    1. answers icon 3 answers
    1. answers icon 1 answer
    1. answers icon 2 answers
more similar questions