Answer:
Period of the given wave is 0.5 milliseconds.
Explanation:
We are given the frequency of the wave as 2 KHz
We know the relation between period and frequency of a wave is given by
[tex]Period=\frac{1}{frequency}[/tex]
Applying the given values we get
[tex]Period=\frac{1}{2\times 10^{3}}\\\\\therefore Period=0.5\times 10^{-3}seconds[/tex]
Thus period is 0.5 milliseconds.
What is ‘Software Quality Assurance’?
Answer: Software quality assurance is considered as the means under which one monitors the software processes and techniques used in order to ensure quality. The techniques using which this is attained are varied, and thus may also include ensuring accordance to more than one standards. It is referred to as a set of techniques that ensures the quality of projects in software process. These mostly include standards that administrators use in order to review and also audit software activities, i,e, these software meet standards.
When no class constructors are supplied by the author of a class, C++ itself supplies a default constructor that does nothing.
Select one:
a. TRUE
b. FALSE
Answer:
The correct answer for the given question is an option(a) i.e "TRUE".
Explanation:
A constructor is those who initializes the object of a class it means they are used to initializes the member variable of a class.
When no constructor is supplied by the author in the class. There is always a default constructor is created when we create an object for the class. The object of the class automatically created a default constructor.
Hence the given statement is "true" .
Which of the following devices is used to connect multiple devices to a network and sends all traffic to all connected devices? (Please select one of the four options)
Switch
Modem
Hub
Repeater
Answer: HUB
Explanation:
A Hub is a network device, that acts only in layer 1 (Physical layer) forwarding all traffic that reaches to the input port, to all output ports at once, without processing the received data in any way that could modify them.
It behaves like it were a multiport repeater (which has only one output port).
Explain the relationship between the binary numbering system and the function provided by the transistor.
Answer:
The relation is the Voltage levels.
Explanation:
Basically the relation is related with voltages levels, that is, the computer has the main component called mother-board this component is the "brain" of the computing systems made of something called microprocessors, intel has core i7,i9 dual core, etc. The mother-board manage the information and save information in the memories, usually Random Access Memory (RAM) and hard disk, this information is understood by the computer as ones (1) and zeros(0), that means, that the computer process logic levels or binary numbers.
Since the beginning of computer developments was in this way because facilitates the process of computing, and the transistor was an excellent candidate for doing this because the device is scalable, and consumed less power than vacuum tubes that was used in 70's, more or less. There are configurations of transistor that allow use a binary numeric system, such as NOT,OR and AND gates, these are the base of all computers, the computers are made of millions of this gates made with transistors, for example, the attached picture has a NOT gate, suppose that is wired to VDD volts and is refereed to ground GND or zero ( 0 )volts, if a voltage level close to GND is aplied in the input the output is VDD, and if a voltage close to VDD is applied to the input the output will be GND.
In other words the logic levels are read by the computer as ones and zeros but these are voltage levels that could be measured with voltmeters or specialized equipment and are produced by transistors configurations as presented in this answer.
LOGIC LEVELS WHERE THE VOLTAGE VDD IS 1 AND GND IS 0
INPUT:
1 ______ 1 ______
0___| |_________0____| |_____
OUTPUT
1 ___ _______________ _____
0 |______| |______|
What error can you identify? (Points : 4)
A double quotation mark was incorrectly inserted.
You cannot compare apples to oranges.
Assumes indentation has a logical purpose
No error
Answer:
Assumes indentation has a logical purpose
Explanation:
No period
How many bits are necessary for a binary representation (unsigned) of:
a. The states of the U.S.A.?
b. The days in a year?
c. The inhabitants of California (est. 36,457,549)?
Answer:
Hi!
The answer to:
a. 6 bits.
b. 9 bits.
c. 26 bits.
Explanation:
a. For the states of the U.S.A, you need 50 or more combinations to represents each element.
If you use 6 bits, the possible combinations are 2⁶ = 64.
b. For days in a year, you need 365 or more combinations to represents each element.
If you use 9 bits, the possible combinations are 2⁹ = 512.
c. For inhabitants of California, you need 36,457,549 or more combinations to represents each element.
If you use 26 bits, the possible combinations are 2²⁶ = 67,108,864. If you use 25 bits instead of 26, then you have 2²⁵ = 33,554,432 combinations. These possible combinations are not enough to represent each inhabitant.
Business service management is an approach for linking __________ or metrics of IT to business goals to determine the impact on the business.
a. key performance indicators (KPIs)
b. critical success factors (CSFs)
c. scorecards
d. financials
Answer:a) Key performance indicators (KPIs)
Explanation: Key performance indicators are the measurement key for evaluation of the performance of the organization on the basis of long time period. They help in providing the knowledge about the business's financial achievement , organizational plan, and other factors.
It is creates the factor/goal that should be focused more for improvement of the business.It creates the critical key so that the progress in the achieving the goal evaluated can be done.
Other options are incorrect because critical success factor(CSF) is the factor for achieving successful and positive outcome in business ,scorecard are for the noting the score of positive and negative factors and financial is the term for the finance and money in the business.Thus the correct option is option (a).
Suppose we have a String object called myString. Write a single line of Java code
that will output myString in such a way that all of its characters are uppercase.
Answer:
myString=myString.toUpperCase();
Explanation:
In java to change all characters of a string to upper case we use .toUpperCase() method.It will convert string to upper case.
Implementation in java.
import java.util.*;
class Solution
{
public static void main (String[] args) throws java.lang.Exception
{
try{
Scanner scr=new Scanner(System.in);
System.out.print("Enter a string:");
String myString=scr.nextLine();
myString=myString.toUpperCase();
System.out.println("string in upper case : "+myString);
}catch(Exception ex){
return;}
}
}
Output:
Enter a string:hello
string in upper case : HELLO
Final answer:
To output myString in uppercase, use the code: System.out.println(myString.toUpperCase()); which utilizes Java's .toUpperCase() method.
Explanation:
To convert a String object called myString to uppercase using Java, you would use the .toUpperCase() method. The following line of code will accomplish that and output the uppercase version of myString:
System.out.println(myString.toUpperCase());
This line will print the contents of myString to the console, with all characters in uppercase, fulfilling the task requirements.
The `toUpperCase()` method in Java converts all characters in a string to uppercase. By calling this method on `myString` and then printing the result, the program outputs the uppercase version of `myString`.
What is wrong with the following code? How should it be fixed?
1 public class H2ClassH {
2 final int x;
3
4. int H2ClassH () {
5 if (x == 7) return 1;
6 return 2; 7 } // end 8 } // end class H2ClassH
Answer:
Final variable x is not initialized.
Explanation:
In this JAVA code we have a final variable named x.The thing with final variable is that they act like constants in C++.Once initialized cannot be changed after that and we have to initialize them at the time of declaration.
In JAVA if we do not initialize the final variable the compiler will throw compile time error.Final variables are only initialized once.
Which of the following class represent an abstract class? (Points : 2) class Automobile {
void drive();
}
class Automobile {
void drive ()=0;
}
class Automobile {
virtual void drive ()=0;
}
class Automobile {
void drive (){}
}
Answer:
class Automobile {
virtual void drive ()=0;
}
Explanation:
In C++, an abstract class is one which cannot be instantiated. However it can be subclassed. A class containing a pure virtual function is considered an abstract class. A virtual function is preceded by the virtual keyword. For example:
virtual void drive();
In addition , if a virtual function is pure, it is indicated using ' = 0 ;' syntax.
For example:
virtual void drive() = 0;
Of the given options:
class Automobile {
virtual void drive ()=0;
}
represents an abstract class.
The abstract class in the given options is the one with a pure virtual function, which is 'class Automobile { virtual void drive ()=0; }'.
Explanation:An abstract class is a class that cannot be instantiated on its own and is typically used as a base class for other classes. In C++ programming language, an abstract class is defined by having at least one pure virtual function. Looking at the given options, the class that represents an abstract class is the one that declares a pure virtual function with the syntax '=0' after the function declaration.
Therefore, the correct option is:
class Automobile {The presence of the keyword virtual followed by '=0' in the function declaration indicates that the drive function is a pure virtual function, making the Automobile class abstract.
. Explain the notions of WAN, LAN, MAN and PAN.
Answer:
Explanation:
WAN (Wide Area Network), is a computer network that joins several local networks, although their members are not all in the same physical location.LAN (Local Area Network) is a network of computers that cover in a small area for example a house, an apartment or a building. One part of the topological definition is the physical topology, which is the actual arrangement of the cables or media.MAN (metropolitan area network) is a network of computers that interconnects users with computer resources in a geographic area or region larger than area covered by a large local area network (LAN)PAN (Personal Area Network.) Is a network used to connect different personal computer devices centered on an individual person workspace.Final answer:
Networks are categorized into WAN, LAN, MAN, and PAN based on their geographical coverage and usage, ranging from expansive (like the internet) for WAN, to personal space for PAN. Wi-Fi is a common technology used for creating LANs that allow devices to connect wirelessly within a certain area.
Explanation:
Networks come in various sizes and are categorized based on their geographical span and usage. Here we explore four kinds: Wide Area Network (WAN), Local Area Network (LAN), Metropolitan Area Network (MAN), and Personal Area Network (PAN).
WAN is a network that covers a broad area, potentially spanning countries or continents. It can be made up of multiple LANs and connects devices across long distances, such as the internet. LAN, on the other hand, is restricted to a small geographical area, typically a single building or campus, and offers high data transfer rates. It is commonly used in homes, schools, and offices.
MAN encompasses a larger area than LAN but smaller than WAN, often spreading across a city or metropolitan area. It is useful for connecting several LANs within that city to allow networks to communicate with each other. Lastly, PAN is the smallest network, intended for personal use within a range of a few meters. It typically involves devices like smartphones, tablets, and wearables interacting with each other.
Wi-Fi is a widely adopted technology enabling wireless LANs, described by the IEEE 802.11 series of standards. It's a key part of many networks, providing connectivity in homes, offices, and public hotspots. People might pay a monthly fee or get access for free, depending on the business model of the ISP or facility providing the Wi-Fi service.
Enter the name of your school or work URL and generate report.What score did it receive?
Answer:
Harold Washington College. 21.1
____________ is a hardware or software tool for recording keystrokes on a target system.
Keyboard
KeyScanner
Keylogger
RootKit
Answer: Key-logger
Explanation: Key-logger is the device that is used in the capturing the keystrokes of the user and then recording it .They can be in the form of software or hardware.The recording made by key logger consist the data typed through the keyboard like email, messages, passwords .
Other options are incorrect because keyboard is the hardware device used for inputting data in the system, key-scanner is the input reading device in the form of library and rootkit is malicious collection of software to disturb the function of the computer system.Thus the correct option is key-logger.
A keylogger, which can be software or hardware, records keystrokes on a computer to capture sensitive information like passwords. Rootkits, in contrast, provide backdoor access to systems.
The correct answer to the question is Keylogger. A keylogger is a tool that can be either hardware or software, designed for the purpose of capturing keystrokes on a computer system. Once activated, it records every key pressed and sends this information to an attacker or stores it for retrieval. In contrast, a rootkit is a type of malware that provides unauthorized users with administrative access to a computer system, often without being detected.
Keyloggers are considered a form of spyware because they covertly monitor and record users' keystrokes, which can include sensitive information like passwords and personal data. The information captured by keyloggers can be used for malicious purposes, such as identity theft or unauthorized access to secured systems.
Typically, the first item in defining a function is _____. (Points : 4)
an open curly brace "{"
passing an argument
passing the function
naming the function
Answer: Naming the function
Explanation:
The first item for defining the function is the naming of the function. In the function, the first line is known as header and rest of the function is known as body of the function.
The function name is the first step while defining the proper function as we can define the actual function name on which the program are rest based.
We can define a function from which the each value from the set of the components are basically associated with the second component in that particular function.
SYN segments have ________.
headers
headers and data fields
headers, data fields, and trailers
data fields only
Answer: Headers
Explanation:
SYN segment is known as synchronization and the SYN sends the signal and then sending the a request to the server. The synchronization segment only include header and it does not carry any type of the data field as, the information are basically convey in the form of opening connection.
The SYN message only include the ISN number of the client as ISN is the initial sequence data number. And it also does not include any trailers.
Write a Function procedure that determines whether a given Integer is divisible by 5 or not. The function should accept one argument having a data type of Integer and return True if that Integer is divisible by 5, False otherwise.
Answer:
bool isdivisor(int x) // function definition
{
if(x%5==0) // check Integer is divisible by 5
{
return true;
}
else
{
return false;
}
}
Explanation:
#include <iostream>// header file
using namespace std; // using namespace std;
bool isdivisor(int num); // prototype
int main() // main function
{
bool t; // bool variable
int num; // variable declarartion
cout<<" enter the num:";
cin>>num; // input number
t=isdivisor(num); // calling
if(t)
cout<<" number is divisible by 5 ";
else
cout<<" number is not divisible by 5";
return 0;
}
bool isdivisor(int x) // function definition
{
if(x%5==0)
{
return true;
}
else
{
return false;
}
}
Output:
enter the num:50
number is divisible by 5
Explanation:
In this program we have a declared a Boolean function i.e isdivisor that accept one argument of type int.
check if(x%5==0) it return true otherwise false .
How does wireshark software help us in the security realm?
Answer:
The wire-shark is the free and open source software tool that is basically used as packet analyzer for software analyzer and network troubleshooting.
The basic ability of the wire-shark it is used in the protocol development and capture the traffic in various form of the network such as wired and wireless.
It is the type of software that help in the security domain as it basically provide the software tool t filter all the traffic and problem in the software which increased the security of the system and provide high efficiency.
The IP address is a _____ bit number.
Answer: 32 bit number
Explanation:
The IP address basically contain 32 bit number as due to the growth of the various internet application and depletion of the IPV4 address. The IP address basically provide two main function is that:
The location addressing The network interface identificationThe IP address are basically available in the human readable format. The IPV6 is the new version of the IP address and its uses 128 bits.
What is percent encoding and why is it used?
Answer:
Percent encoding is the mechanism for encoding the information in the URI (Uniform resource identifier) that basically transmitted the special variable or characters in the URI to the cloud platform.
It is also used in various application for transferring the data by using the HTTP requests.
Percent encoding is also known as uniform resource locator (URL) encoding. The percent encoding basically used to convert the non ASCII characters into URL format which is basically understandable to the all the web server and browsers. In percent encoding the percent sign is known as escape character.
. In testing, what is the role of an oracle?
Answer:
The role of test oracle is to determine if a test has passed or failed. Oracle compares the outputs of the system under a test, for a given test-case input, and the output(s) that should have. A test oracle works on specifying constraints on the output(s) for a set of inputs. An oracle could be:
a program which tells if the output is correct. documentation that specifies the correct output for inputs. a human that can tell whether it is correct an output.Write one line of code to print animals, an array of Animal objects.
Answer:
console.log(Animal);
Explanation:
The statement written above prints the array Animal which contains objects.There are two to three ways to print the array Animal in javascript. One of the method is written in the answer it prints the arrays in the console of the browser.
You can go to the console by pressing F12 and then clicking on the console.
Other methods to print are
Simple write Animal after defining the array.Use alert.document.write()What is the Documenter?
Answer:
In the database, the documenter is basically used to display the properties of the selected object and use the microsoft access to display the particular object.
The database documenter basically created a particular document and report which basically contain proper detailed information and data for the every selected object.
Then, after creating the report we can easily open in the print for previewing the report in the microsoft access.
Write a program that finds the max binary tree height. (This Is an extremely short piece of code!)
Answer:
{
if(root==NULL)
return 0;
int l_height=height(root->left);//calculating height of left subtree.
int r_height=height(root->right);//calculating height of right subtree.
return 1+max(l_height,r_height);//returning the maximum from left and right height and adding 1 height of root.
}
Explanation:
The above written program is in C++.It find the height of a maximum height of the binary tree.The function uses recursion to find the height.
First the left subtree's height is calculated then right subtree's then finding the maximum from both of them and adding 1 height of the root.
(Find the number of days in a month) Write a program that prompts the user to enter the month and year and displays the number of days in the month. For example, if the user entered month 2 and year 2000, the program should display that February 2000 has 29 days. If the user entered month 3 and year 2005, the program should display that March 2005 has 31 days
Answer:
// here is code in java.
import java.util.*;
// class definition
public class Main
{
public static void main(String[] args) {
// scanner object to read input from user
Scanner s=new Scanner(System.in);
// array of months
String mon[] ={
null , "January" , "February" , "March" , "April", "May",
"June", "July", "August", "September", "October",
"November", "December"};
// array which store number of days corresponding to months
int days[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
// ask user to enter month
System.out.print("enter the month:");
// read month
int m=s.nextInt();
// ask user to enter year
System.out.print("enter the year:");
// read year
int year=s.nextInt();
// check the leap year
if(m==2 &&(((year % 4 == 0) && (year % 100!= 0)) || (year%400 == 0)))
{
System.out.println(mon[m]+" "+year+" has 29 days.");
}
else
System.out.println(mon[m]+" "+year+" has "+days[m]+" days");
}
}
Explanation:
Declare and initial month array and days array.Then read the month and year From user with the scanner object.Check if entered year is a leap year or not.Then based on the year and month print the number of days .
Output:
enter the month:2
enter the year:2000
February 2000 has 29 days.
enter the month:3
enter the year:2005
March 2005 has 31 days.
Final answer:
To determine the number of days in a month, one must consider the regular pattern where most months have 30 or 31 days and February has 28 or 29 days depending on whether it is a leap year. A program can be written to take a user's input for month and year and then calculate and display the correct number of days using validation for leap years and the known month lengths.
Explanation:
To create a program that displays the number of days in a month based on user input of the month and year, one must consider the irregularities of the Gregorian calendar. The program should take into account that most months have at least 30 days, except February, which has 28 days in a common year and 29 days in a leap year. A leap year occurs every four years, except in cases where the year is divisible by 100 but not by 400. Thus, years like 2000 and 2400 are leap years, but 1900 and 2100 are not.
A mnemonic that can help remember the number of days in each month is: 'Thirty days hath September, April, June, and November. All the rest have thirty-one, save the second one alone, which has four and twenty-four, till leap year gives it one day more.' Additionally, the 'knuckle mnemonic' can be used, where protruding knuckles represent months with 31 days and the spaces in between represent shorter months.
Example Program in Python:
month = int(input('Enter month (1-12): '))
year = int(input('Enter year: '))
if month in (4, 6, 9, 11):
days = 30
elif month == 2:
if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
days = 29
else:
days = 28
else:
days = 31
print('Number of days: ', days)
This basic Python program prompts the user for the month and year and then prints out the correct number of days in that month, considering whether it is a leap year for February.
The break statement is required in the default case of a switch selection to the exit structure properly. True/False
Answer: True
Explanation: Break statements are the statements is for the termination of the loop .It is considered as the statements that control the loop. For the default case ,default method is used in the switch selection statements.
The Switch selection statement,due to the working of the break statement will exit or terminate. Thus, the statement given in the question is correct.
Write a short program that allows the user to input a positive integer and then
outputs a randomly generated integer between 1 and the input number.
Answer:
// code in C++.
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variables
int n;
cout<<"Enter a positive number:";
// read number
cin>>n;
// check number is positive or not
while(n<0)
{
// if number is negative
cout<<"Wrong input!!"<<endl;
// ask again to enter again
cout<<"Enter again:";
// read number again
cin>>n;
}
// generate random number between 1 to n
int ran=rand()%n +1;
// print random number
cout<<"Random number between 1 to "<<n<<" is: "<<ran<<endl;
return 0;
}
Explanation:
Read a number from user.Then if input number is negative then ask user to enter a positive number again.After this generate a random number between 1 to n.Print that random number.
Output:
Enter a positive number:-12
Wrong input!!
Enter again:9
Random number between 1 to 9 is: 2
What is nominal data?
Answer:
Nominal data is the used as the scale for providing a label or topic to the variable and not providing any quantity for the measurement. It provides the data in form of symbols,character,letter etc. which is known as the qualitative measure.
They are usually collected and clustered to make the measurement according to the categories. Nominal data is known as the nominal scale.It does not act as the normal data.
Write a program that can compare the unit (per lb) cost of sugar sold in packages with different weights and prices. The program prompts the user to enter the weight and price of package 1, then does the same for package 2, and displays the results to indicate sugar in which package has a better price. It is assumed that the weight of all packages is measured in lb.
Answer:
The c++ program is given below.
#include <iostream>
using namespace std;
int main() {
double w1, p1, w2, p2, cost1, cost2;
cout << "Enter the weight of first sugar packet" << endl;
cin >> w1;
cout << "Enter the price of first sugar packet" << endl;
cin >> p1;
cout << "Enter the weight of second sugar packet" << endl;
cin >> w2;
cout << "Enter the price of second sugar packet" << endl;
cin >> p2;
cost1 = p1/w1;
cost2 = p2/w2;
if(cost1 < cost2)
cout << "Sugar in first package has better price." << endl;
else if(cost1 > cost2)
cout << "Sugar in second package has better price." << endl;
else if(cost1 == cost2)
cout << "Sugar in both packages has same price." << endl;
return 0;
}
OUTPUT
Enter the weight of first sugar packet
2
Enter the price of first sugar packet
45
Enter the weight of second sugar packet
3
Enter the price of second sugar packet
65
Sugar in second package has better price.
Explanation:
This program compares the unit cost of two sugar packages.
This program is designed to take user input but the user input is not validated since this is not mentioned in the question.
1. The double variables are declared for weights and prices for sugar in two packages.
2. Also, double variables are declared to hold the calculated values of unit cost per price for both the packages.
double w1, p1, w2, p2, cost1, cost2;
3. The program takes user input for weight and price for two sugar packages.
4. The unit cost for both sugar packages is calculated.
cost1 = p1/w1;
cost2 = p2/w2;
5. The unit cost for both packages are compared and the message is displayed on the output accordingly.
6. If the unit cost for both packages are the same, the message is displayed on the output accordingly.
7. The program ends with a return statement.
A(n) _____ is a harmful program that resides in the active memory of the computer and duplicates itself.
Worm
Virus
Keylogger
Timebomb
Answer: Worm
Explanation: Worm is the malicious software program which acts as the infection in the computer system. It has the ability to replicate itself and spread in the other systems .It is found in those parts that have automatic operation and non-noticeable.
The effect of the worm is slowing down the operations ,disturb the network etc.Other options are incorrect because virus is the malicious program that infects the host, key-loggers are used for monitoring of system and time bomb is the program for releasing the virus in computer network. Thus, the correct option is worm.
In Load/Store Architecture, memory is only referenced by load and store instructions.
True
False
Answer:True
Explanation: Load-store architecture is the architecture in the computer system field that contains the instruction collection.These sets of the instructions are dived in the two parts named as the ALU(arithmetic and logical) operation section and memory access section.
The ALU operation part handles the arithmetic calculation and evaluation between the registers whereas the memory access part handles the load and store actions only between the register and memory.Thus , the given statement is true.