The work formula measures the multiplication of magnitude of displacement (d), the component of the
orce (F), and the angle (8) between d and F. It can be obtained from the following expression:
W = F x d x cos(0).
Write a program which prompts the user to enter d, F, and 0. Then, calculates W and displays
the computed value for W on the screen. (Notice: You should include all steps and respect the
Python syntax in order to obtain full mark).
• Which Python built-in functions did you use to write this program?
• Which modules in Python did you import? Which functions from the imported modules are
applied in your program?
implement a simple symbolic equation solver. The equation must be stored in a binary tree.Each operand or operator should be stored as a tuple of the form (TYPE, VALUE).Complete the bodies of the insert, and evaluate methods. Include your solution in the sections mentioned as "Include your code here". Please do NOT change any of the code outside of these two methods.
class Node:
def __init__(self, data):
self.left = None
self.right = None
self.data = data
def get_output(self)
value = self.evaluate()
if value > 999:
print('OVERFLOW')
elif value < 0:
print('UNDERFLOW')
else:
print(value)
# Your task is to implement the following methods. #
def insert(self, data, bracketed):
#Include your code here
return self
def evaluate(self):
#Include your code here
pass
in python with algorithm
Create a simple library management system following the set of requirements:
prefix suffix
Write a python program that input account holder Id number, account holder name, account number and account balance. A flat monthly maintenance fee of 0.5% is charge on account balance greater than or equal to 5000. The program should use a function to prompt for and input withdrawal amount, also a 2% bank fee is charge on withdrawal amount. Finally calculate the new balance by deducting the withdrawal amount and the bank fee from the balance. Output the account number, previous balance and current balance.
"Write an input variable for y that accepts a decimal number."
You are required to implement a simple symbolic equation solver. The equation must be stored in a binary tree.
Each operand or operator should be stored as a tuple of the form (TYPE, VALUE).
*the expression stored in the binary tree is“1+(2*3)+3^ 2"*
For example: (OPERAND, 5), (OPERAND, 7), (OPERATOR, '*’').
Following operators should be supported: addition (+), subtraction (-), multiplication (*), and exponentiation .
*Input*
root = Node(('OPERAND', 1))
root = root.insert(('OPERATOR', '+'), False)
root = root.insert(('OPERAND', 2), False)
root = root.insert(('OPERATOR', '*'), True)
root = root.insert(('OPERAND', 3), False)
root = root.insert(('OPERATOR', '+'), False)
root = root.insert(('OPERAND', 3), False)
root = root.insert(('OPERATOR', '^'), False)
root = root.insert(('OPERAND', 2), False)
root.get_output()
*Expected =* 100
(Should be print 100)
Instructions:
Instructions
Input
A line containing an integer.
10Output
Multiple lines containing an integer.
9
7
5
3
1The greatest common divisor, also known as GCD, is the greatest number that will, without a remainder, fully divide a pair of integers.
Now, I want you to make a program that will accept two integers and with the use of loops, print out their GCD. Make good use of conditional statements as well.
Off you go!
Input
A line containing two integers separated by a space.
6·9Output
A line containing an integer.
3