Monday 17:30 Homework
																	
																												 Home > Monday 17:30 Homework (Page 2)  
																										 
								                                                             
						 
					 
				 
								 
			 
		
        		
							
						
			
								
					
						
						
						
Question:
Modify the program we made in the class. Add starting screen as below, the real game will start when play click the mouse in the range of the “PLAY” button. (Scroll down for more hint)
You can choose and download one of the background images base...
						
					 
				 
			 
		
		
					
			
								
					
						
						
						
Question:
Make changes of the program by creating Enemy class, so we can create an enemy object in the main program, the enemy spaceship could complete the following tasks:
 	the enemy could appear at the top of the screen and bounce back and forth when it...
						
					 
				 
			 
		
		
					
			
								
					
						
						
						
Question:
We have learned how to make the pirate ship bouncing left and right, try the following:
How to make the pirate ship move and  bounce diagonally when it reaches the edge ( the pirate ship image is 200px by 166px)
...
						
					 
				 
			 
		
		
					
			
								
					
						
						
						
Question 1:
Draw the following picture in the pygame window: (could be different color)
Hint: using pygame.draw.circle
Question 2:
Draw below image using pygame. (could using different color)
...
						
					 
				 
			 
		
		
					
			
								
					
						
						
						
Question:
 	Write a Rectangle class in Python language, allowing you to build a rectangle with length and width attributes.
 	Create a Perimeter() method to calculate the perimeter of the rectangle and a Area() method to calculate the area of the rectangle.
 	Create a method display() that display the length, width, perimeter and area of an object created...
						
					 
				 
			 
		
		
					
			
								
					
						
						
						
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:
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...
						
					 
				 
			 
		
		
					
			
								
					
						
						
						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:
You are given a string . Suppose a character ‘a’ occurs consecutively n times in the string. Replace these consecutive occurrences of the character ‘a’ with (n, ‘a’) in the string.
Input Format:  A single line of input consisting of the string .
Output Format: A single line of...
						
					 
				 
			 
		
		
					
			
								
					
						
						
						Question:
Write a function luckySum(a, b, c) to calculate sum of given 3 int values, a b c. The function will have a return value of their sum. However, if one of the values is 13 then it does not count towards the sum and values to its...