Answer:
weight_pounds=float(input("Enter the weight in pounds:\n"))#taking input of weight.
height_inches=float(input("Enter the height in inches:\n"))#taking input of thye height.
bmi=(weight_pounds/(height_inches**2))*703#calculating the bmi.
print('The body mass index is '+str(bmi))#printing the result.
Ouput:-
Enter the weight in pounds:
207.8
Enter the height in inches
:
72
The body mass index is 28.163395061728398
Explanation:
The above written program is in python.First I have taken input from the user of the weight in pounds then taking input of the height in inches.Then calculating the bmi and storing it in the variable bmi.Then printing the bmi in the end.
Answer:
<em>addpath C:\Program Files\MATLAB\ToolBoxes-20181106T221851Z-001\ToolBoxes\SPM\spm12</em>
<em>savepath</em>
Explanation:
The error clearly indicates that the SPM is missing and is not properly installed. In order to correct this, the following commands are required to be run in the command line of the MATLAB.
These commands will do following.
The first command is the addpath, this will add the path of the toolboxes in the working directory path of the MATLAB
<em>addpath C:\Program Files\MATLAB\ToolBoxes-20181106T221851Z-001\ToolBoxes\SPM\spm12</em>
The second command is the savepath, this will save the additional added path of the working directory for future use.
<em>savepath</em>
Wide Area Network also known as WAN
This would be copy and paste.
When you select a text, you can use your keys CTRL and C to copy that same selected text. After this, you can use the paste feature by selecting CTRL and V. Doing this, your selected text will be copied and pasted to a certain location.
Answer:
The solution code is written in Python 3:
- def modifyList(listNumber):
- posCount = 0
- negCount = 0
-
- for x in listNumber:
- if x > 0:
- posCount += 1
- else:
- negCount += 1
-
- if(posCount == len(listNumber)):
- listNumber.append(max(listNumber))
-
- if(negCount == len(listNumber)):
- listNumber.append(min(listNumber))
-
- print(listNumber)
-
- modifyList([-1,-99,-81])
- modifyList([1,99,8])
- modifyList([-1,99,-81])
Explanation:
The key step to solve this problem is to define two variables, posCount and negCount, to track the number of positive value and negative value from the input list (Line 2 - 3).
To track the posCount and negCount, we can traverse through the for-loop and create if else statement to check if the current number x is bigger than 0 then increment posCount by 1 otherwise increment negCount (Line 5- 9).
If all number in the list are positive, the posCount should be equal to the length of the input list and the same rule is applied to negCount. If one of them happens, the listNumber will append either the maximum number (Line 11 -12) or append the minimum number (Line 14-15).
If both posCount and negCount are not equal to the list length, the block of code Line 11 -15 will be skipped.
At last we can print the listNumber (Line 17).
If we test our function using the three sets of input list, we shall get the following results:
[-1, -99, -81, -99]
[1, 99, 8, 99]
[-1, 99, -81]