Author: admin
Home > Articles posted by admin (Page 6)
Question 1:
Continue modify the program we made in the class:
create Energy class. A new energy crystal object will be created when the enemy spaceship explode
use spritecollide to let the fighter collect energy crystals, if the energy crystal is collected, the score will increase
Question 2:
Modify...
Question 1(Graph/Floyd):
Consider yourself lucky! Consider yourself lucky to be still breathing and having fun participating in this contest. But we apprehend that many of your descendants may not have this luxury. For, as you know, we are the dwellers of one of the most polluted...
Question 1:
Create a Python class Person with attributes: name and age of type string.
Create a display() method that displays the name and age of an object created via the Person class.
Create a child class Student which inherits from the Person class and which also has a section attribute.
Create a method displayStudent()...
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...