Question:
Problem DescriptionYou might be surprised to know that 2013 is the first year since 1987 with distinct digits. The years 2014, 2015, 2016, 2017, 2018, 2019 each have distinct digits. 2012 does not have distinct digits, since the digit 2 is repeated.
Given a year, what...
Posted at 01:41h
in
Uncategorized
by admin
Question:
Please write a program using function. Each player in a tournament plays six games. There are no ties. The tournament director places the players in groups based on the results of games as follows:
if a player wins 5 or 6 games, they are placed...
Posted at 01:36h
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...
Posted at 01:32h
in
archives
by admin
Question 1:
Input a string using scanner and count the number of vowels and consonants in the string.
[assume there are no capital letters in the string]
Question 2:
Input a string using scanner and remove all the vowels from the string
Sample Input 1
abcd
Sample Output 1
bcd
Sample Input 2
apple
Sample Output...
Posted at 01:28h
in
Uncategorized
by admin
Question:
Write a program to ask the user for five names. The program should store the names in a list, and print them all out at the end. It should look something like this:
Sample input:
Enter 5 names:
Tony
Paul
Nick
Michel
Kevin
Sample output:
The names are Tony, Paul, Nick, Michel, Kevin
Hint:
You can...
Question 1
add character k
In this question add a character k after each character of a string
Input
abcd
Output
akbkckdk
Question 2
Input a string using scanner and print the reverse of that string
Input
abc
Ouput
cba...