Posted at 00:20h
in
Uncategorized
by admin
Question 1:(please use function that return a value)
Write a program to display information to a driver based on his/her speed according to the following table:
km/h over the limit
Fine
1 to 20
$100
21 to 30
$270
31 or above
$500
Sample Input 1:
Enter the speed limit: 40
Enter the recorded speed of the...
Posted at 23:40h
in
Uncategorized
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...
Problem Description
Boring is a type of drilling, specifically, the drilling of a tunnel, well, or hole in the earth. With some recent events, such as the Deepwater Horizon oil spill and the rescue of Chilean miners, the public became aware of the sophistication of the...
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...