In a process, when we want to read the STDIN
will use READ($IN) , $IN = “the value stored in IN”. Describe what that means and why we need to do that?. can we use different read calls for pipes, devices, and files? explain it
$IN is a variable which stores the name of the file for your program. The program when executed, becomes a process and uses the value stored by the variable through user input and works on that file.
We need to do that because the file name is as per the user. We cannot hard-code a file name because the program has to be made generic to run on all files given as input. That's why we need a variable.
Yes. Depends on the language you are programming in. In some languages you can store different file pointers for pipes, devices and files in different variables. In some, you have to close the current file before opening another.
In a process, when we want to read the STDIN will use READ($IN) , $IN =...
Suppose we want to read in a file called "input.txt". We can do the following. File f = new File(input.txt); Scanner s = new Scanner (f); ... We know that Scanner constructor will throw a FileNotFoundException when the file does not exist. Since we already created a file object "f", the file does exist. So why do we need to either throw the exception or do try/catch block to in order to have the program continue? Thanks.
Iterating over a 2D array If we want to visit or process every element of a 2D array, we need a nested for loop to do it. Generally, when you iterate over a 2D array, you want to do it in row major order, because this is more memory efficient. The reason why is that adjacent elements in a row are stored contiguously (one after another) in memory. Another reason, for an English speaker, is that this is the same...
Suppose we want to read k blocks that are randomly placed/stored in a disk cylinder i. These blocks could be on the same surface or different surfaces of cylinder i. Determine, on average, how far around the track must we go to read these k blocks.
Elimination Reactions Prelab Date 1. Explain why we get a different product when we use bulky bases compared to smal bases. (3 pts) 2. If we start with 25.0 mL of 0.100 M sodium methoxide and 25.0 g of 2-bromobutane, what will be the theoretical yield of your product? (Use dimensional analysis/ Do not break up your steps/Read the beginning of your lab to guide you on how to do this problem). (3 pts) 3. How can one determine which...
Round 1: sequence.c This program should read and execute a list of commands from stdin. Each command and its arguments (if any) will appear on a separate line. For example, if the file "cmdfile" contains the lines: whoami cal 4 2019 echo The time is: date then running 1 /sequence< cmdfile should output your username, a calendar of the month of April, the string "The time is:", and the current date/time, to standard output. Suggested approach: first, make sure you...
C#
QUESTION 36 Why do we want to use polymorphism when developing good Object Oriented solutions? One function call can have many different results, depending on the data type being sent in Prevents a developer from having to write many if statements to catch the different data types O Allows for cleaner and simpler code because we only use one function name with different signatures All of the above None of the above QUESTION 37 If my class PassTest implemented...
4. A nickel plating process has trouble with consistency of the plating thickness. We want to use design of experiment to improve the process. Our target plating thickness is 116 micrometers The process variables that we can test are t (Time) and T (solution temperature). We want to find t and T that minimize the variance in thickness. The results of a two-level, two-factor set of experiments are: t-plating time in seconds T- solution temperature in degrees C P- plate...
When we are talking about medications, why do we want to use statin medications, what part of cholesterol will it lower? What about coumadin therapy, what types of food should patients limit/avoid?
1. When do we use an independent groups t-test? a. b. c. d. When we are comparing means from one sample that has been measured twice. When we are comparing means from two different samples. When we are comparing a sample mean to a population mean. When we are comparing two population means. 2. Which of the following is true regarding the use of t-tests for true experiments versus quasi-experimental designs? a. b. We use the same t-test whether it...