Programming flag variables are used in programs for remembering states or conditions. What are the two best data types to use for flags? Give an example of a flag that remembers if a value is negative, zero or positive.
What will be an ideal response?
Program flags are usually Boolean or integer, and sometime chars. The two best are bools and ints. If a program had to remember if a value was positive, negative or zero, you’d need to use an integer value or char. If you used an int you could set the value to –1, 0, or +1. If you used a char you could use the letters ‘p’, ‘z’, or ‘n’.
You might also like to view...
Declare a string constant named ErrorMessage and initialize it to "Input error - program exiting"
What will be an ideal response?
Prepare a memo to your supervisor explaining why it is important to run encryption on your wireless network.
What will be an ideal response?
Under a ________ placement strategy, the system places an incoming job in the hole in main memory in which it fits most tightly.
a) first-fit b) next-fit c) best-fit d) worst-fit
Word provides preformatted cover pages on the ________ tab
Fill in the blank(s) with correct word