Answer:
Multiprocessing.
Explanation:
In multiprocessing the system uses two or more processors to do more tasks simultaneously.
Answer:
TAX_RATE = 0.20
STANDART_DEDUCTION = 10000.0
DEPENDENT_DEDUCTION = 3000.0
gross_income = float(input("Enter the gross income: "))
number_of_dependents = int(input("Enter the number of dependents: "))
income = gross_income - STANDART_DEDUCTION - (DEPENDENT_DEDUCTION * number_of_dependents)
tax = income * TAX_RATE
print ("The income tax is $" + str(round(tax, 2)))
Explanation:
Define the <em>constants</em>
Ask user to enter the <em>gross income</em> and <em>number of dependents</em>
Calculate the <em>income</em> using formula (income = gross_income - STANDART_DEDUCTION - (DEPENDENT_DEDUCTION * number_of_dependents))
Calculate the <em>tax</em>
Print the <em>tax</em>
<em />
round(number, number of digits) -> This is the general usage of the <em>round</em> function in Python.
Since we need <u>two digits of precision</u>, we need to modify the program as str(<u>round(incomeTax, 2</u>)).
Answer:
Consider the following code.
Explanation:
save the following code in read_and_interp.m
function X = read_and_interp(s)
[m, n] = size(s);
X = zeros(m, 1);
for i = 1:m
if(str2num(s(i, 2:5)) == 9999)
% compute value based on previous and next entries in s array
% s(i, 2:5) retrieves columns 2-5 in ith row
X(i,1) = (str2num(s(i-1 ,2:5)) + str2num(s(i+1,2:5)))/2;
else
X(i,1) = str2num(s(i,2:5));
end
end
end
======================
Now you can use teh function as shown below
s = [ 'A' '0096' ; 'B' '0114' ; 'C' '9999' ; 'D' '0105' ; 'E' '0112' ];
read_and_interp(s)
output
ans =
96.000
114.000
109.500
105.000
112.000
Answer:
-6.4
Explanation:
just divide -32 by 5 and you will get your answer of -6.4
Answer:
it is called a dotted half note