Author: admin
Home > Articles posted by admin (Page 6)
Question 1:
Write a program that asks the user to enter his/her name, age, favorite color, and favorite food. Have the program save all four items to a text file called myinfo.txt, each one on a separate line.
Question 2:
Write a program that asks the user to enter...
Question 1:
Write a program for a movie theater using while loop. It will keep asking your age and display the ticket price, until you enter “quit”. It is free if you are less than 3 years old, otherwise if your age is less than 16...
Problem Description
In the CCC Word Hunt, words are hidden in a grid of letters. The letters of a hidden word always appear in order on horizontal, vertical, or diagonal line segments in one of two ways. One way is for the letters of a word...
Question:
Create Card class so it can complete the following tasks:
You can initial the card with value.
you can compare two cards' value by method lessThan() and equal()
you can use print(c1) shows the card value
(Assume the smallest card value is 2, then followed by...
Question:
Here is a list for you left just this morning by your parental figure.
Do your Math homework.
Call your grandma.
Call me at work.
Call your friend.
Feed the dog.
Let the dog out.
Watch television.
As well, your parental figure has given you constraints...
Question 1:
Use while loop (NOT for loop) to create the multiplication table program. After asking which table the user wants, ask her how high the table should go. The output should look like this:
Sample Input:
Which multiplication table would you like? 7
How high do you want to go? 12
Sample Output:
Here’s your table:
7...
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:
Thinking how to add space stations as background when score reaches 200 as level 2?
...
Question:
We have learned how to make the pirate ship looping 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:
Use while loop (NOT for loop) to create the multiplication table program. After asking which table the user wants, ask her how high the table should go. The output should look like this:
Sample Input:
Which multiplication table would you like? 7
How high do you want to go? 12
Sample Output:
Here’s your table:
7...