Answer:
True.
Explanation:
Magnetic tape is used to store data.It is one of the oldest technology for data storage.It is suitable for high volume data and storing it for long duration.It's cost is also very less.
Magnetic Tapes are well suited for storing data for long duration because of it's durability.It's shelf life is 30-years.
To write data to a binary file you create objects from the following classes:
a.)
File and Scanner
b.)
BinaryFileWriter and BinaryDataWriter
c.)
FileOutputStream and DataOutputStream
d.)
File and PrintWriter
Answer: (C) File Output Stream and Data Output Stream
Explanation:
The File output stream and data output stream classes are basically created to write the data into the binary file. The data output steam class is the output steam used to write various data types in the java in the efficient way.
The file output steam class is basically used to create the text file and store the various type of the data into individual bytes.
The file in the file output steam class basically represent the storage of the various type of the data in the binary file.
Write a Java program HW2.java that asks the user to enter an array of integers in the main method. The program should prompt the user for the number of elements in the array and then the elements of the array. The program should then call a method named isSorted that accepts an array of and returns true if the list is in sorted (increasing) order and false otherwise. For example, if arrays named arr1 and arr2 store [10, 20, 30, 30, 56] and [2, 5, 3, 12, 10] respectively, the calls isSorted(arr1) and isSorted(arr2) should return true and false respectively. Assume the array has at least one element. A one-element array is considered to be sorted.
Answer:
The java program for the given scenario is given below.
This program can be saved as HW2.java.
import java.util.Scanner;
public class HW2 {
public static void main(String args[]) {
HW2 ob = new HW2();
Scanner sc = new Scanner(System.in);
int len;
System.out.println( "Enter the number of elements to be entered in the array");
len = sc.nextInt();
int[] arr = new int[len];
System.out.println( "Enter the elements in the array");
for( int k=0; k<len; k++ )
{
arr[k] = sc.nextInt();
}
boolean sort = ob.isSorted(arr, len);
System.out.println( "The elements of the array are sorted: " + sort );
}
public boolean isSorted( int a[], int l )
{
int sort = 0;
if( l==1 )
return true;
else
{
for( int k=1; k<l; k++ )
{
if(a[k-1] < a[k])
continue;
else
{
sort = sort + 1;
break;
}
}
if(sort == 0)
return true;
else
return false;
}
}
}
OUTPUT
Enter the number of elements to be entered in the array
3
Enter the elements in the array
1
2
1
The elements of the array are sorted: false
Explanation:
1. First, integer variable, len, is declared for length of array. User input is taken for this variable.
2. Next, integer array is declared having the size, len. The user is prompted to enter the equivalent number of values for the array.
3. These values are directly stored in the array.
4. Next, the function isSorted() is called.
5. This method uses an integer variable sort which is declared and initialized to 0.
6. Inside for loop, all elements of the array are tested for ascending order. If the 1st and 2nd elements are sorted, the loop will continue else the variable sort is incremented by 1 and the loop is terminated.
7. Other values of the variable sort indicates array is not sorted.
8. A Boolean variable, sort, is declared to store the result returned by isSorted method.
9. Lastly, the message is displayed on the output whether the array is sorted in ascending order or not.
Dicuss why you would or would not use Javadoc in your own software development company.
Answer:
The javadoc is the type of the tool which accompanies JDK and it is utilized for producing code of the java documentation in the HTML design from the source code of the java, that basically required documentation in the predefined code format.
Most of the software development company does not use javdoc because the files of the javadoc are light in weight and it can be easily traceable by using the different types of the tools.
In case of the Public javadoc, while make changing in the API system the javadoc an easily be tracked.
Continuous data
are measured in integer values.
cannot be subdivided into meaningful information.
could be subdivided into smaller and smaller units.
describe classifications or categories.
Answer: Could be subdivided into smaller and smaller units.
Explanation:
The continuous data are basically measured in the small units and can be easily subdivided into smaller parts without changing their actual meaning.
The continuous data also contain numeric value and can be divided into smaller and finer meaningful parts.
The continuous data can be measured according to the precision of the system. The size and volume are the example of the continuous data.
Why is monitoring email, voice mail, and computer files considered legal?
Explanation:
Monitoring someone's emails,voice mails and computer files is considered is illegal because you are accessing someone's personal information which is not regarded as ethical .
There are certain reasons where one's email,voice mails and computer files can be monitored are as following:
Protect the security information and security.Investigation of complaints of harassment.Preventing personal use of employer's facilities.Create a float variable named diameter. This variable will hold the diameter of a circle. d. Create a float variable named PI.
Answer:
float diameter=2*r; //hold the diameter of a circle
float PI; // float variable named PI.
Explanation:
Here we have declared two variable i.e diameter and PI of type float. The variable diameter will hold the diameter of a circle i.e 2*r where r is the radius of a circle.
Following are the program in c++
#include <iostream> // header file
using namespace std; // namespace
int main() // main function
{
float r=9.2; // variable declaration
float diameter=2*r; //hold the diameter of a circle
float PI=3.14; // float variable named PI hold 3.14
cout<<"diameter IS :"<<diameter<<endl<<"PI IS :"<<PI; // display value
return 0;
}
Output:
diameter IS :18.4
PI IS :3.14
____ refers to driving around an area with a Wi-Fi-enabled device to find a Wi-Fi network in order to access and use it without authorization.
War driving
Wi-Fi driving
Wi-Fi finding
E-stalking
Answer:War driving
Explanation: War driving is the activity which is done for searching for the Wi-Fi connection while driving vehicle .The main purpose of the war driving is gaining and accessing the network of Wi-Fi by being in slowly moving vehicle. The act is carried out by the individual or more people.
Other options are incorrect because Wifi driving and Wifi finding are not technical words in the computer field and E-stalking is the stacking activity with the help of internet enables electronic devices.Thus, the correct option is war driving.
The correct answer is Wardriving
Explanation:
Nowadays, it is common people want to access the internet most of the time even if this involves using networks without authorization by connecting a device such as a cellphone or a computer to a Wi-Fi network that is a wireless technology to access the internet. In this context, one common practice is wardriving in which you look for a Wi-Fi network by using a vehicle to move through different zones until finding one network you can access and use. This involves using networks from public places or private networks that do not require a password. According to this, it is wardriving the term that refers to driving around an area to find a Wi-Fi network to access and use it with no authorization.
Business customers pay $0.006 per gallon for the first 8000 gallons. If the usage is more than 8000 gallons, the rate will be $0.008 per gallon after the first 8000 gallons. For example, a residential customer who has used 9000 gallons will pay $30 for the first 6000 gallons ($0.005 * 6000), plus $21 for the other 3000 gallons ($0.007 * 3000). The total bill will be $51. A business customer who has used 9000 gallons will pay $48 for the first 8000 gallons ($0.006 * 8000), plus $8 for the other 1000 gallons ($0.008 * 1000). The total bill will be $56. Write a program to do the following. Ask the user which type the customer it is and how many gallons of water have been used. Calculate and display the bill.
Answer:
#include <bits/stdc++.h>
using namespace std;
int main()
{
// variables
char cust_t;
int no_gallon;
double cost=0;
cout<<"Enter the type of customer(B for business or R for residential):";
// read the type of customer
cin>>cust_t;
// if type is business
if(cust_t=='b'||cust_t=='B')
{
cout<<"please enter the number of gallons:";
// read the number of gallons
cin>>no_gallon;
// if number of gallons are less or equal to 8000
if(no_gallon<=8000)
{
// calculate cost
cost=no_gallon*0.006;
cout<<"total cost is: $"<<cost<<endl;
}
else
{
// if number of gallons is greater than 8000
// calculate cost
cost=(8000*0.006)+((no_gallon-8000)*0.008);
cout<<"total cost is: $"<<cost<<endl;
}
}
// if customer type is residential
else if(cust_t=='r'||cust_t=='R')
{
cout<<"please enter the number of gallons:";
// read the number of gallons
cin>>no_gallon;
// if number of gallons are less or equal to 8000
if(no_gallon<=8000)
{
// calculate cost
cost=no_gallon*0.007;
cout<<"total cost is: $"<<cost<<endl;
}
else
{// if number of gallons is greater than 8000
// calculate cost
cost=(8000*0.005)+((no_gallon-8000)*0.007);
cout<<"total cost is: $"<<cost<<endl;
}
}
return 0;
}
Explanation:
Ask user to enter the type of customer and assign it to variable "cust_t". If the customer type is business then read the number of gallons from user and assign it to variable "no_gallon". Then calculate cost of gallons, if gallons are less or equal to 800 then multiply it with 0.006.And if gallons are greater than 8000, cost for first 8000 will be multiply by 0.006 and for rest gallons multiply with 0.008.Similarly if customer type is residential then for first 8000 gallons cost will be multiply by 0.005 and for rest it will multiply by 0.007. Then print the cost.
Output:
Enter the type of customer(B for business or R for residential):b
please enter the number of gallons:9000
total cost is: $56
The Python MySQL Connector library:
(a) come pre-installed with Linux
(b) comes pre-installed with the installation of MySQL8.
(c) comes pre-installed with the installation of Python3.
(d) must be downloaded and installed as a separate package.
Answer: (D) Must be downloaded and installed as a separate package.
Explanation:
The python MySQL (Structured query language) connector library ought to be downloaded and introduced as separate package. It is utilized to interface MySQL database from python.
The MySQL Installer can introduce and deal with numerous, separate MySQL server occurrences on a similar host simultaneously.
MySQL Installer doesn't allow server updates among major and minor form numbers, however permits redesigns inside a discharge arrangement
Convert (35.125)10 to binary
Answer:
The answer is: 100011.001₂.
Explanation:
First, transform to binary the integer part: 35. Divide the number repeatedly by 2, keeping track of each remainder, until we get a quotient that is equal to 0:
35 ÷ 2 = 17 + 1; 17 ÷ 2 = 8 + 1; 8 ÷ 2 = 4 + 0; 4 ÷ 2 = 2 + 0; 2 ÷ 2 = 1 + 0; 1 ÷ 2 = 0 + 1;Now, construct the integer part base 2 representation, by taking the remainders starting from the bottom of the list:
35₁₀ = 100011₂Then, transform to binary the fractional part: 0.125. Multiply it repeatedly by 2, keeping track of each integer part of the results, until we get a fractional part that is equal to 0:
0.125 × 2 = 0 + 0.25; 0.25 × 2 = 0 + 0.5; 0.5 × 2 = 1 + 0;Construct the fractional part base 2 representation by taking all the integer parts of the multiplying operations, starting from the top of the list.
0.125₁₀ = 0.001₂
Then you have:
35.125₁₀ = 100011.001₂
Write a program that takes the length and width of a rectangular yard and the length and width of a rectangular house situated in the yard. Your program should compute the time required to cut the grass at the rate of two square feet a second.
Answer:
// here is code in c++.
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variables
int y_len,y_wid;
int h_len,h_wid;
// read the length and width of yard
cout<<"Enter the legth of yard:";
cin>>y_len;
cout<<"Enter the width of yard:";
cin>>y_wid;
// read the length and width of house
cout<<"Enter the legth of house:";
cin>>h_len;
cout<<"Enter the width of house:";
cin>>h_wid;
// calculate grass area
int g_area=(y_len*y_wid)-(h_len*h_wid);
// find the time
int t=g_area/2;
// print the time
cout<<"time required to cut the grass is: "<<t<<" seconds."<<endl;
return 0;
}
Explanation:
Read the length and width of the yard. Then read the length and width of house from user.Calculate the area of grass by subtracting the area of house from area of yard.Then divide the area of grass by rate of 2 square feet per second.
Output:
Enter the legth of yard:25
Enter the width of yard:20
Enter the legth of house:15
Enter the width of house:12
time required to cut the grass is: 160 seconds.
Final answer:
To calculate the mowing time, subtract the house's area from the yard's, then divide by the cutting rate of 2 square feet per second. The code provided demonstrates a simple Python function to perform these calculations.
Explanation:
The question requires writing a program to calculate the time needed to cut grass that is left after a house is subtracted from a rectangular yard. The cut rate is two square feet per second. To solve this, you first calculate the total area of the yard and the house, then subtract the house's area from the yard's area to get the grassy area that needs cutting. Finally, you divide this area by the cut-rate to obtain the time required.
Here is a basic program outline in Python:
def calculate_mowing_time(yard_length, yard_width, house_length, house_width):
yard_area = yard_length * yard_width
house_area = house_length * house_width
grass_area = yard_area - house_area
mowing_time_seconds = grass_area / 2
return mowing_time_seconds
Call this function with the specific dimensions to get the time required.
. What is suboptimization?
Answer: Suboptimization is referred to as a term that has been approved for common policy mistake. It usually refers to the practice of concentrating on a single component of a whole and thus making changes which are intended towards improving that component and also ignoring its effects on other components.
The handle in a selected object’s upper-left corner is the ___________handle.
Answer: Move handle
Explanation: In the field of the database, the unique identifier for an object is created that is known as handle which is for the driving purpose in the database.It is also used for the connection of the database .The object in the database containing data keeps the management of the handle.
It has a handle named move handle ,which is responsible for the movement control of upper left corner in an object.It is in a large in form for the dragging of the object that is selected.
Write a function that counts and returns the number of vowels in the input, up to the next newline or until the input is done, whichever comes first. Your function should have the following prototype:
int count_vowels();
Answer:
// here is code in C++.
#include <bits/stdc++.h>
using namespace std;
// function that return the number of vowels in the input string
int count_vowels()
{
// variable
string str;
int v_count=0;
cout<<"enter the string:";
// read the string
cin>>str;
// fuind the length
int len=str.length();
// check for vowel
for(int x=0;x<len;x++)
{
char ch=str[x];
if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u'||ch=='A'||ch=='E'||ch=='I'||ch=='O'|ch=='U')
{
v_count++;
}
}
// return the count
return v_count;
}
// driver function
int main() {
// call the function and print the result
cout<<"number of vowels in string is : "<< count_vowels()<<endl;
return 0;
}
Explanation:
In the function count_vowels(), read a sting and then find its length.Then check each character of the string is vowel or not.If it is vowel then Increment the v_count. After the loop return the count to main function and print it.
Output:
enter the string: welcometoprogramming
number of vowels in string is : 7
. List four different ways automation can be used in testing?
Answer:
Automation testing can be used for:
Input-output test : If the main function of your software is to transform input data into output data you can configure a new test by providing a new input/output pair, then the test will check to see if the output matches with the expected values.
Unit test : This test is a script to check the return values of a specific code by initializing it and calling his methods. This is a part of a test-driven development process.
Integration test : This test is a code level script that does a complete check process involving multiple objects. For example, you might make a test for “buy a product” which checks to see if the database is updated, if the data is correct of the person is correct, and if the person placing the order gets the right confirmation email.
Smoke Tests: This test is executed immediately after implementation on production to ensure that the application is still functioning.
Roman numeration uses 7 uppercase letters instead of numbers that make it easily adaptable in most MATH formulas when needed.
True
False
Answer:
TRUE
Explanation:
Roman numerals system is a system of numerical notations, that involves using combination of uppercase letters from the Latin alphabet to represent numbers. This system was used in the ancient Rome.
This system involves the use of seven uppercase letters from the Latin alphabet as symbols to represent a fixed integer value.
The symbol I represents the integer 1, V represents the integer 5, X represents the integer 10, L represents the integer 50, C represents the integer 100, D represents the integer 500 and M represents the integer 1000.
Which statement best describes when Variable Substitution (expansion) can occur?
a) inside of single quotes
b) inside of double quotes
c) inside of backquotes
d) B & C
Answer: d) B & C
Explanation: Variable substitution is the method through which the command substitution is done for the other form of command and regains its value or meaning.
This value substitution is done with the help of double quotes("...") which are inverted as well when a new form of command is to be introduced and it is known as back quotes. Other given options are incorrect because it is not determined in single quotes.Thus the correct option is option (d).
Answer: (A) Inside of single quotes
Explanation:
The variable substitution or we can say that expansion occur inside the single quotes because the generation of the file name typically happened inside the single quotes only.
When we enclosing the character and different types of variable with the single quotes ( ' ) then, it basically represent the actual value of the characters. In this way, the estimation of any factor can't be perused by single statement and a solitary statement can't be utilized inside another single quote statements.
What is the importance of generalization bounds.
Answer:
The importance of generalization are as follow:
The generalization bounds are basically used in various ranking algorithm for supporting various vector machine and it is very helpful in the system. The generalization bounds are helpful for minimize and reducing the empirical convex risk in the system. It is also important for handling and controlling the complex hypothetical spaces also handle various types of VC dimensions complexity. The generalization bounds are basically free from all the distribution bounds so that is why it is used in many probability measures.Convert 15 from decimal to binary. Show your work.
Answer: 1111
Explanation: As a decimal number can be decomposed in a sum of products involving powers of ten, it can be factored as a sum of products of powers of 2 in order to convert to binary.
In the example, we can write 15 as a decimal number in this way:
1* 10¹ + 5* 10⁰ = 15
Decomposing in powers of 2:
1*2³ + 1* 2² + 1*2¹ + 1.2⁰ = 1 1 1 1 = (15)₂
The changing of values for an object through a system is represented by the _____. (Points : 6) communication diagram
object diagram
use case diagram
None of these
Answer:
The correct option is communication diagram
Explanation:
The communication diagram represents the change of values for an item by a system.
A communication diagram is an expansion of the diagram of objects showing the objects together with the texts traveling from one to another. Besides the connections between objects, the communication diagram demonstrates the messages that the objects send to one another.
The correct option is a) communication diagram
Using the command line, create a symbolic link to the /etc in the /root/Desktop folder.
Answer:
ln -s /etc /root/Desktop
Explanation:
ln is the command to create links and -s is the flag to create symbolic links between element1 and element2
Example:
ln -s /etc /root/Desktop
Create a symbolic link between folder etc and folder Desktop
Write a method that take an integer array as a parameter and returns the sum of positive odd numbers and sum of positive even numbers.
Answer:
I will code in Javascript:
function sumOddAndEven(){
//Define and initialize variables.
var numbers = [1,2,3,4,5,6,7,8];
var sum = [0,0];
for ( var i = 0; i < numbers.length ; i++ ){ // loop to go throght the numbers
if(numbers[i] > 0) { // if the number is positive
if(numbers[i]%2 == 0) { // if number is even and
sum[0] = sum[0] + numbers[i]; //adds in the first place of sum
}
else{
sum[1] = sum[1] + numbers[i]; // else adds in the second place of sum
}
}
}
return sum; //return an array with the sum of the positive evens numbers in the first place and the sum of the positive odd numbers in the second place.
}
In 4-bit sign magnitude representation, what is the binary encoding of the number -5?
a) 1011
b) 1010
c) 1101
d) 0101
Broadly speaking, what are some of the benefits of an object-oriented approach when developing a system?
Answer: The benefits provided by object-oriented approach for the development of the operating system are as follows:-
It provides the facility of the re-utilization of the object-oriented componentsIt decrease the cost of development and also male the system faster for processingThe feature of binding the data into a single capsule unit is also present which is known as encapsulation.Improves the performance and quality of the operating systemSecurity feature is also present
To control for an InternalError exception you should use a(n) __________ connection.
a
Unbuffered
b
Buffered
c
Secure
d
Open
Answer: (B) Buffered
Explanation:
Buffered connection is basically used to control the internal error exception. The buffer cursor are basically executed different queries like fetchall() and fetchone(), these are the row fetching method. It is basically used to return the row from set of the buffered row.
For creating the buffered cursor we can use the buffered argument and call the cursor connection.
On the other hand, all the other options are incorrect because it cannot control the internal error only buffered connection can do.
Therefore, Option (B) is correct.
In an IPv.4 addressing scheme the router works at layer 3 on which addressing layer?
a. protocol b. data link c. transport d. network
Answer: d) Network
Explanation: IPv4(internet protocol version 4) is the decimal-digit numeric value for the internet protocol.It helps in the identification of the hosts through logical addresses. The functioning of IPv4 helps in the routing of the information over the network.
The network layer contains router that is responsible for the routing of message between the nodes of the path.Router functions with internet protocol.Other options are incorrect because protocol is the set of riles,data link layer works for managing the movement of data and transport layer monitors the transmission of data.Thus ,correct option is option(d)
Which of the following are examples of IT careers? Check all of the boxes that apply.
software engineer
hardware engineer
lawyer
systems analyst
database administrator
computer support specialist
Answer:
software engineer hardware engineer systems analyst database administrator computer support specialistExplanation:
Software engineer: This deals with the application development where engineers develop application related to system software and application software which is used for commercial purposes. Hardware engineer: Deals with problem in the hardware viz keyboard, mouse, mother board and other internal parts and also with network. Systems analyst: This is once again a profession which deals with the internal problems of the system and also to install softwares and troubleshoot if issues arise. Database administrator: Maintains the database, fix errors, monitor data, etc Computer support specialist: The responsibility depends on the company and it will be similar to a clerical role.Lawyer This option is irrelevant
Answer:
operating system
web browser
word processor
device driver
the clipboard
Explanation:
got these answers right and also got a 100 on it
What is unauthorized data disclosure?
Answer: Unauthorized data disclosure is the revealing of the confidential or private data to the unauthorized user. The disclosure of such data can be highly risk because it can lead to the several ways in which information can be misused . This incident can be due to attacking and stealing of data on purpose or by accident.
They purposely disclosure of data can be done through the methods like spoofing, sniffling etc.It is considered as the malicious activity which is a punishable crime if done on purpose.Top avoid such situation the exchange of information should be done carefully and in secure manner.
Why is a memory hierarchy of different memory types used instead of only one kind of memory?
Answer: Memory hierarchy is the hierarchy that is created on the basis of the response time of different memories. The performance obtained by the memory helps in creating a computer storage space in distinguished form. The factors considered for the creating of the hierarchy structure are usually response time, storage capacity, complexity etc.
Usage of different kind of memories take place due to different kind of requirements from the system which cannot be fulfilled using one memory device.The requirement is based on saving time, decreasing complexity , improving performance etc.Example of requirements can be like some functions and files do not require much space , some might require quick accessing,etc.
Thus hierarchy of any particular system is in the form of fast to slow order from registers,cache memory, Random access memory(RAM) and secondary memory.
What is the binary representation of the following hexadecimal numbers?
a. A4693FBC
b. B697C7A1
-
Answer:
Corresponding Binary numbers are as following:
A4693FBC=10100100011010010011111110111100.
B697C7A1 = 10110110100101111100011110100001.
Explanation:
A single digit hexadecimal number is a 4 bit binary number.So for each hexadecimal bit we have to find the corresponding 4 bit binary number.
A=1010
4=0100
6=0110
9=1001
3=0011
F=1111
B=1011
C=1100
and write them in the same sequence of their hexadecimal number.
A4693FBC=10100100011010010011111110111100.
B=1011
6=0110
9=1001
7=0111
C=1100
7=0111
A=1010
1=0001
B697C7A1 = 10110110100101111100011110100001.