Repetition
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.
Repetition What are the advantages and disadvantages of the list box? when should a list box...
A. 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. B. What is the difference between a pretest and posttest Do...loop statement? give an example of each loop using pseudocode. C. What is an infinite loop, how to avoid your program runs with an endless loop? give an example
When should a list box be used instead of a combo box? When is the combo box preferable to a list box? Describe some guidelines for when to use each.
Describe the differences between cold work and hot work? List some advantages and disadvantages of each.
What are some advantages and disadvantages of the First-Fit memory allocation algorithm? List at least one (1) advantage and disadvantage. What are some advantages and disadvantages of the Best-Fit memory allocation algorithm? List at least one (1) advantage and disadvantage.
1. Discuss the difference between inheritance and composition. What are the advantages and disadvantages of each? Can you implement one with the other? 2.How is a class similar to a database table? How is it different? How do these similarities and differences justify the need for class models and for data models? Or do they? 3.Discuss the difference between association and composition. What are the advantages and disadvantages of each? 4.When would you apply inheritance? When would you not? Provide...
1. Discuss the difference between inheritance and composition. What are the advantages and disadvantages of each? Can you implement one with the other? 2.How is a class similar to a database table? How is it different? How do these similarities and differences justify the need for class models and for data models? Or do they? 3.Discuss the difference between association and composition. What are the advantages and disadvantages of each? 4.When would you apply inheritance? When would you not? Provide...
What are some advantages and disadvantages of using email? Identify some cultural differences in dining practices. Explain the difference between the U.S. and Continental eating styles.
please type Define natural gas, LPG, LNG and list the advantages and disadvantages of using conventional natural gas as an energy resources Name the advantages and disadvantages of the Conventional Nuclear Fuel Cycle What are minerals and rocks? List and compare open-pit mining, area strip mining, contour strip mining, and mountain-top removal List 5 pros and cons of large dams and reservoirs Define the following terms: floodplain ; xeriscaping; grey water, black water Define soil salinization and waterlogging of soils...
4 a) List the advantages and disadvantages of using negative feedback in electronic systems b) Draw a block diagram of an amplifier with feedback, labelling clearly the open loop gain Aol and feedback fraction, ?. Show that the gain with feedback is given by Under what conditions is the closed loop gain insensitive to variations in the open loop gain? c) Identify the feedback topology of the amplifier shown in Figure Q6c and hence the amplifier type. Represent the circuit...
1.What is the difference between prefix and postfix mode for the increment and decrement operators? Give examples of each. 2.How would you prevent infinite loops in a “while” loop statement? Give an example of an infinite while loop. 3.Give an example of a simple “for” loop. 4.What is a “sentinel” used for? 5.Give an example of the “open” member function to open a file.