Question

Repetition What are the advantages and disadvantages of the list box? when should a list box...

Repetition

  1. What are the advantages and disadvantages of the list box? when should a list box be used? Describe some guidelines for when to use a list box.
  2. What is the difference between a pretest and posttest Do...loop statement? give an example of each loop using pseudocode.
  3. What is infinite loop, how to avoid your program runs with an endless loop? give an example
0 0
Add a comment Improve this question Transcribed image text
Answer #1

a) List box are drop down menus which help in selecting an option from multiple options.

Advantage-> they do not take up much space and rather convinient for a congested webpage.

They can be an alternative to radio buttons.

Disadvantage-> user may not know about multiple selections in list box.

if list is very long, scrolling can be a problem

When to use-> if options are 2 or 3, use radio buttons instead.

if options are around >3 and <8 or 9, it is good to use list box. Appropriate size should be assigned to list boxes so that scrolling shouldn't create a problem.

for options>10, adjust the size of list box for smooth scrolling and adequate size for around 8-9 items in current scrll window.

b)

pretest check the exit condition before running loop iteration while posttest check the exit condition after loop iteration

example-> pretest

while (i<9){ write i; i=i+1 }

posttest->

do{ write i; i=i+1} while(i<9);

c)

infinite loop is loop that runs for countless iterations.

to avoid infinite loop->

check initialization condition on loop variable

check update condition on loop variable

check exit condition on loop variable

add a debug statement printing different variables.

check flow of control of program using flowcharts.

Example->

i=1;

while (i<9){

write i;

}

there is no update condition so the loop will run infinitely.

Add a comment
Know the answer?
Add Answer to:
Repetition What are the advantages and disadvantages of the list box? when should a list box...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT