A/an_______ is a list of all the possible outcomes of a random variable and their associated probabilities of occurrence.
Select one:
a. uniform distribution
b. binomial distribution
c. exponential distribution
d. probability distribution
Write a program using standard string functions that
accepts a price of an item and display its coded value. The
base of the key is:
X C O M P U T E R S
0 1 2 3 4 5 6 7 8 9
Solve on paper, do rough work on the same paper.
Reverse Alternate Words in Sentence
Given a sentence, write a program to reverse the alternate words in the sentence and print it.
Reverse the first word and respective alternative words.
The input will be a single line containing a sentence.
The output should be a single line containing the sentence with the alternate words reversed.
For example, if the given sentence is
Sun rises in the east and sets in the west The alternate words which need to be reversed are (Sun, in, east, sets, the), by reversing these words the output should be nuS rises ni the tsae and stes in eht west
Sample Input 1
Sun rises in the east and sets in the west
Sample Output 1
nuS rises ni the tsae and stes in eht west
Sample Input 2
The car turned the corner
Sample Output 2
ehT car denrut the renroc
Question 2 - Do it on computer, do any rough work required on paper.
a) Make a class with name as your university registration ID e.g. class F20200657890, with the following members:
b) Write main for the class, to demonstrate constructing two objects and using each of the member functions at least once. If you miss using any single function you lose some marks.
Given two polynomials A and B, write a program that adds the given two polynomials A and B.
The first line contains a single integer M.
Next M lines contain two integers Pi, Ci separated with space, where Pi denotes power and Ci denotes co-efficient of Pi for polynomial A.
After that next line contains a single integer N.
Next N lines contain two integers Pj, Cj separated with space, where Pj denotes power and Cj denotes co-efficient of Pj for polynomial B.
If M = 4 and for polynomial A
For power 0, co-efficient is 5
For power 1, co-efficient is 0
For power 2, co-efficient is 10
For power 3, co-efficient is 6.
Then polynomial A represents "6x^3 + 10x^2 + 5", the polynomial B represents "4x^2 + 2x + 1" and the addition of A and B is "6x^3 + 14x^2 + 2x + 6"
sampel input 1
4
0 5
1 0
2 10
3 6
3
0 1
1 2
2 4
output
6x^3 + 14x^2 + 2x + 6samplel input 2
5
0 -2
3 6
4 7
1 -3
2 -1
5
0 1
1 2
2 -4
3 3
4 5
output
12x^4 + 9x^3 - 5x^2 - x - 1
Please help me rearrange this code again and please correct it. I can't run it. Thank you!
n = int(input())
for i in range(n):
1st = list(map(int,input().split()))
lst1 = lst[1:]
elem = lst1[0]
counter = 1
for j in range (1,len(lst1)):
if 2*elem > lst1[j]:
counter = 0
break
elem = lst1[j]
if counter == 1:
print("Denominations: " lst1)
print("Good coin denominations !")
else:
print("Denominations: " lst1)
print("Bad coin denominations !")
Explain triggers & stored procedures. Why do we use them?
Benefits of triggers & procedures. Syntaxes & example of them.
Secret Message - 2
Given a string, write a program to print a secret message that replaces characters with numbers 'a' with 1, 'b' with 2, ..., 'z' with 26 where characters are separated by '-'.
Note: You need to replace both uppercase and lowercase characters. You can ignore replacing all characters that are not letters.
a b c d e f g h i j
1 2 3 4 5 6 7 8 9 10
k l m n o p q r
11 12 13 14 15 16 17 18
s t u v w x y z
19 20 21 22 23 24 25 26
Input
The input will be a string in the single line containing spaces and letters (both uppercase and lowercase).
Output
The output should be a single line containing the secret message. All characters in the output should be in lower case.
Explanation
For example, if the given input is "python", "p" should replaced with "16", similarly"y" with "25","t" with "20","h" with "8","o" with "15","n" with "14". So the output should be "16-25-20-8-15-14".