Posted at 23:28h
in
archives
by admin
Question 1:
Input a number using scanner and print the factorial of that number.
E.g. Factorial of 5 is 1 * 2 * 3 * 4 * 5 =120
Question 2:
Create a loop between 1 to 20. Print “fizz” if the number is divisible by 3 and “bizz”...
Posted at 19:44h
in
Uncategorized
by admin
Question 1:
Create a list of numbers between 4 and 40 who are divisible by either 3 or 5
Sample Output:
[6,9,10,12,15,...
Question 1:
Input a string using scanner and print the number of vowels and consonants in the sting.
Sample Input:
bcda
Sample Output:
vowels: 1
consonant : 3
Question 2:
Input a string using scanner and check if the string is a palindrome.
e.g. aba is a palindrome because if you reverse it is...
Posted at 18:07h
in
archives
by admin
Question 1.
Use float() to create a number from a string like '12.34'. Make sure the result is really a number!
Question 2.
Try using int() to create an integer from a decimal number like 56.78. Did the answer get rounded up or down?
Question 3.
Try using int() to create...
Posted at 02:57h
in
Uncategorized
by admin
Question:
Please make some modifications of the program we made in the class. Make ball appears on the top if the ball reaches the bottom, or appears at bottom when the ball reaches the top.
...
Question:
Problem DescriptionA 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...