Global variables make a program difficult to debug because any statement in a program file can change the value of a global variable. If you find that the wrong value is being stored in a global variable, you have to track down every statement that accesses it to determine where the bad value is coming from. Algorithm Workbench 1. Design a
Why do global variables make a program difficult to debug? Any statement in a program can change the value of a global variable. To find where a bad value is coming from, a programmer would have to track down every statement that has access to that variable. Algorithm Workbench 1. Design a module named timesTen.
When the module is called, it should display the product of its argument multiplied times 10. Module main() timesTen() Module timesTen Dim Result As Integer Set result = value * 10 Console.ReadLine() End Module 5. Design a module named getNumber, Which uses a reference parameter variable to accept an Integer argument. The module should prompt the user to enter a number and then store the input I the reference parameter variable. 6.
These branches can be divided into two categories which are unconditional and conditional. Unconditional branching allows the programmer to move specific parts of the code when the situation calls for it. Conditional branching allows the programmer to devise logical diversions in a program flow based on certain criteria (i.e. IF, SWITCH, LOOP). Branching is controlled by structures that allow the flow of execution to jump to a different part of the program.
What Happens when you give the following commands if the file named done already exists? $ cp to_do done * Done is overwritten with contents of ‘to_do’ $ mv to_do done * to_do no longer exists after the command 4. How can you find out which utilities are available on your system for editing files? Which utilities are available for editing on your system? * You can use which and whereis to locate the utility and locate to search for files.
Then the shell displays another prompt and you can enter another command. When the background job finishes running, the shell displays a message giving both the job number and the command line used to run the command. To see the PID numbers type: ps 4. Assume that the following files are in the working directory: $ ls intro notesb ref2 section1 section3 section4b notesa ref1 ref3 section2 section4a sentrev Give commands for each of the following, using wildcards to express filenames with as few characters as possible. a.
If two objects have been instantiated from the class, how many copies of the static data member exist? (Points : 2) 3 6 2 1
12. What has happened to the primary partitions and logical drives that you created earlier in this lab? After converting disk 0 to Dynamic only one primary partition is present.Alice2 and Alice 3 are no longer primary partitions. And Graphical display for disk volumes changes color. 13.
9. Discuss how reverse lookup zones can be configured. 10. Demonstrate how to configure an In-addr.arpa zone. Stub Zones 1.
Set up your PATH variable so that it causes the shell to search the following directories in order: • /usr/local/bin • /usr/bin/Xl1 • /usr/bin • /bin • /usr/kerberos/bin • Your own bin directory (usually bin or .bin in your home directory) • The working directory b. If a file named doit is in /usr/bin and also in your ~/bin, which one doit will be executed? (Assume that you have execute permission for both of the files.) c. If your PATH variable is not set to search the working directory, how can you execute a program located there? d. Which command can you use to add the directory /user/games to the end of the list of directories in your PATH?