Given polynomial write a prigram that prints polynomial in Cix^Pi + Ci-1x^Pi-1....+C1x+C0 format.sample input:
4
0 5
1 0
2 10
3 6
sample output:
6x^3 + 10x^2 + 5
write a program to check the overlapping of one string's suffix with the prefix of another string
1.Sample input:
ramisgood
goodforall
Sample Output:
good
2.Sample input:
finally
restforall
sample input:
No overlapping
Write a program that rolls a pair of dice until the sum of the number rolled is a specific number. we also want to know the number of times the dice are rolled to get the desired number. the smallest number or each die is 1 and the larges number is 6. so the smallest sum of the numbers rolled is 2 and the largest sum of the numbers rolled is 12. we use the random number generator, to randomly generate a number between 1 to 6.
A. Create a statement that randomly generates a number between 1 to 6 and stores that number into die1, which becomes the number rollled by die1
B. Similarly, create a statement that randomly generates a number between 1 to 6 and that number into die2, which becomes the number rolled by die2.
C. Next, determine whether sum contains the desired sum, then we roll the dice again.
D. Create a method named rolldice that takes as a parameter the desired sum of the numbers to be rolled and returns the number of times the dice are rolled to roll the desired sum.