Answer:
The pseudocode is as follows:
Input num1, num2
input operator
print num1 + num2
print num1 - num2
print num1 * num2
if num2 != 0
print num1 / num2
else
print "Cannot divide by 0"
Explanation:
This gets input for both numbers
Input num1, num2
This gets input for the operator
input operator
This prints the sum
print num1 + num2
This prints the difference
print num1 - num2
This prints the product
print num1 * num2
This prints the division if the divisor is not 0
<em>if num2 != 0</em>
<em> print num1 / num2</em>
<em>else</em>
<em> print "Cannot divide by 0"</em>
<em />
Step 1: Identifying a Problem.
2
Step 2: Reviewing the Literature.
3
Step 3: Specifying a Purpose and Research Questions. Writing purpose statements, research questions, and hypotheses provide critical direction to an educational research study. ...
4
Step 4: Designing a Study.
ecu
Answer:
In Python:
def sumLastPart(n,thelist):
sumlast = 0
lent = len(thelist)
lastN = lent - n
for i in range(lastN,lent):
sumlast+=thelist[i]
return sumlast
Explanation:
This defines the function
def sumLastPart(n,thelist):
This initializes the sum to 0
sumlast = 0
This calculates the length of the list
lent = len(thelist)
This calculates the index of the last n digit
lastN = lent - n
This iterates through the list and adds up the last N digits
<em> for i in range(lastN,lent):</em>
<em> sumlast+=thelist[i]</em>
This returns the calculated sum
return sumlast
Answer:
30 units of Food A and 45 units of Food B are to be purchased to keep costs at the minimum $105.
Explanation:
X = Amount of food A
Y = Amount of food B
Z= 2X+Y..... minimum cost equation
50X + 20Y > 2400 .................Vitamins .......(1)
30X + 20Y > 1800 ...................Minerals.......(2)
10X + 40Y > 1200 .................Calories ..........(3)
X > 0
y > 0
X=30 and Y = 45
Z= 2(30) + 45 = $105