Posted at 01:41h
in
Uncategorized
by admin
Question 1:
Factorial of any number n is represented by n! and is equal to 1*2*3*….*(n-1)*n. for example:
4! = 1*2*3*4 = 24
3! = 3*2*1 = 6
2! = 2*1 = 2
Also,
1! = 1
0! = 1
Write a program to calculate factorial of a given number.
Question 2:
Create a loop...
Question:
The International Standard Book Number (ISBN) is a 13-digit code for identifying books. These numbers have a special property for detecting whether the number was written correctly.
The 1-3-sum of a 13-digit number is calculated by multiplying the digits alternately by 1’s and 3’s (see example)...
Posted at 01:39h
in
Uncategorized
by admin
Problem Description
Suppose we have a number like 12. Let’s define shifting a number to mean adding a zero at the end. For example, if we shift that number once, we get the number 120. If we shift the number again we get the number 1200....
Question:
In a card game, each player’s hand is made up of 13 cards. Each hand has a total point value determined by the number of cards that have a point value. The cards which are worth points are the Ace (4 points), King (3 points),...
Posted at 05:15h
in
Uncategorized
by admin
Question 1:
We have learn how to make the picture bounce from left to right and right to left. Please make change of the program we made in the class to make the picture bounce up and down as well.
Hint: We made a variable named ‘xspeed’ to...
Posted at 05:09h
in
archives
by admin
Question:
The general problem of balancing and nesting different kinds of opening and closing symbols occurs frequently. Strings of symbols such as
{ { ( [ ] [ ] ) } ( ) }
[ [ { { ( ( ) ) } } ] ]
[ ] [ ]...