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.
10
Output
Multiple lines containing an integer.
9
7
5
3
1
The 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·9
Output
A line containing an integer.
3
Remember the game of FizzBuzz from the last time? Well, I thought of some changes in the game, and also with the help of loops as well. Firstly, you'll be asking for a random integer and then loop from 1 until that integer. Then, implement these conditions in the game:
print "Fizz" if the number is divisible by 3
print "Buzz" if the number is divisible by 5
print "FizzBuzz" if the number is divisible by both 3 and 5
print the number itself if none of the above conditions are met
Input
A line containing an integer.
15
Output
Multiple lines containing a string or an integer.
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
No one likes homework, but your math teacher has given you an assignment to find the sum of the first N numbers.
Let’s save some time by creating a program to do the calculation for you!
Take a number N as input and output the sum of all numbers from 1 to N (including N).
Sample Input
100
Sample Output
5050
Explanation: The sum of all numbers from 1 to 100 is equal to 5050.
You are given three numbers. Check if any of the numbers exist in the range from 10 to 20 (including 10 and 20).
input is
2
4
6
output should be
false
by CodeChum Admin
Two strings are called anagrams, if they contain the same characters, but the order of the characters may be different.
Given a string consisting of lowercase letters and question marks, s1, and another string consisting of lowercase letters, s2, determine whether these two strings could become anagrams by replacing each ? character in s1 with a letter.
Input
1. First string
Constraints
Contains only lowercase letters and/or question marks
2. Second string
Constraints
Contains only lowercase letters
Output
The first line will contain a message prompt to input the first string.
The second line will contain a message prompt to input the second string.
The last line contains the message "anagram" if the strings could become anagrams by replacing all the ? characters of s1 with letters and "false" otherwise.