Author: admin
Home > Articles posted by admin (Page 174)
Posted at 00:33h
in
archives
by admin
Question:
Please write a program using function. Each player in a tournament plays six games. There are no ties. The tournament director places the players in groups based on the results of games as follows:
if a player wins 5 or 6 games, they are placed...
Posted at 00:29h
in
Uncategorized
by admin
Problem DescriptionAnna and Jack are playing a game.
Each player starts with 100 points. The game uses standard six-sided dice and is played in rounds. During one round, each player rolls one die. The player with the lower roll loses the number of points shown on...
Question 1:
Create a Tank object which have the attributes of:
name
direction(up/down/left/right)
x position and
y position
The object also have a method:
move (direction, steps)
Using __init__ to Initial the tank to make sure it start from x position of 0 and y position of 0
Use print(tank...
Posted at 00:23h
in
Uncategorized
by admin
Question:
You’re on a long car trip and arrive at a gas station. It’s 200 km to the next station. Write a program to figure out if you need to buy gas here, or if you can wait for the next station.
The program should ask these questions, Input Sample:
How...
Posted at 00:16h
in
Uncategorized
by admin
Problem Description
Here at the Concerned Citizens of Commerce (CCC), we have noted that telemarketers like to use seven-digit phone numbers where the last four digits have three properties. Looking just at the last four digits, these properties are:
the first of these four digits is...
Problem Description
Here at the Concerned Citizens of Commerce (CCC), we have noted that telemarketers like to use seven-digit phone numbers where the last four digits have three properties. Looking just at the last four digits, these properties are:
the first of these four digits is...
Posted at 00:09h
in
Uncategorized
by admin
Question :
You are trying to destroy the enemy spaceship which is protected by the energy shell. However, you only have 2 missiles left. Each missile can cause a random damage between 1 to 150. Assume the enemy’s energy shell can provide 100 protection. Write a...
Posted at 00:03h
in
Uncategorized
by admin
Question:
A store is having a sale. They’re giving 2 dollars off purchases of $10 or lower, and 3 dollars off purchases of greater than $10. Write a program that asks the purchase price and displays the final price....
Problem DescriptionAnna and Jack are playing a game.
Each player starts with 100 points. The game uses standard six-sided dice and is played in rounds. During one round, each player rolls one die. The player with the lower roll loses the number of points shown on...
Posted at 05:13h
in
Uncategorized
by admin
Modify the program we made in the class:
if your spaceship touched the enemy, or the bullet, the game over and return back the the start screen.
...