Answer:
It returns the lookup value located in a specific location.
Explanation:
5 dequeue operations
6 enqueue operations
10 dequeue operations
8 enqueue operations
2 dequeue operations
3 enqueue operations
Last = 10
Answer:
10
Explanation:
An enqueue operation is a function that adds an element(value) to a queue array. A dequeue operations removes an element from a queue array. Queue arrays follow a first-in-first-out approach, so elements that are first stored in the queue are removed/accessed first(enqueue operations add elements at the rear of the queue array).
The following operations leave 10 elements in the queue of array size 12 after its done:
10 enqueue operations= adds 10 elements
5 dequeue operations= removes 5 elements( 5 elements left in queue)
6 enqueue operations= adds 6 elements(11 elements in queue)
10 dequeue operations= removes 10 elements(1 element left in queue)
8 enqueue operations= adds 8 elements(9 elements in queue)
2 dequeue operations= removes 2 elements(7 elements left in queue)
3 enqueue operations= adds 3 elements(10 elements in queue)
Therefore there are 10 elements in the queue after enqueue and dequeue operations.
Answer:
The program to the given question as follows:
Program:
import java.util.*; //import package for user input.
public class Main //defining class Main
{
public static void main(String[] as) //defining main method
{
final double over_time_factor = 1.5; //define final variable
double number_Of_hours,wages,total_Wages=0; //defining variables
System.out.println("Enter hours and wages rate:"); //print message
Scanner obc = new Scanner(System.in); //creating Scanner class object for user input
number_Of_hours = obc.nextDouble(); //taking input
wages = obc.nextDouble(); //taking input
if(number_Of_hours>40) //check condition if number_Of_hours greter then 40
{
total_Wages=40*wages+(number_Of_hours-40)*wages*over_time_factor; //calculate value
}
else //else part
{
total_Wages = number_Of_hours*wages; //calculate total_Wages
}
System.out.println("Total Wages: $"+total_Wages); //print value
}
}
Output:
Enter hours and wages rate:
12
3
Total Wages: $36.0
Explanation:
In the above java program, the package is first imported into the user input and then the class is defined and inside this, the main method is defined, that defines a double type final variable "over_time_factor" is defined that holds a value "1.5", Then double type variable is defined that are " number_Of_hours, wages, and total_Wages", in which first two variables are used for taking input from the user and the third variable is used to calculate their values. After taken input from the user, the conditional statement is used that can be defined as follows:
Answer:
A. placing a found virus in a secure area on the hard drive
Explanation:
When a file is defected in a computer, quarantining is applied to prevent other parts of the computer. The infected file is isolated and if you let your antivirus software, it can delete the infected file.
Answer:
The program written in C++ is as follows; (See Explanation Section for explanation)
#include <iostream>
using namespace std;
void revstring(string word)
{
string stringreverse = "";
for(int i = word.length() - 1; i>=0; i--)
{
stringreverse+=word[i];
}
cout<<stringreverse;
}
int main()
{
string user_input;
cout << "Enter a string: ";
getline (std::cin, user_input);
getstring(user_input);
return 0;
}
Explanation:
The method starts here
void getstring(string word)
{
This line initializes a string variable to an empty string
string stringreverse = "";
This iteration iterates through the character of the user input from the last to the first
for(int i = word.length() - 1; i>=0; i--) {
stringreverse+=word[i];
}
This line prints the reversed string
cout<<stringreverse;
}
The main method starts here
int main()
{
This line declares a string variable for user input
string user_input;
This line prompts the user for input
cout << "Enter a string: ";
This line gets user input
getline (std::cin, user_input);
This line passes the input string to the method
revstring(user_input);
return 0;
}
Picture:
1. Motherboard
2. Power Supply
3. CPU (Central Processing Unit)
4. Random Access Memory (RAM)
5. Hard Disk Drive/Solid State Drive
6. Video Card
7. Optical Drives
8. Input and Output Devices
Answer:
I think 2.power supply yaar
Answer:
All of these
Explanation:
A peer-to-peer network is a type of computer network that computer devices directly to each other, sharing information and other resources on the network.
It does not have a centralized database, there are no master or slave as each device in the network is a master on its own, and the devices all have unique addresses assigned statically for identification.