Answer:
Hangman is game which can be played with a pencil or pen and a paper. It is a multiplayer game which requires minimum two players. It is a guessing game, in which a player thinks of a word or a phrase and other player or players tries to guess it correctly, letter by letter or whole word or phrase at once, in a certain number of guesses.
In this game, the word to be guessed is represented by dashes. If the guessed word or letter is correct, the player fills the blank spaces. But if the guessed word or letter is wrong, the player draws an element of a hanged man stick figure one by one as a tally mark.
This game ends if the player who is guessing guesses the word or the phrase correctly and the guesser wins; or if the player guesses enough wrong letters of phrases that the other player finishes the drawing of the hangman and the guesser loses.
Which is it?...coloring,flagging,filing, or reading your email is an easy way to catergorize it?
Answer:
Flagging is an easy way to categorize an email.
Explanation:
We can flag our emails to find it easily at a later time. Flagged email messages are easy to spot because of their icon. We can also flag email messages for following up on a particular email.
Thus flagging is an easy way to categorize an email.
Servlet session and JSP session have different abilities.TrueFalse
Answer:
The answer to this question is False.
Explanation:
According to life cycle of a JSP it has to becomes a servlet in the end.So there is no difference between their session handling capacities because in the end they are same.So we conclude that answer to this question is False.
Write the 8-bit signed-magnitude, two's complement, and ones' complement representations for each decimal number: +25, + 120, + 82, -42, -111.
Answer:
Let's convert the decimals into signed 8-bit binary numbers.
As we need to find the 8-bit magnitude, so write the powers at each bit.
Sign -bit 64 32 16 8 4 2 1
+25 - 0 0 0 1 1 0 0 1
+120- 0 1 1 1 1 0 0 0
+82 - 0 1 0 1 0 0 1 0
-42 - 1 0 1 0 1 0 1 0
-111 - 1 1 1 0 1 1 1 1
One’s Complements:
+25 (00011001) – 11100110
+120(01111000) - 10000111
+82(01010010) - 10101101
-42(10101010) - 01010101
-111(11101111)- 00010000
Two’s Complements:
+25 (00011001) – 11100110+1 = 11100111
+120(01111000) – 10000111+1 = 10001000
+82(01010010) – 10101101+1= 10101110
-42(10101010) – 01010101+1= 01010110
-111(11101111)- 00010000+1= 00010001
Explanation:
To find the 8-bit signed magnitude follow this process:
For +120
put 0 at Sign-bit as there is plus sign before 120. Put 1 at the largest power of 2 near to 120 and less than 120, so put 1 at 64. Subtract 64 from 120, i.e. 120-64 = 56. Then put 1 at 32, as it is the nearest power of 2 of 56. Then 56-32=24. Then put 1 at 16 and 24-16 = 8. Now put 1 at 8. 8-8 = 0, so put 0 at all rest places.To find one’s complement of a number 00011001, find 11111111 – 00011001 or put 0 in place each 1 and 1 in place of each 0., i.e., 11100110.
Now to find Two’s complement of a number, just do binary addition of the number with 1.
The question involves converting decimal numbers to 8-bit signed-magnitude, two's complement, and ones' complement binary representations. Positive numbers are the same in all three representations, whereas negative numbers differ. The most significant bit represents the sign in signed-magnitude, while two's and ones' complements involve bit inversion for negative numbers.
Explanation:The question involves converting decimal numbers into three different binary number representations: 8-bit signed-magnitude, two's complement, and ones' complement. These representations are used in computing to express positive and negative integer values. For an 8-bit system, the most significant bit (MSB) indicates the sign of the number, where '0' usually represents positive and '1' represents negative.
For +25, the 8-bit signed-magnitude is 00011001, the two's complement and ones' complement are also 00011001 since it is a positive number.
For +120, the 8-bit signed-magnitude is 01111000, the two's complement and ones' complement are also 01111000.
For +82, the 8-bit signed-magnitude is 01010010, the two's complement and ones' complement are also 01010010.
For -42, the 8-bit signed-magnitude is 10101010, the two's complement is 11010110, and the ones' complement is 11010101.
For -111, the 8-bit signed-magnitude is 10101111, the two's complement is 10010001, and the ones' complement is 10010000.
Note that the two's complement is found by inverting all the bits of the absolute value of the number and then adding 1 to the least significant bit (LSB). The ones' complement is found simply by inverting all bits of the absolute value of the number.
What is the printout of the call nPrint("a", 4)?
static void nPrint(String message, int n) {
while (n > 0) {
System.out.print(message);
n--;
}
}
Please explain so that I can learn from you.
Answer:
aaaa
Explanation:
We have a function nPrint which return type is void, it means it returns nothing.
we declare the two parameters, one parameter is string type and the second parameter is an integer type.
Then, it has a while loop that executes the statement again and again until the condition not FALSE.
Let dry run the code:
First, call the function nPrint("a", 4) bypassing the value in the argument.
then, the value receives by the parameters, the message contains "a" and n contain 4. After that, while loop checks the condition 4 > 0, which is TRUE and the program starts executing the statement.
The program prints the message on the screen "a" and then decreases the value of n by 1. So, the value of n becomes 3.
The above process repeats for the value of n = 3, 2, 1
and print the message "aaaa".
then, the condition becomes false and the program terminates the loop.
Therefore, the answer is aaaa
From the binary search algorithm, it follows that every iteration of the while loop cuts the size of the search list by half.
True
False
Answer:
True: In binary search algorithm, we follow the below steps sequentially:
Input: A sorted array B[1,2,...n] of n items and one item x to be searched.
Output: The index of x in B if exists in B, 0 otherwise.
low=1high=n while( low < high ) { mid=low + (high-low)/2 if( B[mid]==x) { return(mid) //returns mid as the index of x } else { if( B[mid] < x) //takes only right half of the array { low=mid+1 } else // takes only the left half of the array { high=mid-1 } } }return( 0 )Explanation:
For each iteration the line number 11 or line number 15 will be executed.
Both lines, cut the array size to half of it and takes as the input for next iteration.
If you're doing a relational comparison, which filter would be available?
A. Date
B. Text
C. Number
D. Currency
Answer:
C. Number
Explanation:
If you're doing a relational comparison, a number filter would be available.
2.Use loops to create a 4X6 matrix in which the value of each element is two times its row number minus three times its column number. For example, the value of element (2,5) is 2x2-3x5=-11.
Answer:
for(i=0; i<4; i++)
{
for(j=0;j<6;j++)
{
A[ i ][ j ] = 2* i - 3*j;
}
}
Explanation:
In this loop for each i = 0,1,2,3 we fill the the corresponding column values. and then move to next i value i.e. row.
What is the output of the following code? (Please indent thestatement correctly first.)
int x = 9;
int y = 8;
int z = 7;
if (x > 9)
if (y > 8)
System.out.println("x > 9 and y > 8");
else if (z > = 7)
System.out.println("x < = 9 and z > = 7");
else
System.out.println("x < = 9 and z < 7");
Answer:
no output, it does not print any thing
Explanation:
if-else statement is used to execute the statement after checking the condition if the condition is true, it allows the program to execute the statement otherwise not.
in the code, define the variable with values x = 9, y = 8 and z = 7.
Then, if the statement checks the condition 9 > 9, the condition is false.
So, the program terminates the if statement and executes the next statement but there is no next statement.
the other if-else statement is within the if condition which already terminates.
Therefore, there is no output.
Is bit stuffing necessary in the control or address field in theHDLC protocol? why?
Answer:
Many network and communication protocols require bit stuffing for the following purposes: to avoid the interpretation of data as control information. For example, with six consecutive 1 bits, X.25 uses the bit stuffing,signal the beginning and end of a frame.
High-level Data link control (HDLC) is a bit-oriented protocol for point-to-point and multi-point communication.P/F bits are present in HDLC control field.
So,Yes bit stuffing is necessary in control field.
Which function grows faster: N log N or N1+ε/ log N, ε > 0?
Answer:
N logN grows faster.
Explanation:
In N1+∈/N logN logN is the denominator. So this term is constantly getting divided by logN while in N logN there is no term in the division and for N > 2 log N will be > 1. So N logN will gorw faster. Since ∈ is greater than 0 So the numerator will be greater than N but it will not grow as fast as N logN.
Final answer:
N[tex]^(1+ε)[/tex] / log N grows faster than N log N because exponential growth surpasses logarithmic growth as N increases.
Explanation:
The question asks which function grows faster: N log N or N1+ε / log N, where ε > 0. To determine this, we need to analyze the growth rate of both functions as N becomes very large. In general, any function that includes a term with N raised to a power (in this case N1+ε) will grow faster than a function that involves N multiplied by a logarithmic function (in this case N log N). The reason is that exponential growth (which includes polynomials) surpasses logarithmic growth as N increases. Therefore, N1+ε / log N grows faster than N log N for any ε > 0.
When displaying fonts, what%u2019s the difference between pixels, points and ems?
Answer:
All 3 are CSS unit sizes which we can use for margins, fonts, borders etc.
Explanation:
CSS has four different unit sizes. These are:
Pixels (px)
Points (pt)
Ems (em)
Percentages(%)
These units are divided into two different groups. They are fixed and relative.
Pixels and points are fixed , whereas em and percentages are relative unit sizes. Relative unit sizes are good when creating scalable layouts.
Ems (em):
An em is a CSS unit that measures the size of a font. Originally, the em was equal to the width of the capital letter M, which is where its name originated.
It stands for "emphemeral unit" which is relative to the current font size.
The "em" is a scalable unit that is used in web document media. Ems have mobile-device-friendly nature.
Pixels (px):
Pixels are fixed-size units that are used in screen media. One pixel is equal to one dot in computer. The problem with pixel unit is that it is not relative .
Points (pt):
Point values are only for print. A point is a unit of measurement use for real-life ink on paper. Generally, 72pts= 1 inch which is one real-life inch like on a ruler. Point is not recommended to use in web pages.
Generally, 1em=16px=12pt=100% if the body size is 100%.
Relative unit sized fonts change and fixed unit sized fonts remain the same.
For example,
body { font-size: 100%}
p{font-size: 16px}
What are the advantages and disadvantages of the various collision resolution strategies for hashes?
Linear probing
It does a linear search for an empty slot when a collision is identified
Advantages
Easy to implement
It always finds a location if there is one
Disadvantages
When clusters and keys fill most of the array after forming in adjacent slots of the table, the performance deteriorates
Double probing/hashing
The idea here is to make the offset to the next position probed depending on the key value. This is so it can be different for different keys.
Advantages
Good for double number generation
Smaller hash tables can be used.
Disadvantages
As the table fills up, the performance degrades.
Quadratic probing
It is used to resolve collisions in hash tables. It is an open addressing scheme in computer programming.
Advantage
It is more efficient for a closed hash table.
Disadvantage
Has secondary clustering. Two keys have same probe sequence when they hash to the same location.
Answer:
Vector: each vector position holds one
information. If the hashing function applied to a
set of elements determine the information I1,
I2, ..., In, so the vector V [1 ... n] is used to
represent the hash table.
! Vector + Chain List: Vector contains
pointers to lists that represent the
information.
Hashing Function
! The Hashing Function is responsible for generating a
index from a given key.
! Ideally, the function should provide unique indexes for the
set of possible input keys.
! Hashing function is extremely important,
because she is responsible for distributing the information through
Hash table.
Explanation:
Hope this helps :) -Mark Brainiest Please :)
When applying strict “Private access” level to a component. Which services should the designer provide in its class to allow the object to communicate with the outside world? What should be the access level of these services?
Answer:
public accessor methods
Explanation:
When applying strict “Private access” level to a component the designer should provide public accessor methods in its class to allow the object to communicate with the outside world. The access level of these services must be public so that they can be accessed by other classes and objects of the outside world.
Below is an example of such a class design in java :-
class MyClass {
private int num; //private class component
public int getNum(){ //public accessor method to allow the object to communicate with the outside world
return num;
}
}
In Java an abstract class cannot be sub-classed
?? True
?? False
Answer:
False
Explanation:
An abstract class is a class declared abstract — it may or may not include abstract techniques. It is not possible to instantiate abstract classes, but they can be sub-classed.
Abstract method declaration
abstract void moveTo(double X, double Y);
Usually the subclass offers solutions for all of the abstract techniques in its parent class when an abstract class is sub-classed. If not, however, the subclass must be declared abstract as well.
Example
public abstract class GraphicObject {
// declaring fields
// declaring non-abstract methods
abstract void draw();
}
Give a pseudo-code description of the O(n)-time algorithm for computing the power function p(x,n).Also draw the trace of computing p(3,3)using this algorithm?
Answer:
p(x,n)
1. if(n==0) [if power is 0]
2. then result =1.
3.else
4. { result=1.
5. for i=1 to n.
6. { result = result * x. } [each time we multiply x once]
7. return result.
8. }
Let's count p(3,3)
3[tex]\neq[/tex]0, so come to else part.
i=1: result = result *3 = 3
i=2: result = result *3 = 9
i=2: result = result *3 = 27
Explanation:
here the for loop at step 4 takes O(n) time and other steps take constant time. So overall time complexity = O(n)
What is the command to display the user name with which youhave logged in?
Answer:
echo %username%
whoami
Explanation:
In windows the command used to display user name which you have logged in is echo %username%.Note that it is only for windows platform only .It works on all released windows platforms.
There is another command whoami it tells the domain name also along with the username.
You have to write all these commands on the command prompt.
There are a variety of common user interfaces. How would you decide which interface to use and on what should this decision be based?
Answer: There are many different types of user interfaces. To decide on the user interface depends entirely on the requirement of the client.
Explanation:
There are different types of interfaces such as command line user interface, graphical user interface, menu based, form based. Therefore to choose among them it depend on the requirement specified by a client. Mostly nowadays GUI is used. to maintain records form based is preferred. For system software CUI is better due to decrease its pressure on the processor. Networking is also both GUI and CUI. So it depend mainly on the type of application developed , client requirements, power consumption based on its dependence on processor power.
The _________ function causes a program to terminate.
Answer: exit
Explanation:
exit function terminates the calling process without executing the rest of the code.exit function do some cleaning before termination like buffer flushes etc.
exit(0) exits the program without any error message.
syntax:- void exit(int return code)
You have to include stdlib.h header file in c if you want to use exit function.
When trying to identify the sorted column in a table, you would look for the column where
A. an arrow is displayed in the field name.
B. data is in alphabetical order.
C. only a few records appear.
D. data is presented from low to high.
Answer:
d
Explanation:
provides guidelines for planning a desktop database. You will learn how to decide what information you need, how to divide that information into the appropriate tables and columns, and how those tables relate to each other. You should read this article before you create your first desktop database.
what is daemontools pakage in qmail?
Answer: Daemon-tools package is a group of tools which are present for the observation of the UNIX service in qmail. The services and saving of the error messages to logs are monitored by these tools. It helps in simplification of the management and makes the process easy.It has data or information of the errors which occur when setting up or execution of daemon-tools on a particular system.
Which of the following is NOT foundwithin the content pane?labelstitlebartextareasbuttons
Answer: Title bar
Explanation: Content pane is like a content box with certain features containing the object and knowledge about it. It is usually referred with several factors like labels , text, buttons etc to load the data in the dynamic way. These features are present within the content pane. The only feature outside the content pane is title bar and thus is not found in content pane.
TRUE/FALSE
The Interrupt Vectors stored in the Interrupt Vector table are really just the addresses of the interrupt service routines
Answer:
TRUE
Explanation:
Interrupt Vectors in the Interrupt Vector table represent the address of the Interrupt Service Routine.
Lets consider an example. When we press a key on the keyboard, a hardware interrupt is raised corresponding to keypress event. The control passes to the corresponding Interrupt Vector in the Interrupt Vector table which in turn directs the execution flow to the keyboard interrupt handler.
How many base cases are in the functionabove?
a. 0
b. 1
c. 2
d. 3
int func2(int m, int n) {
if (n == 0)
return 0;
else
return m + func2(m, n-1);
}
Answer:
The answer is (b). 1.
Explanation:
In the code there is only 1 base case .
the base case is as following:-
if(n==0)
return 0;
this is the base case.
Base case is the most important statement in the function that uses recursion because without base case the recursion calls will keep on going and we will get a run time error.
When an object of one class is a data field within another class, they are related by ____.
a.
composition
b.
extension
c.
is-a
d.
scope
Answer:
a. composition
Explanation:
When an object of one class is a data field in another class, the two classes are related by composition. In particular the containing class is composed using the contained class. For example:
class container {
contained c;
int a;
}
class contained {
int b;
}
Here the container class is containing an instance of contained class creating a composition relation.
When the amount of storage data is big, and we need the searching and insertion must be very fast, which kind of data structure we should consider? a. Hash table b. Binary tree c. Array d. Linked Lists
Answer:
b. Binary tree
Explanation:
The time complexity of a binary tree is O(log n). As it scales up in size (n), the time taken is only log n. This is because it makes use of divide and conquer to split up the data which makes searching and inserting very simple. However, this only holds if the data is already sorted.
Draw an FA over {0, 1}which represent binaries of Integers only divisible by 3. Allleading 0’s are permissible. [10]
Answer:
As we need to design the FA for the numbers divisible by 3, so we have to take the states as the remainders when we divide the numbers by 3.
Any number when divided by 3, gives remainder either 0 or 1 or 2. And the number gives remainder 0 is divisible by 3.
Let’s take
state 0 for remainder 0. state 1 for remainder 1. state 2 for remainder 2.So now lets count from 0:
Binary 0 = decimal 0 %3 = 0, so goes to state 0.
Binary 1 =decimal 1 %3 = 1, goes to state 1.
Binary 10 = decimal 2 %3 =2, goes to state 2.
Bianary 11 = decimal 3 %3 =0, goes to state 0.
Bianary 100 = decimal 4 %3 =1, goes to state 1.
Bianary 101 = decimal 5 %3 =2, goes to state 2.
And so on.
So here the state 0 will be the start state and also the final state.
Explanation:
So the FA is {{0,1,2}, {0,1}, δ, 0, {0}}
where δ(0, 0) = 0
δ(0, 1) = 1
δ(1, 0) = 2
δ(1, 1) = 0
δ(2, 0) = 1
δ(2, 1) = 2
Among all the scientists of the 1930s, ________ was sosuited to carry out the Manhattan project as J.RobertOppenheimer.
no scientists
not who was a scientist
none
a scientist never he
Answer:
none
Explanation:
Great question, it is always good to ask away and get rid of any doubts that you may be having.
The above phrase does not have any correct entry. The correct way of stating the sentence would be the following.
"Among all the scientists of the 1930's, none were as suited to carry out the Manhattan Project as J. Robert Oppenheimer."
none is an available answer but since the next part of the sentence says was so it would not make sense or be grammatically correct. Therefore you can either change the available answers or change the next two words in order for the sentence to make sense as well as be grammatically correct.
I hope this answered your question. If you have any more questions feel free to ask away at Brainly.
Among all the scientists of the 1930s, none was so suited to carry out the Manhattan Project as J. Robert Oppenheimer.
J. Robert Oppenheimer was an influential theoretical physicist who was tasked by President Franklin Roosevelt to lead the United States' nuclear program during World War II.
His leadership and expertise were crucial to the success of the Manhattan Project, which was carried out in Los Alamos, New Mexico, and resulted in the development of the first nuclear bomb.
Thanks to his exceptional talent, Oppenheimer is often referred to as the 'father of the bomb.'
Glven an array named Scores with 25 elements, what is the correct way to assign the 25th element to myScore? A. myScores + 25 B. myScore Scores[24] C. myScore Scores[25) D. myScore== Score[last]
Answer:
myScore Scores[24]
Explanation:
The array is used to store the data in continuous memory location.
The index of array start from zero, it means first element store in the index zero and second element store in the index 1. So, the index at which the element store is less than 1 from the number of element.
so, the last element is 25 - 1=24.
Option A: myScores + 25
It is not the correct way to store the element.
Option B: myScore Scores[24]
it is the correct form and also the index location is correct.
Option C: myScore Scores[25)
index number is wrong and also the bracket is wrong, it must be [ ].
Option D: myScore== Score[last]
It is not the correct way to store the element.
There, the correct option is B.
Write an iterative C function that inputs a nonnegative integer n and returns the nth Fibonacci number. 2. Write a recursive C function that inputs a nonnegative integer n and returns the nth Fibonacci number. 3. Compare the number of operations and time taken to compute Fibonacci numbers recursively versus that needed to compute them iteratively. 4. Use the above functions to write a C program for solving each of the following computational problems. I. Find the exact value of f100, f500, and f1000, where fn is the nth Fibonacci number. What are times taken to find out the exact values
Is recursion ever required to solve a problem? What other approach can you use to solve a problem that is repetitive in nature?
Answer:
No you can not tell that recursion is ever required to solve a problem.
Recursion is required when in the problem, the solution of the input depends on the solution of the subsets of the input.
Iteration is also another form of repetitive approach we follow to solve that kind of problems.
But the difference between recursion and iteration is :
In recursion we call the function repeatedly to return the result to next level.In iteration certain bunch of instructions in a loop are executed until certain conditions met.Explanation:
For example in the Fibonacci sequence problem, to find [tex]f_{n}[/tex], we need to compute [tex]f_{n-1}[/tex] and [tex]f_{n-2}[/tex] before that.
In case of recursion we just call the method Fibonacci(n) repeatedly only changing the parameter Fibonacci(n-1), that calculates the value and return it.Fibonacci(n)
1. if(n==0 or n==1)
2. return 1.
3.else
4. return( Fibonacci(n-1)+Fibonacci(n-1) )
But in case of iteration we run a loop for i=2 to n, within which we add the value of current [tex]f_{i-1}[/tex] and [tex]f_{i-2}[/tex] to find the value of [tex]f_{i}[/tex]Fibonacci(n)
1. if(n<=2)
2. result = 1
3. else
4. result1 =1 and result2=1.
5. { result = result1 +result2.
6. result1= result2.
7. result2 = result.
8. }
9. output result.