if input is rock, paper two player are plaing hand game how to write a program You can approximate n by using the following summation:
n=4(1 - 1/3 + 1/5 - 1/7 + 1/9 - 1/11 + ..... + (-1)i + 1/2i - 1
Write a program that displays the n value for i = 10000, 20000, … and 100000.
Program Output:
3.1414926535900345
3.1415426535898248
3.141559320256462
3.1415676535897985
3.1415726535897814
3.141575986923102
3.141578367875482
3.1415801535897496
3.1415815424786238
3.1415826535897198
Radioactive decay of radioactive materials can be modeled by the equation
A=A0e–t(In2/h), where
A is the amount of the material at time t, A0 is the amount at time 0, and h is the half-life.
Technetium-99 is a radioisotope that is used in imaging of the brain. It has a half-life of 6 hours.
Your program should display the relative amount A/A0 in a patient body every hour for 24 hours after receiving a dose.
Note:
With the aid of formatting techniques documented in your note, ensure your program output matches that given below.
Program Output
1: 0.890899
2: 0.793701
3: 0.707107
4: 0.629961
5: 0.561231
6: 0.500000
7: 0.445449
8: 0.396850
9: 0.353553
10: 0.314980
11: 0.280616
12: 0.250000
13: 0.222725
14: 0.198425
15: 0.176777
16: 0.157490
17: 0.140308
18: 0.125000
19: 0.111362
20: 0.099213
21: 0.088388
22: 0.078745
23: 0.070154
24: 0.062500
Write an algorithm that creates a program that allows bags to be purchased. There are six different types: full decorative, beaded, needlepoint design, fringed beaded and plain. Create a ListBox object for the different styles. After the user makes a selection, display a message indicating which selection was made. Include an option to clear selections. Include a control that allows the user to enter the quantity desired. Include a set of radio buttons that contain shipping options of overnight, three day and standard. The price for each bag is as follows: full decorative R50; beaded – R45; needlepoint design – R40, fringed beaded – R30 and plain – R20. The shipping charges are based on the total purchase. The following percentages are used: Overnight – 10%, three day – 7% and standard – 5%. Display in a message box the shipping charge along with the selection, quantity and total cost.
write a program to read the mobile number in human form. The 10 digit mobile number should be divide into 4-3-3 format . If it has continues 4 numbers it should be pronounced as quadruple , 3 numbers as thriple , 2 numbers as double.
input:- 9977222208
Here system should divide itself in 4-3-3 format like 9977 222 208
output: double nine double seven thriple two two zero eight
input:- 1111999228
output:- quadruple one thriple nine double two eight
write an algorithm that Create a program that allows bags to be purchased. There are six different types: full decorative, beaded, needlepoint design, fringed beaded and plain. Create a ListBox object for the different styles. After the user makes a selection, display a message indicating which selection was made. Include an option to clear selections. Include a control that allows the user to enter the quantity desired. Include a set of radio buttons that contain shipping options of overnight, three day and standard. The price for each bag is as follows: full decorative R50; beaded – R45; needlepoint design – R40, fringed beaded – R30 and plain – R20. The shipping charges are based on the total purchase. The following percentages are used: Overnight – 10%, three day – 7% and standard – 5%. Display in a message box the shipping charge along with the selection, quantity and total cost.
given a sentence , swap the occurrences of the most frequent letter which the least frequent letter and vice-versa. note : .consider upper and lower case letters as different. if there are multiple letters with the same frequency , choose the lowercase letters that comes earliest in dictionary order. if letter like S and B have same frequency consider X. if letter like X and b have same frequency consider b.?
in the example the sentence is Nice Day.
the previous letter of N is M, similarly replace each letter with the previous letter
N i c e D a y
M h b d C z x
so the output should be Mhbd Czx
sample input 1
Nice Day
sample output 1
Mhbd Czx
sample input2
Be good and do good
sample output2
Ad fnnc zmc cn fnnc
in the example there are 6 numbers 1,-2,3,-4,-5,6
the negative numbers in the given list are -2,-4 and -5 where the -2 is replaced with corresponding last positive number encountered which is 1.similarly -4 and -5 are replaced with 3
so the output should be 1 1 3 3 3 6
sample input1
1 -2 3 -4 -5 6
sample output1
1 1 3 3 3 6
sample input2
1 11 -13 21 -19
sample output2
1 11 11 21 21
Yup are given a space separated list of integers as input,write a program to replace all non positive numbers in a list with the last positive number encountered