Final answer:
The method _jspService() is not a standard part of the JSP lifecycle; it's an implementation detail by JSP containers but not to be directly used by developers.
Explanation:
The question pertains to the standard methods in the JavaServer Pages (JSP) life cycle. In JSP, there are several lifecycle methods that the JSP container (like Tomcat or Jetty) calls to manage the JSP page. These methods include jspInit() for initialization, jspService() for processing requests, and jspDestroy() for cleanup when the JSP is about to be destroyed. However, the method _jspService() is not part of the JSP life cycle and is actually an implementation detail used by some JSP containers. This method is typically generated by the JSP container during JSP to servlet conversion and should not be called directly by developers.
please exaplain to me, how people, Software andHardware relates specifically to
1. LANs
2. WANs
Answer:
No Answer
Explanation:
LAN : Local Area Network
Used to connect all the computers with in a building or some limited distance
so that people can share data and applications between different computers
useful for Intranet applications
WAN: Wide Area Network
used to cover large geographical area. it is network of networks. useful for computer networking.In short a WAN connects several LAN
ebay employs the _____ auction mechanism.
A. forward
B. reverse
C. dutch
D. proprietary ebay
Answer:
A. Foward
Explanation:
ebay employs the forward auction mechanism.
What do you mean by preemptive and nonpreemptive multitasking and multithreading ?
Answer:
Preemptive multitasking is the operating system that control the processor by not involving in task cooperation and preemptive is the process of controlling the task. On the other hand, preemptive multi threading is the parallel processing system in which the execution of the thread is preemptive.
Non-preemptive multitasking is the process in which the processor are never involves with the task and it is used for many window applications. Whereas, in non preemptive multi threading when a thread are given control then, it continues run until it can control the blocks.
Write a code segment that takes an emailaddress stored in the string email and stores theuser name in the string user and the hostaddress in the string host. Remember that the user name and host address are separated by thecharacter @.
Answer:
#include <bits/stdc++.h>
using namespace std;
int main() {
string email,username,host;//strings to store email,username,hostname..
cout<<"Enter the email address "<<endl;
cin>>email;//taking input of email address..
bool flag=1;
for(int i=0;i<email.length();i++)//iterating over the string email..
{
if(email[i]=='@')//if @ symbol is encountered make flag 0 skip this iteration.
{
flag=0;
continue;
}
if(flag==1)//add to username if flag is 1.
{
username+=email[i];
}
else//add tom host..
host+=email[i];
}
cout<<"The username is "<<username<<endl<<"The host name is "<<host;//printing the username and hostname..
return 0;
}
Explanation:
I have taken three strings to store the email address entered by user ,username and host to store username and host name respectively.Then I am iterating over the string email if @ is encountered then skip that iteration before that keep adding characters to username string and after that keep adding characters to host.
Is the Internet a LAN or a WAN?
give the answer at least five line for one question
Answer:
Internet is a WAN (wide are network)
Explanation:
Great question, it is always good to ask away and get rid of any doubts that you may be having.
The Internet is a worldwide interconnected network with computers acting as nodes around the world. Communicating and sharing information between one another. LAN and WAN are connection types for the Internet.
LAN is a Local Area Network, which interconnects local computer nodes physically using Ethernet cables. Which are then connected to the internet itself.
WAN are wide area networks, which are usually interconnected through public communication services such as telephone cable.
Therefore the Internet is a WAN (wide are network)
I hope this answered your question. If you have any more questions feel free to ask away at Brainly.
True / False
. Fixed length instruction sets are generally slower to execute than variable-length instruction sets.
Answer: False
Explanation:
Fixed length instructions are faster than variable length instruction because the fixed length instruction uses one clock cycle for their instruction whereas variable instruction takes more than one clock cycle. As RISC uses fixed length instruction and its CPI(cycles per instruction) is less compared to CISC which uses variable length instructions.
So fixed length instruction sets are faster than variable length instruction.
What are the first and the last physical memory addressesaccessible using
the following segment values?
a) 1000
b) 0FFF
c) 0001
d) E000
e) 1002
Answer
For First physical memory address,we add 00000 in segment values.
For Last physical memory address,we add 0FFFF in segment values.
NOTE-For addition of hexadecimal numbers ,you first have to convert it into binary then add them,after this convert back it in hexadecimal.
a)1000
For First physical memory address, we add 00000 in segment value
We add 0 at the least significant bit while calculating.
10000 +00000 = 10000 (from note)
For Last physical memory address,We add 0 at the least significant bit while calculating.
we add 0FFFF in segment value
10000 +0FFFF =1FFFF (from note)
b)0FFF
For First physical memory address,we add 00000 in segment value
We add 0 at the least significant bit while calculating.
0FFF0 +00000=0FFF0 (from note)
For Last physical memory address,We add 0 at the least significant bit while calculating.
we add 0FFFF in segment value
0FFF0 +0FFFF =1FFEF (from note)
c)0001
For First physical memory address,we add 00000 in segment value
We add 0 at the least significant bit while calculating.
00010 +00000=00010 (from note)
For Last physical memory address,We add 0 at the least significant bit while calculating.
we add 0FFFF in segment value
00010 +0FFFF =1000F (from note)
d) E000
For First physical memory address,we add 00000 in segment value
We add 0 at the least significant bit while calculating.
E0000 +00000=E0000 (from note)
For Last physical memory address,We add 0 at the least significant bit while calculating.
we add 0FFFF in segment value
E0000 +0FFFF =EFFFF (from note)
e) 1002
For First physical memory address,we add 00000 in segment value
We add 0 at the least significant bit while calculating.
10020 +00000=10020 (from note)
For Last physical memory address,We add 0 at the least significant bit while calculating.
we add 0FFFF in segment value
10020 +0FFFF =2001F (from note)
Where (what memory location) is the data read from for the following code:
ORG $3000
LDAA #$C2
Answer: ORG $3000 tell us that we want to load the program from the address $3000.
LDAA #$C2 tell us to load the value contained in the address present in the register C2 into the accumulator.
Explanation:
ORG instruction in microprocessor does not have a fixed address. It tell us where to begin the execution of the program by loading into a starting address space. It does not uses fixed addressing
LDAA instruction uses indirect addressing by placing the value from the address present in the register. Here the address is contained in register C2.
_______exception inherits from exception class and _________exception is anywhere in the program.
Java , C#
C++ , C#
C# , Java
Java ,C++
Answer: Java exception inherits from exception class and C++ exception is everywhere in the program.
Explanation: Java exception are the unwanted events that occur during the run time of a particular program and breaks the flow of it. Java exception are the subclass of the exception class that is it is derived from them.So, java exception inherits from exception class.
C++ exception are those circumstances which appear during a program which are unnecessary faults during the execution of a program. the exception allows to transfer the control from one part to another part in a particular program. So, the C++ exception is anywhere in the program.
A ____ is a structure that allows repeated execution of a block of statements.
a.
loop control
b.
loop
c.
body
d.
Boolean expression
Answer:
loop
Explanation:
Loop is the one which is used to execute the specific statement again and again until the condition is true.
In the programming, there are 3 basic loop used.
1. for loop
Syntax:
for(initialization, condition, increment/decrement)
{
statement;
}
the above statement execute until the condition in the for loop true when it goes to false, the loop will terminate.
2. while loop
Syntax:
initialization;
while(condition)
{
statement;
increment/decrement;
}
it is work same as for loop and the increment/decrement can be write after or before the statement.
3. do while
syntax:
initialization;
do
{
statement;
increment/decrement;
}while(condition);
here, the statement execute first then, it check the condition is true or not.
so, if the condition is false it execute the statement one time. this is different with other loops.
Final answer:
A loop is a structure that allows repeated execution of a block of statements in programming. It is controlled by a condition that, when false, will terminate the loop to prevent an infinite loop.
Explanation:
The correct answer to the question is b. loop. A loop is frequently used in programming to allow the repeated execution of a block of statements until a specified condition is met. Loops are a form of conditional control flow that can drastically alter the execution path of a program.
For instance, a while-loop will continue to execute so long as its condition remains True. If the condition evaluates to False, the loop terminates and control is passed to the statements that follow. During each iteration within the loop, it is essential to modify some variables, such as the iteration variable, to ensure the loop does not continue indefinitely, potentially leading to an infinite loop.
---------------- is an operating systems ability to be easily enhanced over time
a) performance
b) portability
c) reliability
d) extensibility
Answer: Extensibility
Explanation:
Extensibility is one of the features which can be easily enhanced over time. As the term extensibility refers to the addition of new features and adding more features to the present modules. This does not change the internal organisation of the earlier modules in fact they add new and more improved features to the present.
Write a C++ code that will read a line of text and echo the line with all uppercase letters deleted. Assume the maximum length of the text is 80 characters. Example input/output is shown below.
Input:
Today is a great day!
Output:
oday is a great day!
Answer:
#include<bits/stdc++.h>
using namespace std;
int main()
{
string st;
getline(cin,st);
int i=0;
while(i<st.length())
{
if(isupper(st[i]))
{
st.erase(st.begin()+i);
continue;
}
i++;
}
cout<<st<<endl;
return 0;
}
Explanation:
I have included the file bits/stdc++.h which include almost most of the header files necessary.
For taking the input as a string line getline is used.
For checking the upper case isupper() function is used. cctype header file contains this function.
For deleting the character erase function is used.
Why has the PCM sampling time beenset at 125 microseconds?
Answer Explanation:c
PCM( pulse code modulation) is a process for transmitting the analog data from one place to other place the signal which are used in pulse code modulation are binary that is only 0 and 1 using PCM all forms of analog data can be form including voice music etc.
to obtain pcm an analog signal is sampled at regular time interval the sampling rate is very high as compared to the frequency used by analog signal. the instant amplitude of analog signal at each sampling is being closer to the nearest several specific earlier levels.this process is called tantalization. in this the number of level is power of 2 so the sampling time is set as 125 microseconds.
What is Software Testing ? How many types of testing we mayutilize for a component using CBSE approach ?
Answer:
Software testing is defined as, it the process of evaluation of the functionality of the system software application to check whether the software met the specified requirement or not and also used to identify defects which ensured that the product is free from all defects in order to produce the quality products.
Types of testing we may utilize for a component using CBSE approach are:
As, CBSE stands for the component based software engineering where programmers should design and implemented software components in such a way that many different program can reuse them.
Unit testing Integration testing System testing
Once the logical expression at the start of a while loop is false, the statements after the end statement are
executed.
True or False?
Answer:
True
Explanation:
the while loop is used to execute the statement again and again unti the condition is true. Once the condition is False, the program control terminate the while loop and execute the next statement after the while loop.
for example:
int i=0;
while(i<5)
{
i++;
}
cout<<i<<endl;
one the code execute the while loop run 5 times and in the 6th times the condition become False then program control moves to print statement.
True of False - use T or F An abstract class can be extended by another abstract class.
Answer:
T
Explanation:
an abstract class can be extended by another.the abstract class which is extending should be implemented by another class
If we compare the push function of the stack with the insertFirst function for general lists, we see that the algorithms to implement these operations are similar.
True
False
Answer:
True
Explanation:
Algorithm for push function
The method of placing data on a stack is called a push operation.
It involves these steps −
Check that the stack is complete. If the stack is complete, it will cause an error . Increases top to point next empty room if the stack is not complete. Adds the data component to the place of the stack where top is pointing. Success returns.Algorithm for Insertfirst function
Create a new Link with provided data. Point New Link to old First Link. Point First Link to this New Link.As we can see that in both algorithms ,we are inserting data to a new nodes and incrementing/pointing to a new node for inserting data.Both algorithms uses the same approach.
What is internal recruitment ?
Answer:
The term ‘Internal Recruitment’ refers to the process of identifying and attracting candidates from a certain organization to another position within the same organization.
Instead of opening the position to the public and attracting random candidates some companies may choose to advertise the vacancy internally and only allow members of the staff to apply.
Internal recruitment also refers to a strategy mostly big corporations use to advertise their jobs internally. Due to the size of these companies, these job openings would otherwise go unnoticed by employees in other departments.
Whichmultiplexing technique involves signals composed of lightbeams?
1 TDM
2 FDM
3 WDM
4 None of theabove
Answer:
3.WDM
Explanation:
WDM ( wavelength division multiplexing ) involves signals composed of light beams WDM is used in communication where fibers are used it is used for multiplexing of number of carrier signals which are made of optical fibers by using different wavelength of laser light it has different wavelength so this WDM is used for signals composed of light beams it has property of multiplexing of signal
Define a class Complex for complex numbers. A complex number is a number of the form: ???? + ???? ∗???? where a and b are real and imaginary part of a complex number and i is a number that represents the quantity √−1 . Addition of two complex numbers: (???? +???????? )+(???? +????????) = (???? +????) + (???? +????)???? Subtraction of two complex numbers: (???? +????????)−(???? +????????) = (???? −????)+(???? −????)???? Create a class Complex that contains: Two private variables real and imaginary of type double. Define accessor and mutator functions of real and imaginary variables. Overload the following operators "+" and "–" so that they apply correctly to the type Complex. Test your program with inputs (5+4i) and (2+2i).b
Explanation:
--!#&?&#&#(-$(-$)-"-)"(-'-)';'!'+%
The _________ statement causes a function to end immediately.
Answer:
return
Explanation:
return is the statement which is used to return the value from the function definition to the function calling.
it is also used as exit from the function.
for example:
int count()
{
return 0;
printf("hello");
}
In the above the function return 0 without print the message "hello". we can used return any where inside the function for immediately ending the execution of function.
Final answer:
The statement that causes a function to end immediately is the 'return' statement, which halts function execution and returns the flow of execution to where the function was called.
Explanation:
The statement that causes a function to end immediately in most programming languages is a return statement. When the return statement is executed, it ends the function execution and the flow of execution goes back to where the function was called, which can be likened to coming back from a 'detour'. It's important to realize that defining a function also creates a variable with the same name, which can be used to call the function later in the code.
A functional approach to programming includes various other concepts. For instance, to end the function, you have to enter an empty line in some interactive environments like REPLs (Read-Eval-Print Loop), although this is not necessary in a script. The last statement of a function plays a role similar to a 'Note of Finality' in a speech, indicating the end of the logic encapsulated by the function.
Given a is 3, b is 4, and c is 5, what is the value of the expression
--a * (3 + b) / 2 - c++ * b?
Answer:
--a * (3 + b) / 2 - c++ * b = -13
Explanation:
First we have to evaluate (3+b) = 7
As a=3, so "--a" will be 2.
So we need to evaluate "--a * (3 + b) / 2" and as we know * and / has same precedence we have to follow left association.
So in "--a * (3 + b) / 2", "--a * (3 + b)" = 2*7 is evaluated first that is 14. then [tex]\frac{14}{2}[/tex] = 7.
Now in "c++*b" as c is post-incremented, so it will take 5 rather than 6.
So c++*b = 5 *4 = 20.
Now --a * (3 + b) / 2 - c++ * b = 7-20 = -13
A magnetic disk has an average seek time of 8 ms. The transferrate is 50 MB/sec. The
disk rotates at 10,000 rpm and the controller overhead is 0.3msec. Find the average time to read or write 1024 bytes.
Answer:
11.32milisec.
Explanation:
Average seek time = 8ms
transfer rate = 50MB/sec
disk rotate = 10000 rpm
controller overhead = 0.3 msec
Average time = ?
Average time is the addition of the seek time, transfer time, rotation time and ontroller overhead
[tex]Average\,time = Seek\,time+Rotation\,time+Transfer\,time+Controller\,overhead[/tex]
now, find the rotation time,
Rotation time is the time at which half rotation is made.
[tex]Rotation\,time=\frac{0.5}{rotation\,per\,second}[/tex]
convert rotation per minute to rotation per second.
[tex]rps=\frac{10000}{60}[/tex]
substitute in the above formula.
[tex]Rotation\,time=\frac{0.5}{\frac{10000}{60} }=0.003sec[/tex]
or 3milisec
now, find the transfer time by formula:
[tex]Transfer\,time=\frac{Number\,of \,read\,or\,write\,bytes}{transfer\,rate}[/tex]
so, read or write bytes is 1024
[tex][tex]Transfer\,time=\frac{1024}{50*10^{6} }=0.02milisec[/tex][/tex]
The average time is:
[tex][tex]Average\,time= 8+3+0.02+0.3=11.32milisec[/tex][/tex]
Write a program that lets the user guess the coin's head or tail. The program randomly generates an integer 0 or 1, which represents the head or the tail. The program prompts the user to enter a guess and reports whether the guess is correct or incorrect. include step by step commentary.
Answer:
#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
int main()
{
srand (time(NULL)); //initialize random seed
int guess;
int number = rand() % 2; //generate random number 0 or 1
cout<<"Enter the guess (0 or 1): ";
cin>>guess; //store in guess
if(number == guess){ //check if number equal to guess
cout<<"Guess is correct."<<endl; //if true print correct message.
}else{
cout<<"Guess is incorrect."<<endl; //otherwise print correct message.
}
return 0;
}
Explanation:
first include the three library iostream for input/output, stdlib,h for using the rand() function and time for using the time() function.
create the main function and initialize the random number generation seed, then generate the random number using the function rand() from 0 to 1.
after that, take input from user and then with the help of conditional statement if else check if random number is equal to guess number or not and print the appropriate message.
______________ Gives the Mean time for which systemremained available for use.
a) MTTF
b) MTBF
c) MTTR
d) MTTD
Answer: d)MTTD
Explanation: MTTD(Mean Time To Detect) is the time for the discovery of the problem in a system. It is basically the average time until the problem is noticed by someone. For e.g.- if there is a problem in a computer system at 9:00 am and the problem is noticed at 9:10 am by then user then the MTTD is 10 minutes . So, MTTD gives the mean time for which the system remains available for use.
Develop a C++ program that simulates a user creating/entering a new password into a system.
You may presume that the username is irrelevant to complete this program.
Have the program ask the user to enter a proposed password as a string.
Validate that the password meets the following criteria:
Password must be at least ten characters long
Password must contain at least one uppercase letter
Password must contain at least one lowercase letter
C++ program for Validating password
#include <iostream>
#include<cstring>
using namespace std;
int main()//driver function
{
char password[100];//declaring variables password
int lower=0,upper=0,flag=1;
cout<<"Enter the password\n";//taking input
cin>>password;
int length = strlen(password);//finding length
for(int i=0;i<length;i++)
{
if(password[i]>=65&&password[i]<=90)/*checking string must contain at least one uppercase letter */
{
upper=1;
}
if(password[i]>=97&&password[i]<=122)/*Checking string must contain at least one uppercase letter*/
{
lower=1;
}
}
if(length<10)//checking that string length should be less than 10
{
flag=0;
cout<<"Password must be at least ten characters long\n";
}
if(upper==0)
{
flag=0;
cout<<"Password have to be at least one uppercase letter\n";
}
if(lower==0)
{
flag=0;
cout<<"Password have to be at least one lowercase letter\n";
}
if(flag==1)//if all condition turns out to true,printing Valid Password
{
cout<<"Valid Password";
}
}
Output
Enter the password
Ayushyadav
Valid Password
Enter the password
Ayush
Password must be at least ten characters long
Enter the password
anmolyadav
Password have to be at least one uppercase letter
ANMOLVIJWANI
Password have to be at least one lowercase letter
What is the effect of this program?
#define MAX 50
int a[MAX], i, j, temp;
for(i = 0; i < MAX / 2; + + i)
{
temp = a[i];
a[i] = a[MAX - i -1];
a[MAX - i - 1] =temp;
}
A. Arranges the elements of array a inascending order
B. Counts the numbers of elements of agreater than its first element
C. Reverses the numbers stored in thearray
D. Puts the largest value in the last arrayposition
E. None of the above
Answer:
The answer is (C)
Let’s run the algorithm on a small input to see the working process.
Let say we have an array {3, 4, 1, 5, 2, 7, 6}. MAX = 7
Now for i=0, i < 7/2, here we exchange the value at ith index with value at (MAX-i-1)th index. So the array becomes {6, 4, 1, 5, 2, 7, 3}. //value at 0th index =3 and value at (7-0-1)th index is 6. Then for i=1, i < 7/2, the value at index 1 and (7-1-1)=5 are swapped. So the array becomes {6, 7, 1, 5, 2, 4, 3}. Then for i=2, i < 7/2, the value at index 2 and (7-2-1)=4 are swapped. So the array becomes {6, 7, 2, 5, 1, 4, 3}. Then for i=3, i not < 7/2, so stop here. Now the current array is {6, 7, 2, 5, 1, 4, 3} and the previous array was{3, 4, 1, 5, 2, 7, 6}.Explanation:
So from the above execution, we got that the program reverses the numbers stored in the array.
Final answer:
The provided program reverses the numbers stored in the array by swapping elements from the start of the array with their corresponding elements at the end until it reaches the middle of the array. The correct answer is C. Reverses the numbers stored in the array.
Explanation:
The effect of the provided program is that it reverses the numbers stored in the array a. It uses a for-loop to swap elements symmetrically from the start and end of the array towards the middle. Specifically, for each iteration of the loop, it takes an element from the beginning part of the array (indexed by i) and swaps it with the corresponding element from the end of the array (indexed by MAX - i - 1).
The correct choice from the given options is:
C. Reverses the numbers stored in the arrayThis code does not arrange the elements in ascending order, count elements, or specifically move the largest value to the last position, so options A, B, and D are incorrect.
What happens when a returntype, even void, is specified as a constructor in Java?
Answer:
If a returntype is added to a constructor method in Java, it ceases to be a constructor and behaves like an ordinary class method with the same name as class name.
Explanation:
If a returntype is added to a constructor method in Java, it ceases to be a constructor and behaves like an ordinary class method with the same name as class name.
Constructors are special methods which are used for initializing the object. Constructors do not have a return type. If we add a return type to the constructor method , it does not play any role during object initialization and can be involved like any other object method.
vertical exchanges are typically used only to buy and sell materials required for an organization's support activities ( True or false)
Answer:
Vertical exchanges are typically used only to buy and sell materials required for an organization's support activities- False
This statement is false.
Elevating privileges to those of an administrator is also called ___________________ escalation.
Answer: Privilege
Explanation:
Privilege escalation is type of intrusion attack whereby the attacker gain access into the system with the privileges of that of an administrator. This may be due to programming errors or any type of bug in the system. This attack is extremely dangerous because the attack can change the environment of the system as it gets the administrator rights and access.