Author: admin
Home > Articles posted by admin (Page 12)
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:
In order to train Jason’s sense of direction, Gordon built a big castle with N rooms (N<=10000) and M channels (M<=100000). Each channel is one-way, that is, if you say a certain channel connects from room A to room B. It only means that room A can reach room...
Question:
A fish-finder is a device used by anglers to find fish in a lake. If the fish-finder finds a fish, it will sound an alarm. It uses depth readings to determine whether to sound an alarm. For our purposes, the fish-finder will decide that a...
Question:
You and a friend are playing the classic game of Battleships. You each have a grid consisting of M rows of N cells (1≤N,M≤2000). Each cell is either empty or contains a player’s ship (in this version of the game, all ships are the size...
Question 1:
Write a program to help you feed your friends at a party by doing some math about square pizzas. Your program need use input to ask the side length of the square pizza in cm. The area of the pizza should be computed using...
Question:
The Body Mass Index (BMI) is one of the calculations used by doctors to assess an adult’s health. The doctor measures the patient’s height (in meters) and weight (in kilograms), then calculates the BMI using the formula:
BMI = weight / (height * height)
Write a program...
Question:
Modify the program we made in the class. Create a Boss Class
the __init__() method will take three parameters (imgFile, location and speed)
the update() method will move the object, if the top of the object reaches the bottom of the screen, it will disappear...
Question:
Thinking how to add space stations as background when score reaches 200 as level 2?
...
Question:
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:
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...