Author: admin
Home > Articles posted by admin (Page 20)
Question 1:
Make a class definition for a BankAccount. It should have attributes for :
– its name (a string),
– account number (a string or integer),
– and balance (a float).
It should have methods to:
– make deposits with displaying the balance,
– and make withdrawals with displaying the balance.
Hint:
Question 2:
Create...
Question 1:(please use function that return a value)
Write a program to display information to a driver based on his/her speed according to the following table:
km/h over the limit
Fine
1 to 20
$100
21 to 30
$270
31 or above
$500
Sample Input 1:
Enter the speed limit: 40
Enter the recorded speed of the...
Question 1:
Write a program to print a multiplication table (a times table). At the start, it should ask the user which table to print. The output should look something like this:
Sample Input:
Which multiplication table would you like? 5
Sample Output:
Here’s your table:
5 x 1 = 5
5 x 2...
Question 1:
Please use Disjoint Set learned in the class to solve the following question:
There are so many different religions in the world today that it is difficult to keep track of them all. You are interested in finding out how many different religions students in...
Question:
Try to use for loop to create buttons from 1-9, so the tkinter window would display as below:
for i in range(1, 10): col = ____________ row = ____________ btn_num = ____________ btn_num.grid(row=row, column=col)
...
Question 1:Santa Claus is wondering which extra gift(s) he’s going to send out for each kids. Eventually, he is going to use his reindeer to determine which gift(s) to give. There are only 3 types of gifts to give:• Nerf Guns if the reindeer shook...
Question for Linear Search:
Creatnx now wants to decorate his house by flower pots. He plans to buy exactly N ones. He can only buy them from Triracle’s shop. There are only two kind of flower pots available in that shop. The shop is very strange. If you...
Posted at 01:39h
in
archives
by admin
Question:
We have learned infix, prefix and postfix, please write the missing prefix and postfix in the table blow:
infix
prefix
postfix
A+B
+AB
AB+
A+B*C
+A*BC
ABC*+
(A+B)*C
*+ABC
AB+C*
A+B*C+D
++A*BCD
ABC*+D+
(A+B)*(C+D)
A*B+C*D
A+B+C+D
...
Question:
Continue modify the war-robot program we made in the class, so that:
if enemy’s hp is lower or equal to 0, use msgbox to display message ‘you win’, and the while program finish.
it will be the enemy’s turn to strike you back. Enemy can...
Question 1:
Create a Student class and make the following methods to :
__init__() – Initialize it with name and roll number.
__str__() – Display all information of the student.
setAge() – It should assign age to student.
setMarks() – It should assign marks to the...