programming logic and design

posted by .

what is the output by each psuedocode segments ?

1. a=1
b=2
c=5
while a<c
a = a+1
b = b+c
endwhile
output a, b, c

2. d=4
e=6
f=7
while d>f
d=d+1
e=e -1
endwhile
output d, e, f

3. g=4
h=6
while g<h
g=g+1
endwhile
output d, e, f

4. j=2
k=5
n=9
while j<k
m=6
while m<n
output "goodbye"
m =m+1
endwhile
j=j=1
endwhile

5. j=2
k=5
m=6
n=9
while m<n
output "hello"
m=m+1
endwhile
j=j+1
endwhile

6. p=2
q=4
while p<q
output "adios"
r=1
while r<q
output "adios"
r=r+1
endwhile
p=p+1
endwhile

  • programming logic and design -

    1.
    Make a table:
    a b c
    1 2 5
    a<c?
    2 3 5
    a<c?
    3 4 5
    a<c?
    4 5 5
    a<c?
    5 6 5
    a<c? STOP

    You can try the rest and post if you have doubts.

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. programming

    Consider the following selection statement where X is an integer test score between 0 and 100. input X if (0<=X and X<49) Output "you fail" Else if (50<=X and X <70) Output "your grade is" X Output " you did OK" Else if …
  2. programming logic and design

    whats is the output for each psuedocode sedment?
  3. Computer Programming

    I need a check on my answers 1) prompt a user to enter an employee name, employee id, and hours worked until a value of "-1" is entered for employye name. my answer: Start Declarations num EmployId, HrsWrked string EmployName housework() …
  4. programming logic

    Find Bugs in the pseudocode // A high school is holding a recycling competition // This program allows a user to enter a student's // year in school (1 through 4) // and number of cans collected // Data is entered continuously until …
  5. Programming

    I need help with debug Debug06-02 // Program lets user input scores on four tests // Average is computed and letter grade is determined // Letter grades are based on 90 for an A, 80 for a B, and so on start string name num score num …
  6. programming

    Find Bugs in the pseudocode start Declarations num category num SIZE = 5 num QUIT = 9 num sales[SIZE] = 0, 0, 0, 0, 0 string HEAD1 = "Sales" string HEAD2 = "Category Number of Sales" output "Enter category ", QUIT, " to quit " input …
  7. programming

    using pseudocode debug the following 3 programs // A high school is holding a recycling competition // This program allows a user to enter a student's // year in school (1 through 4) // and number of cans collected // Data is entered …
  8. logic and design

    algorithm for waking in the morning, making and eating breakfast, I don't feel this is enough for my teacher can you help me. start get up while not awake drink coffee endwhile if temperature < 65 then wear sweater else wear t-shirt …
  9. logic and design

    algorithm for waking in the morning, making and eating breakfast, I don't feel this is enough for my teacher can you help me. Idon't know if i have enough code start get up while not awake drink coffee endwhile if temperature < …
  10. computer

    // This program counts how many sales are made // in each of five categories of products start Declarations num category num SIZE = 5 num QUIT = 9 num sales[SIZE] = 0, 0, 0, 0, 0 string HEAD1 = "Sales" string HEAD2 = "Category Number …

More Similar Questions