arunkumarak

arunkumarak

Lv4

Arun Kumar

0 Followers
0 Following
0 Helped

ANSWERS

Published58

Subjects

Astronomy44Electrical Engineering3Algebra2Computer Science7Biology2
Answer: Time travel to the past is theoretically possible in certain general r...
Answer: This is a philosophical question that cannot be answered definitively.
Answer: During death, your body's vital functions stop entirely. Your heart no...
Answer: Magnetars are a type of neutron star with an extremely powerful magnet...
Answer: The earth is surrounded by an atmosphere that contains water droplets,...
Answer: Calculation of position and momentum of subatomic particles is not pos...
Answer: It really depends on the context. The universe as a whole is obviously...
Answer: Deja vu is the feeling of having already experienced a moment or a sit...
Answer: GRBs (Gamma Ray Bursts) are among the most powerful explosions in the ...
Answer: No, neutrinos cannot tell if a star is going to die. Neutrinos are par...
Answer: No, artificial intelligence (AI) cannot develop feelings like humans. ...
Answer: There is no single mathematical formula for love as it is an emotion t...
Answer: athematics is considered the language of the universe because it is a ...
Answer: It is possible that death is just the beginning of another form of lif...
Answer: Exploring the oceans is difficult because of the extreme depths, extre...
Answer: One electron theory is a theory that explains the behavior of electron...
Answer: Not everyone is interested in math and space because it requires a cer...
Answer: No, gravity is also affected by the distance between two objects with ...
Answer: Circular motion is necessary for physical existence because it is the ...
Answer: The Sun is represented by the letter G and is considered a G-type main...
Answer:The current version of TACACS is TACACS+ (TACACS Plus). It is an update...
Answer:The MIN function determines the lowest number in a range
Answer: a)how data is generated by end devices applications b)how the connecti...
Answer: ipv6 route ::/0 2001:db8:acad:2::a ipv6 route ::/0 fe80::1 ipv6 route ...
Answer:KB stands for kilobyte and is a unit of measurement for digital data. I...

You will implement two programs in this project that are closely related. The first program is called
ALU. This program accepts three arguments from the command line. Two arguments are numbers
while one argument is one of the operations from ‘+’, ‘-‘, ‘/’,’x’. Your main function should read
these arguments, if the number of arguments is not 3, then your program should return the value -9999
and exit. If number of arguments is 3, then your program should perform the operation between the
two numbers and return the result of the operation.
2. The second program is called CPU. This program will take 1 argument from the command line which
will be a filename. Your program should open this file and read mathematical operations from each
line. Each line of the file will have one number followed by an operation and then a second number. A
sample file is given below.
3 + 6
12 – 4
3 x 10
4 24
3. For each line in the file, your program should fork a child process, in the child process execute the
program ALU and pass it the three values that you read from this line as arguments. Once all lines
have been executed, you will wait for the child ALU processes to finish execution and read the return
values sent by these processes. You will output the result of the operations in a file called math.txt in
the following format
3 + 6 = 9
Page 2 of 2
12 – 4 = 8
3 x 10 = 30
4 24 = not enough arguments
Keep in mind that an operation might produce a floating point exception. For example the
following is not possible mathematically
6 / 0
For operations like this, your program should report the following in the math.txt file
6 / 0 = illegal operation
You should NOT check for the numbers to be zero. You should get the exit status from the “wait”
call and check if the program terminated due to an exception.

Answer: #include <stdio.h> #include <stdlib.h> #include <unistd...
Answer:Assuming that the clock pulse is 10 ns wide, the minimum clock frequenc...
Answer: i. Sketch the output at TP1 and TP2: ii. Analysis of the circuit: The ...
Answer: a) This example demonstrates incomplete dominance, which means that th...
Answer: A. A mutation in the operator site that prevents the lac repressor fro...
Answer: Without supernovas, the universe would be a very different place. Supe...
Answer: Using brain as a cosmic antenna is a concept that scientists have been...
Answer: If all the fundamental particles stopped moving, it would have a huge ...
Answer:At absolute zero kelvin, -273.15 degrees Celsius, all matter reaches it...
Answer:Time dilation is the phenomenon of time passing more slowly for objects...
Answer: The Moon moves at a rate of about 13.2 degrees per day, so it would ta...
Answer:The speed of the Moon's orbit around Earth is approximately 1.02 km/s.
Answer: The Moon's diameter is 2,159 miles. (a) Arc minutes: 0.5 degrees is eq...
Answer: To calculate the time it takes for the Moon to move a distance equal t...
Answer: 50 watts/meter2

Weekly leaderboard

Start filling in the gaps now
Log in