Answer:
The algorithm constructs are sequence, decision/selection and repetition.
Explanation:
Answer: provided in the explanation section
Explanation:
Given that:
Assume D(k) =║ true it is [1 : : : k] is valid sequence words or false otherwise
now the sub problem s[1 : : : k] is a valid sequence of words IFF s[1 : : : 1] is a valid sequence of words and s[ 1 + 1 : : : k] is valid word.
So, from here we have that D(k) is given by the following recorance relation:
D(k) = ║ false maximum (d[l]∧DICT(s[1 + 1 : : : k]) otherwise
Algorithm:
Valid sentence (s,k)
D [1 : : : k] ∦ array of boolean variable.
for a ← 1 to m
do ;
d(0) ← false
for b ← 0 to a - j
for b ← 0 to a - j
do;
if D[b] ∧ DICT s([b + 1 : : : a])
d (a) ← True
(b). Algorithm Output
if D[k] = = True
stack = temp stack ∦stack is used to print the strings in order
c = k
while C > 0
stack push (s [w(c)] : : : C] // w(p) is the position in s[1 : : : k] of the valid world at // position c
P = W (p) - 1
output stack
= 0 =
cheers i hope this helps !!!
Answer:
d) either e1 or e5
Explanation:
Here, the instruction i1 goes ahead in trying to open the given file through an input stream buffer reader. If the given file name is wrong, it will indicate that an e1 file is not found or if any other IO errors due to invalid stream, no disc in drive e5 IO exception will be drawn.
Baiting clickjacking pharming spamming
Answer:
showProduct(int,double)
for example: showProduct(10,10.5) is the correct answer even showProduct(10,10.0) is also correct but showProduct(10.0,10.5) or showProduct(10,10) or showProduct(10.0,10) are wrong calls.
Explanation:
The code is
- <em>public static void showProduct (int num1, double num2){</em>
- <em> int product;</em>
- <em> product = num1*(int)num2;</em>
- <em> System.out.println("The product is "+product);</em>
- <em> }</em>
showProduct is function which asks for two arguments whenever it is called, first one is integer and second one is of type double which is nothing but decimal point numbers. Generally, in programming languages, 10 is treated as integer but 10.0 is treated as decimal point number, but in real life they are same.
If showProduct( 10,10.0) is called the output will be 'The product is 100'.
Strange fact is that, if you enter showProduct(10,10.5) the output will remain same as 'The product is 100'. This happens because in the 3rd line of code,which is <em>product=num1*(int)num2</em>, (int) is placed before num2 which makes num2 as of type integer, which means whatever the value of num2 two is given, numbers after decimal is erased and only the integer part is used there.
This is necessary in JAVA and many other programming languages as you <u>cannot</u><u> multiply two different datatypes</u> (here one is int and another is double). Either both of them should be of type int or both should be of type double.