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
A.
List Box:
A list box is used in situations when there are multiple values and one or more than one value need to be selected. It is also called a pick list. It can be in the form of a pop-up window, a form, or even a dialog box.
Advantages:
1. They allow the selection of multiple items from the given list of items using shift or control key from the keyboard.
2. Better to use when you don't want the user to modify the data mentioned in the list.
Disadvantages:
1. If the list is too large, scrolling might make you miss a few items from the list.
2. Screen space is consumed by opening a list.
3. The unordered list makes it hard to find the items.
4. Predictive or auto text is not allowed.
5. There is no text box to search for the item from a long list.
6. The selected item in the list cannot be modified.
When to use a list box:
Guidelines:
===================================================
B. Difference between a pretest and posttest Do...loop statement:
Pretest do...loop:
Pretest means the condition is tested pre-execution. If the condition is true, statements inside the loop will execute else statements will never execute.
Posttest do...loop:
Posttest means the condition is tested post-execution. This also means that statements inside the loop are executed at least once even if the condition is false.
Pseudocode for pretest do...loop:
i=1
do while i<3
print "how are you"
i=i+1
⇒ Here, it is tested whether ‘i’ is less than ‘3’ since the condition is true, the statement “how are you” will be printed. And then the value of ‘i’ is incremented by ‘1’. It is checked again and the statement is printed again until the value of ‘i’ becomes ‘3’ in which case statement will not be executed.
Pseudocode for posttest do...loop:
i=1
do
print "how are you"
i=i+1
while i==0
⇒ Here, “how are you” is printed first and then the value of ‘i’ is checked whether it is ‘0’, the condition is not true hence the loop will terminate. However, the loop statement is executed the first time even when the condition is never true.
Different between pretest and posttest loops:
1. Condition is checked at the very beginning of the loop in the pretest do loop whereas condition is checked at the very end of the loop in the posttest do loop.
2. In the pretest do...loop, if the condition is false for the first time, loop statements will never execute. Whereas in the posttest do...loop, statements will be executed at least once even if the condition is never true.
=====================================================
C. Infinite loop:
Infinite loop refers to the code which has no end or exit. This makes it repeat itself infinitely. For conditional programs, if a condition is never true, it may cause infinite execution of the program.
Avoiding an infinite or endless loop:
Example of infinite loop
a=1
if a==1
print "Welcome to programming"
In above program, value of 'a' is always 1, which will make the statement inside if block execute infinitely.
=====================================================
A. What are the advantages and disadvantages of the list box? when should a list box...
Repetition 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. What is the difference between a pretest and posttest Do...loop statement? give an example of each loop using pseudocode. What is 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.
What is Border Gateway protocol ? When should it be used and what are its advantages and disadvantages compared to other routing protocols?
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...