Answer:
The TCP/IP is the transmission control protocol and internet protocol and in the TCP/IP model the transport layer is the second layer.
The primary responsibility of this layer is that it is basically used to deliver messages to the host and that is why it is known as end to end layer.
It basically provide the point to point connection between the destination to server host for delivering the various types of the services efficiently and reliably.
In the TCP/IP model the transport layer are basically responsible for transferring the data or service error free between the server to destination host.
.When an argument is passed ______________, the called method can access and modify the caller’s original data directly.
a.either by value or by reference
b.by value
c.using keyword ref
Answer:
c.using keyword ref
Explanation:
In C# when we have pass any variable by reference we use the ref keyword. When we pass a variable by reference in the function the changes done in the function are directly happening on the original variables.
When a variable is passed by value a copy of these variable is created in the function and the operation is done on those copies.No changes can be seen on the original variables.
Hence the answer is option c.
Convert decimal number 262 to an octal number.
Answer:
406.
Explanation:
continuously dividing the base 10 or decimal number by 8 till the decimal number does not becomes zero and the result is the remainders in reverse.
Remainder on 262 / 8 = 6.
Remainder on 32 / 8 = 0.
Remainder on 4 / 8 = 4.
Octal number=406.
To convert decimal 262 to octal, divide by 8 and write down remainders. Continue until quotient is zero. Writing remainders in reverse order gives the octal number 406.
Explanation:To convert the decimal number 262 to an octal number, you need to divide the number by 8 and write down the remainder. Continue the process with the quotient until the quotient is zero. Let's break it down step-by-step:
Now, write the remainders in reverse order to get the octal number. So, 262 in decimal is 406 in octal.
An external entity may be: (1 point) (Points : 1.5) a person.
another department.
another computer system.
All of the above.
Answer: All of the above
Explanation: External entity is the thing that belongs to the outside surface or environment.In relation with the organizational field , external entity is the any outside source that is not a part of the organization.A person can be external entity if he/she is not a part of organization or employee.
Another department can be external entity with respect to a particular department of the same organization ,E.g.- Finance department can be external entity for the human resource department and vice-versa.
Computer system belonging to a person can be external entity for the other employee even being in same or different department of the organization E.g.- Employee 1 has computer system and it is a external source for the employee 2 because it does not belong to him and is outside of the his surrounding .
Thus, all the options are correct.
write a program that does the following: 1. Declare the string variables firstname and last name. 2. Prompt the user for first name and last name. 3. Read in the first name and last name entered by the user. 4. Print out Hello follow by users full name. These questions could be found from this book C++ without fear second edition by Brian overland
Answer:
// here is code in c++.
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variable declaration
string firstname,lastname;
// ask to enter first name
cout<<"enter the first name:";
// read firs tname
cin>>firstname;
// ask last name
cout<<"enter the last name:";
// read last name
cin>>lastname;
// print the output
cout<<"hello "<<firstname<<" "<<lastname<<endl;
return 0;
}
Explanation:
Part 1, declare variables "firstname" and "lastname".Part 2, Ask user to enter first and last name.Part 3, read the value of first and last name and assign to variables "firstname" and "lastname" respectively.Part 4, Print "hello" followed by first name and last name.
Output:
enter the first name:robert
enter the last name:doweny
hello robert doweny
Write a method with the signature "boolean[] createAlternating(int length)" that takes an integer representing the size of an array, and then returns a new boolean array of that size where each index alternates between true and false (e.g., index 0 is true, index 1 is false, index 2 is true, and so on).
Answer:
// program in java.
import java.util.*;
// class definition
class Main
{
// mthod that fill the array with true and false
public static boolean [] createAlternating(int length)
{
// create array
boolean arr[]=new boolean[length];
// fill the array
for(int a=0;a<length;a++)
{
if(a%2==0)
arr[a]=true;
else
arr[a]=false;
}
// return array
return arr;
}
// main method
public static void main (String[] args) throws java.lang.Exception
{
try{
// scanner object to read input
Scanner scr=new Scanner(System.in);
System.out.print("Enter the size: ");
// read the size
int n=scr.nextInt();
// store the array
boolean []copy = createAlternating(n);
// print the array elements
for(int i=0;i<n;i++)
System.out.print(copy[i]+" ");
}catch(Exception ex){
return;}
}
}
Explanation:
Read the size of array from user with Scanner object.call the method createAlternating() with parameter length.Then create an array of size length.Fill the array true at even index and false at odd index.return the array and print the elements.
Output:
Enter the size: 10
true false true false true false true false true false
a = [2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 33 34 35 36 37 38 39 40]
b = [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 43 45 47 49 50 54 59 60]
In MATLAB, only using fully-vectorised code (ie. no loops) divide A by B element by element.
Answer:
[tex]C = a./b[/tex]
Explanation:
In MATLAB, the following command:
[tex]C = A./B[/tex]
Performs the element by elemet division of A and B. This comand is called Right-array division.
So, in your case, we could divide A by B element by element, only using fully-vectorised code (ie. no loops), with the following code:
[tex]a = [2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 33 34 35 36 37 38 39 40];
b = [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 43 45 47 49 50 54 59 60];
C = a./b[/tex];
C would be the element by element division of A and B, with no loops.
What are some kinds of Web sites that should prohibit anonymity and why?
Answer:
Some websites like proxy bypass and virtual private network (VPN) prohibited the anonymity as it affected the surfer during long rum in the system.
The proxy bypass is the type of the server that mainly used in the local address. The proxy is the type of he intermediate server which basically stand in the computer and also in the remaining part of the internet. This is basically used in the corporate for the network protection for using the content in the system.
mkdir() is the command in Java to create a new directory.
a) True b) False
Answer:
True.
Explanation:
mkdir() method in java is a part of the file class.The mkdir() command is used to create a new directory and it is denoted by the path name that is abstract.This function mkdir() returns true if the directory is created and false if the directory is not created by this function.
Hence the answer for this question is True.
Why is WPS desirable?
Answer:
WPS is known as wireless protected setup that is basically used for the wireless security purpose. The WPS system is basically make the connection easily between the router and other network devices.
The WPS desirable as it make the connection and configuration of the network more simple with the given access point.
In WPS, the users contain the pin and it is 8 digit long pin that is basically associate with the access point.
What are the arguments for writing efficient programs even though hardware is relatively inexpensive?
Answer: Even though the hardware is inexpensive the writing of program is not efficient through this method as proper development of program is necessary for the clear execution due to factors like:-
The facility of writing program even the cost of hardware is less but it is not a free facility.It also has a slower processing for the execution of the programThe construction of the efficient program is necessary for the compilation and execution of it rather than poorly constructed program is worthless and inefficient in working.What is the difference between the subu instruction and the sub instruction? State how will the processor behave differently for these instructions.
Answer:
The subu instruction are the type of the immediate arithmetic operation which basically give the binary result in the 32 bits that are stored in the destination register.
The subu instruction typically represent as subtract unsigned. It basically check the overflow of the unsigned number.
The sub instruction basically subtracts the second source operand from the principal source operand, and stores the outcome in the goal operand. This instruction basically used in the pseudocode to perform various tasks.
write c++ program bmi.cpp that asks the user bmi.cpp the weight (in kilograms) and height (in meters).
The program then calculates and writes to the screen BMI (body-mass index) that user with two decimal places.
Answer:
// here is code in C++(bmi.cpp).
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variables
float weight,height;
cout<<"enter the weight(in kilograms):";
//read the weight
cin>>weight;
cout<<"enter the height(in meters):";
//read the height
cin>>height;
// calculate the bmi
float bmi=weight/(pow(height,2));
// print the body-mass index with two decimal places
cout<<"BMI is: "<<fixed<<setprecision(2)<<bmi<<endl;
return 0;
}
Explanation:
Read the weight from user and assign it to variable "weight",read height and assign it to variable "height".Then find the body-mass index as (weight/height^2).Here weight should be in kilograms and height should be in meters.
Output:
enter the weight(in kilograms):75
enter the height(in meters):1.8
BMI is: 23.15
Final answer:
The C++ program calculates a user's BMI by asking for their weight in kilograms and height in meters, then outputs the result with two decimal places using the formula BMI = Weight / height².
Explanation:
The Body Mass Index (BMI) is an important measurement used to categorize weight categories that could lead to health issues. In this C++ program, the user will be prompted to enter their weight in kilograms and height in meters. The program will then calculate their BMI using the formula BMI = Weight / height² (kg/m²), and display it on the screen with two decimal places.
Here is a sample C++ program that calculates BMI:
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
double weight, height, bmi;
cout << "Please enter your weight in kilograms: ";
cin >> weight;
cout << "Please enter your height in meters: ";
cin >> height;
bmi = weight / (height * height);
cout << "Your BMI is " << fixed << setprecision(2) << bmi << endl;
return 0;
}
The program ensures the BMI is presented with two decimal places using the iomanip library functions fixed and setprecision. After compilation, the user can run the program, input their data, and get their BMI value on the screen.
When a block exists within another block, the blocks are a) structured b) nested c) sheltered d) illegal
In programming, when a block exists within another block, it is described as nested. Nesting is a common and logical structure used to organize code.
When a block exists within another block, the blocks are b) nested. In the context of computer science, especially in programming, nesting refers to having one set of instructions inside another set.
This is a common structure in many programming languages where, for example, you can have a conditional statement inside a loop, or one function defined within another. Nesting helps in organizing code logically and can make the code easier to read and maintain.
Convert binary number 11101111.10111 to decimal
Answer:
[tex]N_{10}=239.71875[/tex]
Explanation:
In order to obtain the decimal number we have to use the next formula:
[tex]N_(10)=d*2^{(i)}\\where:\\N=real number\\d=digit\\i=position[/tex]
(The position to the right of the decimal point we will take it as negative)
Using the formula we have:
[tex]N_{10}=(1*2^7+1*2^6+1*2^5+0*2^4+1*2^3+1*2^2+1*2^1+1*2^0+1*2^{-1}+0*2^{-2}+1*2^{-3}+1*2^{-4}+1*2^{-5})[/tex]
[tex]N_{10}=239.71875[/tex]
Write a program that applies the Euclidean algorithm to find the greatest common divisor of two integers. Input should be two integers a and b and output should be the greatest common divisor of a and b. Test your program with several examples using both positive and negative values for a and b.
Answer:
// here is code in c++.
#include <bits/stdc++.h>
using namespace std;
// function that return greatest common divisor
int g_c_d(int num1, int num2)
{
if (num1 == 0)
return num2;
return g_c_d(num2 % num1, num1);
}
// main function
int main()
{
// variables
int num1,num2;
cout<<"enter two numbers:";
// read two numbers from user
cin>>num1>>num2;
// call the function and print the gcd of both
cout<<"greatest common divisor of "<<num1<<" and "<<num2<<" is "<<g_c_d(num1.num2)<<endl;
}
Explanation:
Read two numbers from user and assign them to variables "num1" and "num2".Call the function g_c_d() with parameter "num1" and "num2".According to Euclidean algorithm, if we subtract smaller number from the larger one the gcd will not change.Keep subtracting the smaller one then we find the gcd of both the numbers.So the function g_c_d() will return the gcd of both the numbers.
Output:
enter two numbers:5 9
greatest common divisor of 5 and 9 is 1
enter two numbers:-25 15
greatest common divisor of -25 and 15 is 5
The Euclidean algorithm is used to find the greatest common divisor of two integers, which is implemented in a Python program that works with both positive and negative integers. An example demonstrates that the GCD of 48 and 18 as well as -48 and 18 is 6.
The question involves writing a program that uses the Euclidean algorithm to calculate the greatest common divisor (GCD) of two integers. The Euclidean algorithm is a method for finding the greatest common divisor of two numbers, which is the largest number that divides both of them without leaving a remainder.
The program will take two integers as input and provide their greatest common divisor as output. To accommodate both positive and negative input values, the algorithm can be implemented as follows in Python:
def gcd(a, b):
while b != 0:
a, b = b, a % b
return abs(a)
# Examples using the function
gcd_result1 = gcd(48, 18)
print(f'The GCD of 48 and 18 is {gcd_result1}')
# The function can also handle negative values
gcd_result2 = gcd(-48, 18)
print(f'The GCD of -48 and 18 is {gcd_result2}')
This example demonstrates that the greatest common divisor of 48 and 18 is 6, and the GCD of -48 and 18 is also 6 because the GCD is always a non-negative number.
Assume a 8x1 multiplexer’s data inputs have the following present values: i0=0, i1=0, i2=0, i3=1, i4=0, i5=0, i6=0, i7=0. What should be value of the select inputs s2, s1 and s0 for the value on the multiplexer’s output d to be 1?
s2=
s1=
s0=
Answer: s₂ = 0 s₁ = 1 s₀ = 1
Explanation:
In brief, a multiplexer is a digital circuit (generally buit with combiantional logic) , that selects one of the inputs to be present at the output, based on the combination of the values present in auxiliary inputs called select inputs.
As a rule, the number of inputs (m) and the number of select inputs (n) satisfy this condition: m = 2ⁿ
At any time, the input which order, be equal to the binary combination of the select inputs, will be present at the output.
In our case, being an 8x1 multiplexer, we will have 3 select inputs, denoted as s₂, s₁, s₀.
The only input which current value is "1", is i3, so, in order to send an "1"to the output, the binary combination at the select inputs must match the number of the input to be selected, i. e., 3.
So, s₂s₁s₀ must be read as 3 in binary; 011, so s₂=0 s₁=1 s₀= 1.
Which database property type increases the efficiency of a search on the designated field in the physical database?
Validation rule
Validation text
Indexed
Expression
Answer: Indexed
Explanation: Indexed property in the database system is for indexing .In this process reduction of the record/disk numbers results in the increase in the optimized performance. The structure of the index is in column form.
This technique rapidly provides the data from the table containing database when every query arises or requirement is proposed. Therefore the efficiency of the database increases.
Other options are incorrect because validation rule and text are regarding the verification of the data user and text respectively and expression is defined as the group of one or more value.Thus the correct option is indexed.
The File method lastModified() returns
a) date b) int c) double d) long e) specified by the programmer f) none
Answer: d) long
Explanation: The lastModified() is a function found in the Java class.This function returns a value in the long form in the File method.It represents the time in the long value which denotes the last time the file was modified.In case of exception error ,0L value is returned.
Other options are incorrect because int and double because it has 32 bit integer form and 64 bit float form respectively whereas lastModified() function works in 64 bit having two's complement integer.The return type cannot be specified by programmer.Thus the correct option is option(d).
Explain how for loops can be used to work effectively with elements in an array?
Explanation:
There are three types of loops in programming languages which are as following:-
for.while.do while.The syntax for all the three loops is different.You will see mostly for loop used with the arrays because they are easy to implement.
the syntax of for loop is :-
for(int i=initial value;condition;i++)
{
body
}
In for loops you only have to write the conditions in only line else is the body of the loop.
for example:-
for array of size 50 printing the each element
for(int i=0;i<50;i++)
{
cout<<arr[i]<<" ";
}
You have to initialize i with 0 and the condition should be i<size of the array and then increase the counter.
correct answers plz
[tex] \sqrt{x-8} = 3[/tex]
Answer:
x = 17
Explanation:
[tex]\sqrt{x-8} = 3\\\\\sqrt{x-8}^{2} = 3^{2} \\\\\\x - 8 + 8 = 9 + 8\\ \\x = 17[/tex]
Hey!
-----------------------------------------------
Steps To Solve:
~Square both sides
√x - 8² = 3²
~Simplify
x - 8 = 9
~Add 8 to both sides
x - 8 + 8 = 9 + 8
~Simplify
x = 17
-----------------------------------------------
Answer:
[tex]\large\boxed{x~=~17}[/tex]
-----------------------------------------------
Hope This Helped! Good Luck!
Create a class Book with two private int fields, numPages and currentPage. Supply a constructor that takes one parameter and sets numPages to that value and currentPage to 1. Provide accessor methods for both fields. Also provide a method nextPage that increments currentPage by 1, but only if currentPage is less than numPages.
Answer:
The code is in the explanation.
Explanation:
/*Creating the class*/
public class Book{
/*Here we put the attributes of the class;
In our case, they are the two private ints*/
private int numPages;
private int currentPage;
/*Here is the constructor.
The constructor always has the same name as the class
In (), are the parameters.*/
public Book(int numberOfPages){
numPages = numberOfPages; /*sets numPages to the value
of the parameter*/
currentPage = 1; /*sets currentPage to 1*/
}
/*An acessor method is a method with which we can get the value of a variable*/
/*Acessor method for numPages*/
/*numPages is an int, so the acessor method returns an int*/
public int getnumPages(){
return numPages;
}
/*Acessor method for currentPage*/
public int getcurrentPage(){
return currentPage;
}
/*Method next page*/
/*This method does not return anything, so it is a void method*/
public void nextPage(){
/*Verify that currentPage is less than numPages*/
if (currentPage < numPages){
currentPage = currentPage + 1;
}
}
}
The Java class Book contains private fields numPages and currentPage. Its constructor sets numPages to a given value and currentPage to 1. Accessor methods retrieve these values. The nextPage() method increments currentPage by 1 if it's less than numPages.
Here's the implementation of the Book class in Java:
```java
public class Book {
private int numPages;
private int currentPage;
public Book(int numPages) {
this.numPages = numPages;
this.currentPage = 1;
}
public int getNumPages() {
return numPages;
}
public int getCurrentPage() {
return currentPage;
}
public void nextPage() {
if (currentPage < numPages) {
currentPage++;
}
}
}
```
This Book class has two private fields: `numPages` and `currentPage`. The constructor initializes `numPages` with the given value and sets `currentPage` to 1. Accessor methods `getNumPages()` and `getCurrentPage()` return the values of the respective fields. The `nextPage()` method increments `currentPage` by 1 if it's less than `numPages`.
What is the software that provides the mechanisms to access a database called?
Answer:
Database Management Software.
Explanation:
The software that provides the mechanism to access the database is called Database Management Software.There are two types databases SQL and No SQL.There are various types of database Management Software present online for ex:-My SQL,Microsoft SQL server,Microsoft Access,Postgres SQL,Mongo DB etc.
Convert AB4F from hexadecimal to binary.
Answer:
AB4F=1010101101001111.
Explanation:
Every bit of hexadecimal number is a 4 bit binary number.So to convert a number from hexadecimal to binary number by finding the corresponding binary number for each bit of hexadecimal number and then write it in the same sequence.
A=1010
B=1011
4=0100
F=1111
Writing in the same sequence of the hexadecimal number.
AB4F = 1010101101001111.
. The _____________ is the responsibility of the CISO, and is designed to reduce incidence of accidental security breaches by organization members.
Answer: SETA program
Explanation:
The SETA program is basically stand for the security, education, training and awareness. It is basically used to reduce the accidental security which is break by the organization member such as employees, vendors and contractors.
The SETA program provided various benefits to the organization as it improve the behavior of the employees.It basically enhance the training and education program by focus and concentrate on the information security.
It can also inform he member of the organization about the report of violating many policies.
Write a statement that computes the square root of a variable called discriminant
and stores the value in a variable called result.
Answer:
// here is statement in C++ to compute square root of a variable.
double result=sqrt(discriminant);
Explanation:
Sqrt() method will compute the square root of a variable in C++.Read a value of discriminant and find the square root of it and assign it to variable "result".
Implementation in C++.
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variables
double discriminant;
// ask to enter discriminant
cout<<"Enter the discriminant:";
// read discriminant
cin>>discriminant;
double result=sqrt(discriminant);
cout<<"Square root of discriminant is:"<<result<<endl;
return 0;
}
Output:
Enter the discriminant:50
Square root of discriminant is:7.07107
______The component of a computer that contains the ALU (Arithmetic Logic Unit) is the RAM. (T/F)
Answer: False
Explanation:
The given statement is false as, the component of the computer basically contain the arithmetic logic unit (ALU) in the central processing unit (CPU). The CPU operations are basically performed by the one and more than one arithmetic logic unit.
It is basically load the data from the input register in the computer system. The CPU basically provide various instruction and operation to the ALU so that it can perform various types of operation in the data.
The ALU stored the result in the output register of the system.
In UML behavioral modeling, a message is _____. (Points : 6) a named location in memory where information is deposited and retrieved
a data structure to hold information
a function or procedure call from one object to another object
a relationship between two objects
Answer: a function or procedure call from one object to another object
Explanation: UML(Unified Modeling language) behavioral modeling is the depiction of the relation of the elements in a dynamic manner and the dependency on time .Message in the UML behavioral modeling is a functional call taking place from one element to another.
The interaction is the model is seen through the flow of messages.Other options are incorrect because message is not information holding data structure, does not display the relation between object rather presents the flow and is not a memory location .
A car holds 16 gallons of gasoline and can travel 312 miles before refueling. Write aC++ program that calculates the number of miles per gallon the car gets. Display the result on the screen.
Answer:
// here is code in C++.
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variables Declaration and initialization
int no_gallon=16;
int dis=312;
// find the miles per gallon
double mile_gallon=dis/double(no_gallon);
// print the results
cout<<"number of gallons: "<<no_gallon<<endl;
cout<<"distance travel before refueling: "<<dis<<endl;
cout<<"miles per gallon is: "<<mile_gallon<<endl;
return 0;
}
Explanation:
Declare and initialize the number of gallon and distance travel without refueling. Calculate the miles per gallon by dividing distance with number of gallons.Then print the results.
Output:
number of gallons: 16
distance travel before refueling: 312
miles per gallon is: 19.5
Final answer:
The C++ program calculates miles per gallon by dividing the total distance traveled by the number of gallons of gasoline, then displays the result.
Explanation:
The question involves writing a C++ program that calculates the fuel economy of a car, specifically the number of miles per gallon (MPG) the car gets. Below is a sample C++ program that performs this calculation:
#include <iostream>
.Writе a call to function calculatеAvеragе(), passing it rainfall
Answer:
calculateAverage(rainfall);
Explanation:
The above written statement is for calling a function calculateAverage() in the main function passing rainfall as the argument in it.
Always remember when calling a function you should store the result of the function in the same return type as the function except void.If the return type of the function is void then you don't need to store it in any variable.
A(n) --------- statement is displayed on the screen to explain to the user what to enter
Answer: Prompt
Explanation:
The prompt statement is basically used to define the users about the details that what to enter on the screen that is displayed and sort the input data so that it can easily enter.
In the program, the prompt statement and the dialog boxes are used to enter the input data or information in the terminal screen and window.
For example:
In the C++ language, the std::cout function is basically used for the output value and the std::cin function is used to get the input value.
In the java programming, the system.out.ptintln() function is basically used to tell the users to enter the input value in the program.