Author: admin
Home > Articles posted by admin (Page 186)
Posted at 02:59h
in
Uncategorized
by admin
Question:
We often include emoticons in our text messages to indicate how we are feeling. The three consecutive characters :-) indicate a happy face and the three consecutive characters :-( indicate a sad face. Write a program to determine the overall mood of a message.
Input Specification
There will...
Posted at 14:08h
in
Uncategorized
by admin
Question:
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 years...
Question:
Troy loves triangles. He especially likes counting triangles. He has an N-by-N grid consisting of either “.” or “#” characters. Help him count the number of triangles formed only by “#” characters in the grid. Triangles are of the form
More formally, a triangle of height h...
Posted at 04:03h
in
Uncategorized
by admin
Question:
Troy loves triangles. He especially likes counting triangles. He has an N-by-N grid consisting of either “.” or “#” characters. Help him count the number of triangles formed only by “#” characters in the grid. Triangles are of the form
More formally, a triangle of height h...
Posted at 02:40h
in
Uncategorized
by admin
Question:
Create a loop between 1 to 20.
Print “fizz” if the number is divisible by 3
Print “bizz” if the number is divisible by 5
Print “fizzbizz” if a number is divisible by both 3 and 5.
Otherwise, print the number itself.
...
Posted at 20:45h
in
Uncategorized
by admin
Question:
Problem Description
You are trying to pass the time while at the optometrist. You notice there is a grid of four numbers:
1
2
3
4
You see lots of mirrors and lenses at the optometrist, and wonder how flipping the grid horizontally or vertically would change the grid. Specifically, a...
Posted at 14:54h
in
Uncategorized
by admin
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:
You probably used a for loop in your program in last homework. That’s how most people would do...
Posted at 03:38h
in
Uncategorized
by admin
Question 1
We are going to continue to work on the 'hero.db' database. Since we have already created a table called "heroes" in the database, we are going to add 2 more records in the table "heroes":
Field
name
hero_level
int_growth
agi_growth
str_growth
hero_int
hero_agi
hero_str
New record 1
Hercules
1
3.6
6
9.9
270
150
140
New record 2
Blade
1
10
18.5
14.5
40
28
39
Question 2:
From all the records in...
Posted at 01:23h
in
Uncategorized
by admin
Question:
A soccer team is looking for girls from ages 10 to 12 to play on their team. Write a program to ask the user’s age and if male or female (using “m” or “f”). Display a message indicating whether the person is eligible to play on the team....
Posted at 03:27h
in
Uncategorized
by admin
Question:
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 =...