Answer:
# user is prompted to enter the value of n
n = int(input("Enter your number: "))
# if statement to check if n > 0
if (n > 0):
# for-loop to loop through the value of n
for digit in range(1, (n+1)):
# if digit is odd, print 1
if((digit % 2) == 1):
print("1", end=" ")
# else if digit is even print 0
else:
print("0", end=" ")
Explanation:
The code is written in Python and is well commented.
A sample output of the code execution is attached.
In a file-oriented information system, a work file ____. stores relatively permanent data about an entity is created and saved for backup and recovery purposes stores records that contain day-to-day business and operational data is a temporary file created by an information system for a single task
Answer:
D. is a temporary file created by an information system for a single task
(the options are given in the question and correctly provided in ask for detail section)
Explanation:
File oriented information system is the system that is used to store data temporarily. A file has been created for each new user that stores information about client for small piece of time in database. The files does not share information with each other as each independent user creates his own files. The data in this file is deleted after specific time interval.
A work file is a file that stores all the above mentioned information for single time. This is a temporary file.
_______ is a communications protocol used to send information over the web. HyperText Markup Language (HTML). URL (Uniform Resource Locator). Web 2.0 TCP/IP
TCP/IP is a communications protocol used to send information over the web.
Explanation:
TCP / IP, which stands for the Transmission Control Protocol / Internet Protocol, is a set of communication protocols used to connect internet network devices. The whole suite of the Internet Protocol — a set of rules and procedures — is commonly called TCP / IP.
The TCP / IP protocol suite acts as a layer of abstraction between web applications and the routing / switching fabric. TCP / IP defines how data is shared over the internet by supplying end-to-end communications that specify how the data should be split into packets, signed, distributed, routed and received at the destination.
Write programs with loops that compute:
(a) The sum of all even numbers between 2 and 100 (inclusive).
(b) The sum of all squares between 1 and 100 (inclusive).
(c) The sum of all odd numbers between a and b (inclusive), where a and b are inputs.
(d) Ask the user for a sequence of integer inputs and print: The smallest and largest of the inputs.
Answer:
The programs are written in MATLAB.
(a)
sum = 0;
for i = 2:100 %This for loop starts from 2 and ends at 100
sum = sum + i; %This line sums each values of the loop
end
disp(sum); %This command displays the sum at command window
(b)
sum = 0;
for i = 2:100
sum = sum + i^2; %This line sums the squares of each values in the loop
end
disp(sum);
(c)
sum = 0;
a = input('Please enter a: ');
b = input('Please enter b: ');
for i = a:b
if mod(i,2) == 1 %This command checks whether the value in the loop is odd or not
sum = sum + i; %This command sums each odd value in the loop
end
end
(d)
seq = input('Please enter a few numbers with square brackets [] around them: ');
small = seq(1); %Initialize small
large = seq(1); % Initialize large
for i = 1:length(seq) %Iterate over the sequence
if seq(i) < small
small = seq(i); %Decide if the value in the loop is smallest
elseif seq(i) > large
large = seq(i); %Decide if the value in the loop is largest
end
end
fprintf('The smallest of the inputs is %g,\nThe largest of the inputs is %g.\n',small,large);
To compute the sum of all even numbers between 2 and 100, you can iterate through each number in that range and check if it's even. Similarly, to compute the sum of all squares between 1 and 100, you can iterate through each number in that range and calculate its square. To find the sum of all odd numbers between two inputs, you can iterate through the range defined by the inputs and check if each number is odd. Finally, to find the smallest and largest numbers from a sequence of integer inputs, you can compare each input to the current smallest and largest numbers.
Explanation:To compute the sum of all even numbers between 2 and 100, you can use a loop that iterates through each number in that range. You can check if a number is even by using the modulus operator (%), which returns the remainder when divided by 2. If the remainder is 0, then the number is even and you can add it to the sum. Here's an example in Python:
sum = 0This will output the sum of all even numbers between 2 and 100, which is 2550.
To compute the sum of all squares between 1 and 100, you can use another loop that iterates through each number in that range. You can calculate the square of a number by multiplying it by itself. Here's an example in Python:
sum = 0This will output the sum of all squares between 1 and 100, which is 338350.
To compute the sum of all odd numbers between a and b (inclusive), where a and b are inputs, you can use a loop that iterates through each number in that range. You can check if a number is odd by using the modulus operator (%), which returns the remainder when divided by 2.
sum = 0This will prompt the user to enter values for a and b, and then output the sum of all odd numbers between a and b.
To find the smallest and largest numbers from a sequence of integer inputs, you can track the smallest and largest numbers by comparing each input to the current smallest and largest numbers. Here's an example in Python:
smallest = NoneThis will continuously prompt the user to enter integer inputs until they enter 'q' to quit, and then output the smallest and largest numbers from the input sequence.
A fair six-sided die is rolled repeatedly and independently. Let An be the event of rolling n sixes in 6n rolls, and let Bn be the event of rolling n or more sixes in 6n rolls. (a) Does P(An) and P(Bn) change with n? (b) Use a computer to investigate what happens to P(An) and P(Bn) as n becomes very large.
Answer:
R code:
n=1:100*1000
p1=round(dbinom(n,6*n,1/6),4)
p2=round(1-pbinom(n-1,6*n,1/6),4)
levels=factor(c("n","P(A_n)","P(B_n)"))
X=cbind(n,p1,p2)
colnames(X)=c(expression(n),expression(P(A_n)),expression(P(B_n)))
Output:
n P(A_n) P(B_n)
[1,] 1000 0.0138 0.5054
[2,] 2000 0.0098 0.5038
[3,] 3000 0.0080 0.5031
[4,] 4000 0.0069 0.5027
[5,] 5000 0.0062 0.5024
[6,] 6000 0.0056 0.5022
[7,] 7000 0.0052 0.5020
[8,] 8000 0.0049 0.5019
[9,] 9000 0.0046 0.5018
[10,] 10000 0.0044 0.5017
[11,] 11000 0.0042 0.5016
[12,] 12000 0.0040 0.5016
[13,] 13000 0.0038 0.5015
[14,] 14000 0.0037 0.5014
[15,] 15000 0.0036 0.5014
[16,] 16000 0.0035 0.5013
[17,] 17000 0.0034 0.5013
[18,] 18000 0.0033 0.5013
[19,] 19000 0.0032 0.5012
[20,] 20000 0.0031 0.5012
[21,] 21000 0.0030 0.5012
[22,] 22000 0.0029 0.5011
[23,] 23000 0.0029 0.5011
[24,] 24000 0.0028 0.5011
[25,] 25000 0.0028 0.5011
[26,] 26000 0.0027 0.5011
[27,] 27000 0.0027 0.5010
[28,] 28000 0.0026 0.5010
[29,] 29000 0.0026 0.5010
[30,] 30000 0.0025 0.5010
[31,] 31000 0.0025 0.5010
[32,] 32000 0.0024 0.5010
[33,] 33000 0.0024 0.5009
[34,] 34000 0.0024 0.5009
[35,] 35000 0.0023 0.5009
[36,] 36000 0.0023 0.5009
[37,] 37000 0.0023 0.5009
[38,] 38000 0.0022 0.5009
[39,] 39000 0.0022 0.5009
[40,] 40000 0.0022 0.5008
[41,] 41000 0.0022 0.5008
[42,] 42000 0.0021 0.5008
[43,] 43000 0.0021 0.5008
[44,] 44000 0.0021 0.5008
[45,] 45000 0.0021 0.5008
[46,] 46000 0.0020 0.5008
[47,] 47000 0.0020 0.5008
[48,] 48000 0.0020 0.5008
[49,] 49000 0.0020 0.5008
[50,] 50000 0.0020 0.5008
[51,] 51000 0.0019 0.5008
[52,] 52000 0.0019 0.5007
[53,] 53000 0.0019 0.5007
[54,] 54000 0.0019 0.5007
[55,] 55000 0.0019 0.5007
[56,] 56000 0.0018 0.5007
[57,] 57000 0.0018 0.5007
[58,] 58000 0.0018 0.5007
[59,] 59000 0.0018 0.5007
[60,] 60000 0.0018 0.5007
[61,] 61000 0.0018 0.5007
[62,] 62000 0.0018 0.5007
[63,] 63000 0.0017 0.5007
[64,] 64000 0.0017 0.5007
[65,] 65000 0.0017 0.5007
[66,] 66000 0.0017 0.5007
[67,] 67000 0.0017 0.5007
[68,] 68000 0.0017 0.5007
[69,] 69000 0.0017 0.5006
[70,] 70000 0.0017 0.5006
[71,] 71000 0.0016 0.5006
[72,] 72000 0.0016 0.5006
[73,] 73000 0.0016 0.5006
[74,] 74000 0.0016 0.5006
[75,] 75000 0.0016 0.5006
[76,] 76000 0.0016 0.5006
[77,] 77000 0.0016 0.5006
[78,] 78000 0.0016 0.5006
[79,] 79000 0.0016 0.5006
[80,] 80000 0.0015 0.5006
[81,] 81000 0.0015 0.5006
Here we observed that as n goes to infinity, both probabilities are constant and Plan) is almost zero and PB) is almost 0.5.
Explanation:
Final answer:
The probability of rolling exactly n sixes in 6n rolls (P(An)) and the probability of rolling n or more sixes in 6n rolls (P(Bn)) both change with n and would require computational methods to investigate as n becomes large.
Explanation:
The probability question at hand involves a fair six-sided die and two types of events, An and Bn. The event An is rolling exactly n sixes in 6n rolls, and the event Bn is rolling n or more sixes in 6n rolls.
a. The probability P(An) would change with n because it represents the probability of a very specific outcome (exactly n sixes), which depends on the number of trials (rolls). P(Bn) also changes with n because it accumulates probabilities of all cases where at least n sixes occur, up to all 6n being sixes.
b. To investigate what happens to P(An) and P(Bn) as n becomes very large, a computer simulation would be required. Typically, the probabilities can be expected to approach certain limits due to the law of large numbers. However, the exact behavior would depend on the specifics of the binomial probability distribution.
When dealing with large n, the central limit theorem comes into play, which would usually imply that the distribution of the average number of sixes approaches a normal distribution. However, obtaining exact probabilities would require computational methods.
Look at the following pseudocode module header: Module myModule (Integer a, Integer b, Integer c) Now look at the following call to myModule: Call myModule (3, 2, 1) When this executes, what value will be stored in a? What value will be stored in b? What value will be stored in c?
Answer:
"3, 2 and 1" is the correct answer for the above question.
Explanation:
The module or function is used to some task for which it is designed. This task is defined in the body of the module at the time of definition.Some functions or modules are parameterized based, which means that this type of function takes some value to process any task.The above-defined module also takes three values to process, a,b and c. this value is passed at the time of calling 3,2 and1.The three are passed as the first value which is assigned for the a variable because the a variable is the first argument of the function.The two are passed as the second value which is assigned for the b variable because the b variable is the second variable which is defined as the second argument of the function.The one is passed as the third value which is assigned for the c variable because the c variable is the third variable which is defined as the third argument of the function. Hence the answer is a=3, b=2 and c=1.Considers the assets of all things in an environment, and refers to the layering of security tools and methods often varying numerous parameters between layers, in an effort to restrict or prevent malicious users from penetrating anything more than the outer layers.
A.Protects assets in an information system environment by employing firewalls and information security policies.
B.Provides a roadmap for securing physical access points to a building as well as controlling the access to those points.
C.Guarantees protection of all layers in an information security architecture and infrastructure by employing multiple methods of protection between layers and across domains.
This question is incomplete, here is the complete question gotten from google:
Defense-in-depth is a strategy that: (choose best answer)
a. Considers the assets of all things in an environment, and refers to the layering of security tools and methods often varying numerous parameters between layers, in an effort to restrict or prevent malicious users from penetrating anything more than the outer layers.
b. Protects assets in an information system environment by employing firewalls and information security policies.
c. Provides a roadmap for securing physical access points to a building as well as controlling the access to those points.
d. Guarantees protection of all layers in an information security architecture and infrastructure by employing multiple methods of protection between layers and across domains.
Answer:
Defense-in-depth is a strategy that guarantees protection of all layers in an information security architecture and infrastructure by employing multiple methods of protection between layers and across domains - option C.
Explanation:
An approach to cybersecurity in whereby a series of defensive mechanisms are layered in order to protect valuable data and information is known as Defense in Depth (DiD) strategy .
In DID, If one mechanism fails, another steps up immediately to obstruct an attack. This multi-layered approach with intentional redundancies increases the security of a system as a whole and addresses many different attack vectors.
Defense in Depth (DiD) strategy is only known for the description in option C, but it is not known for what is described in options A and B.
Thus, option C is the best answer
Design aPayrollclass that has fields for an employee’sname, ID number, hourly pay rate,and number of hours worked. Write theappropriate accessor and mutator methods and a constructor that accepts theemployee’s name and ID number as arguments. The class should also have amethod that returns the employee’s gross pay, which is calculated asthenumber of hours worked multiplied by the hourly pay rate. Write anotherclass/programwithmain()methodthat demonstrates the class by creatingaPayrollobject, then asking the user to enter the data for anemployee.The program should display the amount of gross pay earn
Answer:
public class Payroll {
private String employeeName;
private int employeeId;
private double ratePerHour;
private double totalWorkHours;
public Payroll(String employeeName, int employeeId) {
this.employeeName = employeeName;
this.employeeId = employeeId;
}
public String getemployeeName() {
return employeeName;
}
public voemployeeId setemployeeName(String employeeName) {
this.employeeName = employeeName;
}
public int getemployeeId() {
return employeeId;
}
public voemployeeId setemployeeId(int employeeId) {
this.employeeId = employeeId;
}
public double getratePerHour() {
return ratePerHour;
}
public voemployeeId setratePerHour(double ratePerHour) {
this.ratePerHour = ratePerHour;
}
public double gettotalWorkHours() {
return totalWorkHours;
}
public voemployeeId settotalWorkHours(double totalWorkHours) {
this.totalWorkHours = totalWorkHours;
}
public double getGrossPay() {
return ratePerHour * totalWorkHours;
}
}
import java.util.Scanner;
public class PayrollTest {
public static voemployeeId main(String[] args) {
Scanner in = new Scanner(System.in);
String employeeName;
int employeeId;
System.out.print("Enter employee's Name: ");
employeeName = in.next();
System.out.print("Enter employee's Id: ");
employeeId = in.nextInt();
Payroll payroll = new Payroll(employeeName, employeeId);
System.out.print("Enter employee's hourly rate: ");
payroll.setratePerHour(in.nextDouble());
System.out.print("Enter employee's total hours worked: ");
payroll.settotalWorkHours(in.nextDouble());
System.out.println("Gross pay = " + payroll.getGrossPay());
}
}
Explanation:
Inside the Payroll class, initialize variables for employee name, ID number, hourly pay rate, and number of hours worked.Define the getter and setter methods for the necessary variables inside the Payroll class.Inside the main method, create an object of the Payroll class.Get all the employee information as an input from user.Call the getter function of the class and display the gross pay of employee.Create a recursive method, a method that calls itself, // that returns true or false depending on whether or not // a given string is a palindrome. A palindrome is a word // that reads the same forwards and backwards, such as // "tacocat"
Answer:
public class CheckPalindrome{
public static boolean IsPalindrome(String str){
if(str.Length<1)
{
return true;
}
else
{
if(str[0]!=str[str.length-1])
return false;
else
return IsPalindrome(str.substring(1,str.Length-2));
}
}
public static void main(string args[])
{
//console.write("checking palindromes");
string input;
boolean flag;
input=Console.ReadLine();
flag= IsPalindrome(input);
if(flag)
{
Console.WriteLine("Received"+input+"is indeed palindrome");
}
else
{
Console.WriteLine("received"+input+"is not a palindrome");
}
}
Explanation:
Explain how the principles underlying agile methods lead to the accelerated development and deployment of software. Why is it necessary to introduce some methods and documentation from plan-based approaches when scaling agile methods to larger projects that are developed by distributed development teams?
Answer:
Explanation:
Agile is several approaches to develop software, this method evolve depends on the team, clients and organization.
In this case, the development can elaborate efficient software because is not necessary to add all the functions in the first version, we can optimize depends on our needs and request about the program.
Agile software development is perfect to work with small teams, but there are introducing elements to scale the development process in this way easier.
8. Brad is a security manager and is preparing a presentation for his company's executives on the risks of using instant messaging (IM) and his reasons for wanting to prohibit its use on the company network. Which of the following should not be included in his presentation? a. Sensitive data and Files can be transferred from system to system over IM. b. Users can receive information-including malware-from an attacker posing as a legitimate sender. c. IM use can be stopped by simply blocking specific ports on the network firewalls. d. A security policy is needed specifying IM usage restrictions.
Answer:
Letter c is correct. IM use can be stopped by simply blocking specific ports on the network firewalls.
Explanation:
The letter c is the alternative that should not be included in Brad's presentation to executives at his company about the risks of using instant messaging (IM).
This alternative refers only to the existing way to stop the use of instant messaging by blocking specific ports on network firewalls, and does not offer a reason why the use should be prohibited in the company, unlike other alternatives, which present the risks inherent in use of instant messaging in the company, and would therefore be more plausible reasons for executives to consider.
Write an INSERT statement that adds a row to the InvoiceCopy table with the following values: VendorID: 32 InvoiceTotal: $434.58 TermsID: 2 InvoiceNumber: AX-014-027 PaymentTotal: $0.00 InvoiceDueDate: 11/8/06 InvoiceDate: 10/21/06 CreditTotal: $0.00 PaymentDate: null
Given an unsorted std::vector and a number n, what is the worst-case time complexity for finding the pair of integers whose sum is closest to n, using no additional memory? For example, given the vector(12, 3, 17, 5, 7} and n = 13, we would get the pair(5, 7).
A.Θ(log n)
B.Θ(n)
C.Θ(n log n)
D.Θ(n2)
E.0(29
Answer:A
Explanation:
Write a C program to calculate the minimum, maximum, and average of n grades entered by the user. The program uses a function int g(int n) to calculate the requirements above and also prints the grades in reverse order. The function should utilize the concepts of recursion and static storage class specifier.
Answer:
#include <stdio.h>
int p;
int g(int n)
{
static int minimum=101, maximum=-1, average=0;
if(n==0)
return -1;
else
{
printf("Enter course grade %d: ",p-n+1);
int grade;
scanf("%d",&grade);
g(n-1);
printf("%d\n",grade);
if(minimum>grade)
minimum=grade;
if(maximum<grade)
maximum=grade;
average=average+grade;
if(n==p)
{
printf("minimum= %d\n",minimum);
printf("maximum= %d\n",maximum);
printf("Average= %.2f\n",(double)average/(double)n);
}
return -1;
}
}
int main()
{
printf("Enter the number of grades:\n");
scanf("%d",&p);
g(p);
return 0;
}
Explanation:
Use a conditional statement to check to find the maximum and minimum grade.Check if n is equal to p, then display the values of maximum and minimum.Calculate the average by dividing the sum with the total numbers and then display its value.Inside the main function, get number of grades from user as an input.Lastly, call the function g and pass it the value of grade.Getting Your Bearings: In this section of the final project, you will demonstrate your ability to execute commands to verify and confirm the status of the directory, files, and user account. At the end of this section, you will create a log file that will include a list of all the commands you used to complete these steps Navigate: The first step in this process, which you will provide evidence for in your log file, is to view the following using Linuxcommands
A. Current directory
B. Current user
C. Directory contents
Answer / Explanation:
To answer this question, the first step is to to utilize are source inside the Linux operating system that can provide you with more information for how to utilize commands.
Utilize a command to access key command information that would inform which command switch to use to show all files in the directory, including hidden files.
Review the directory contents again utilizing a command with as witch that includes hidden files.
Locate a file: Locate and open a file in the Linux work space directory that contains the following text string: last backup.
File permissions: Locate the whoownsme.txt file and confirm that all users have the ability to execute the file.
Running processes: View all the processes running in the system in order of priority.
Log file: Utilize a Linux command to create a log file that contains all of the commands you have utilized up to this point,and ensure all of the commands
utilized in critical elements I through V are listed. Title this file Bearings_Log_File.txt, and download this file for submission.
Executing tasks: In this section of the project, you will demonstrate your ability execute Linux commands to create files and create and organize the Linux directory structure. At the end of this section, you will create a log file that will include a list of all the commands you used to complete these steps.
In the work space directory, create new directories titled NEW,BACKUP, and OLD.
Create files: For this section, you will need to create files using five different methods in preparation for scripting in the following section. Ensure that you place them in the directory titled “NEW”:
A text file with five lines of text that you chose, titled Personal_Content.txt
A text file listing the quantity of operating system free space,titled Free_Space_Content.txt
A text file listing the directory contents of your work space directory and showing all file permissions, titled:Directory_Content.txt
A text file with the concatenated output of the Directory_Content.txt file (Title the new fileCopied_Content.txt.)
A text file showing the current month, day, and time (Title thisfile Time_File.txt.)
Modify and move files: Utilize Linux commands to rename files and copy them to a different directory in preparation for the backup script in the following section. Rename the files by adding the suffix “_OLD” to them, and move the files from the “NEW”directory to the “OLD” directory.
Remember that your modified files should use an appropriate naming convention: XXXX_XXXX_OLD.txt. Ensure that your modified files reside in the OLD directory, and that your original files reside in the
NEWdirectory. X. Log file:
Create a log file of all the commands you have utilized up to this point. Title this file Tasks_Log_File.txt, and download it for submission.
Script: In this section of your final project, you will write a basic script to create and back up files. You will create this script with the vi editor. The script will combine multiple commands and simplify a repeatable task. Your script should be named First name_Last name.BASH. Your script and your Linux directory structure should demonstrate that you have correctly written the script to do the following:
Create files: In this section, you will demonstrate your ability to utilize various Linux commands to create text files. Create these files in the NEW directory. Ensure that the commands in your log file show that the following three text files were created using three different methods. Create the following files:
A text file listing the quantity of operating system free space,titled Free_Space_Content.txt
A text file listing the directory contents of the OLD folder,titled OLD_Content.txt
A text file showing the current month, day, and time (Title this file Time_File.txt.)
Modify and Move files: Utilize Linux commands to copy files to a different directory and rename them.
Copy the following selected files from the OLD directory to the BACKUP directory. Ensure that you change the filename suffix from XXX_OLD to
XXX_BACKUP.
Free_Space_Content_OLD.txt
Directory_Content_OLD.txt
Time_File_OLD.txt
Move all files from the NEW directory to the BACKUP directory(no renaming necessary). Clean up the Linux directory structure by deleting the items in the NEW directory.
Execute the script: At this point, you will need to complete and execute the newly created script and complete a successful directory backup process.
Assess output: Finally, analyze the Linux directory structure and file contents to confirm successful script implementation.Ensure that you download your script and your Script_Assessment.txt file for submission.
A. Create a text file titled Script_Assessment.txt in the NEWdirectory; write a paragraph identifying the commands that you usedin your script, and assess the success of your script.
Label the strength of a beer based on its ABV. For each beer display the beer's name, ABV, and a textual label describing the strength of the beer. The label should be "Very High" for an ABV more than 10, "High" for an ABV of 6 to 10, "Average" for an ABV of 3 to 6, and "Low" for an ABV less than 3. Show the records by beer name.
Answer:
By presuming the question expect us to write a program to address the problem and the solution code written in Python is as follow:
beer_name = input("Enter beer name: ") abv = int(input("Enter ABV value: ")) if(abv > 10): label = "Very High" elif(abv >=6): label = "High" elif(abv >=3): label = "Average" else: label = "Low" print("Beer Name: " + beer_name) print("ABV value: " + str(abv)) print(label)Explanation:
Firstly, we can use input function to prompt user to input beer name and ABV value (Line 1 - 2).
Next, create if else if statements to check abv fallen into which range of value and then set a label accordingly (Line 4 -11). For example if abv is 4, the label will be set to "Average".
At last, print the information of beer that includes beer name, abv value and label (Line 13 - 15).
Final answer:
Beer strength is categorized by ABV: 'Very High' for over 10%, 'High' for 6 to 10%, 'Average' for 3 to 6%, and 'Low' for under 3%. A brewery's selection can showcase a range of strengths, and beers above 16% ABV often require distillation due to yeast tolerances.
Explanation:
When labeling the strength of a beer based on its ABV (Alcohol by Volume), we use a textual label to categorize the beer. Here's how you can determine the label for a range of ABV percentages:
Very High: ABV > 10%High: 6% ≤ ABV ≤ 10%Average: 3% ≤ ABV ≤ 6%Low: ABV < 3%For instance, let's consider three beers from a selected brewery with their respective ABV:
Beer A - 4.5% ABV - AverageBeer B - 8.5% ABV - HighBeer C - 11% ABV - Very HighThe alcohol content in beer and wine can only be approximately 16% due to the tolerances of yeast used during the fermentation process. To produce beverages with higher concentrations of alcohol, distillation is required to separate alcohol from water.
Problem 2 A 10,000 rpm (revolutions per minute) harddisk can transfer data at a rate of 160 Mbps (megabits per second). The time to find a track is negligible. Determine the data amount for which it takes as long to transfer it off the disk as it takes to find the right sector.
Answer:
491.52 Kb
Explanation:
Number of revolution in a minute (= 60000 milliseconds) = 10000
Number of revolution in 1 millisecond = 1 / 6
So for a half revolution the time required = 3 milliseconds
Data Transfer = 160 X 1024 Kb/1000 s = 163.84 Kb/milliseconds
Data amount = 163.84 X 3 = 491.52 Kb
UDP and TCP use 1s complement for their checksums. Suppose you have the following three 8-bit bytes: 01010011, 01100110, 01110100. What is the 1s complement of the sum of these 8-bit bytes? (Note that although UDP and TCP use 16-bit words in computing the checksum, for this problem you are being asked to consider 8-bit sums.) Show all work. Why is it that UDP takes the 1s complement of the sum; that is, why not just use the sum? With the 1s complement scheme, how does the receiver detect errors? Is it possible that a 1-bit error will go undetected? How about a 2-bit error?
Answer:
One's complement = 1 1 0 1 0 0 0 1.
To detect errors, the receiver adds the four words (the three original words and the checksum). If the sum contains a zero, the receiver knows there has been an error. All one-bit errors will be detected, but two-bit errors can be undetected (e.g., if the last digit of the first word is converted to a 0 and the last digit of the second word is converted to a 1).
Explanation:
See attached pictures.
The 1s complement of the sum of the three 8-bit bytes is 011111110. UDP and TCP use 1s complement for their checksums to efficiently check for errors in data transmission. A 1-bit error can be detected, but a 2-bit error may go undetected.
Explanation:The 1s complement of the sum of the three 8-bit bytes is calculated by adding the bytes together and then taking the complement of the result. In this case, the sum of the bytes is 01010011 + 01100110 + 01110100 = 100000001. The 1s complement of 100000001 is 011111110, which is the answer.
UDP and TCP use 1s complement for their checksums because it provides a way to efficiently check for errors in data transmission. By taking the 1s complement, the receiver can easily verify that the received data is correct. If the complement of the sum is all zeros, then there are no errors in the data. If there are any ones in the complement, it indicates that there are errors.
With the 1s complement scheme, a 1-bit error can be detected because it will result in a non-zero complement. However, a 2-bit error may go undetected because it could cancel out each other, resulting in a zero complement. To detect and correct multiple errors, more advanced error detection and correction techniques, such as error-correcting codes, are used.
Choosing a High-Availability Solution You have been hired to set up the network and servers for a new company, using Windows Server 2012 R2. The company is investing in an application critical to the company’s business that all employees will use daily. This application uses a back-end database and is highly transaction oriented, so data is read and written frequently. To simplify maintenance of the front-end application, users will run it on remote desktop servers. The owner has explained that the back-end database must be highly available, and the remote desktop servers must be highly scalable to handle hundreds of simultaneous sessions. What high-availability technologies do you recommend for the back-end database server and the remote desktop servers? Explain your answer.
Answer:
We have following high availability solutions available in sql server:-
Logshiping:It is the process of automating backup of database and transaction logfiles on a server and then restoring on standby server.Through diagram below,logshipping can be understood properly.
Primary database is the database which needs to be available.It is available on primary server as the name says.Secondary database is available on secondary server where the all the transaction logfile will be restored to make the database in sync.This ca be chosen for high availability solution in OLTP environment.
It is very easy to setup.Just by using GUI,it can be established.
We have norecovery mode and stand by mode.Database on secondary server is not available if chosen no recovery mode.Stand by mode is chosen to use database for reading purpose when it is not being restored.
We can have multiple secondary server.On one server database can be used for reporting purpose and can be used for other purpose on another server.
It requires low maintance.
Mirroring:It is also a high availability solution which makes database available on secondary server.Below is the diagram showing mirroring:-
It increases availability of a database.
It increases data protection
It increases availability of database on production server during upgrades.
We have two modes high performance and high safety.In hgh performance mode, database mirroring session operates asynchronously and uses only the principal server and mirror server. The only form of role switching is forced service (with possible data loss).
In high safety mode,the database mirroring session operates synchronously and, optionally, uses a witness, as well as the principal server and mirror server.
Replication:It is also a high availability solution.It can copy database from one server and transfer the data on another server and keep the database in sync.We have different type of replication like snapshot,transaction,merge,peer to peer.Below diagram can be used to understand replication:-
In replication,we can transfer various database objects like table,views,sp's etc.Even we can transfer database object from sql server to oracle.
Transaction replication is used when data changes very frequently and we want database to be transferred immediately. Snapshot is used when database changes less frequently and it requires to be replicated periodically.Merge is used when changes on publisher as well as subscriber can be replicated.
Other than that,we have alwaysOn and clustering.In alwaysOn, we have primary replica and secondary replicas.Clustering setup is required in alwaysOn but storage is not required on SAN.It is really good,if we want to restrict one server to take backup and other for reporting purpose.
In clustering,we have common storage which is shared by all nodes in cluster.So if a node fails,other nodes are available and there would not be much impact as database files are available on separate server.
Explanation:
See attached picture.
Final answer:
High availability for the back-end database can be achieved using a Windows Server 2012 R2 clustering setup with Always On Availability Groups, regular SQL Server backups, and segregating database servers from web servers. For scalability of remote desktop servers, use Remote Desktop Services with load balancing. Secure your data transmissions with SSL and invest in SSDs for reliability.
Explanation:
To ensure high availability for the back-end database of your critical company application, consider implementing a cluster of servers using Windows Server 2012 R2 with the Always On Availability Groups feature. This will ensure that if one server fails, another can take over without losing data or transactional continuity. Additionally, SQL Server backups should be configured regularly and stored in a secure, off-site location to prevent data loss in case of catastrophic failures.
For the remote desktop servers that need to be highly scalable, consider utilizing Remote Desktop Services (RDS) with load balancing. This allows you to distribute the load across multiple servers, enabling the system to handle hundreds of remote sessions efficiently. Moreover, implementing Remote Desktop Gateway can enhance security by allowing remote connections only through authorized channels.
Concerning data management and security, segregate your database servers from web servers, even if they run the same OS, to reduce security risks. Make sure your database uses SSL connections to enhance security during data transmission and configure appropriate limitations on concurrent connections based on your expected user load.
Lastly, solid-state drives (SSDs) for your database and remote desktop servers could improve performance and reliability, thanks to their speed and reduced risk of mechanical failure. Make sure the drives are compatible with your system and have adequate backups in place to ensure continuous availability of services.
A STUDENT can take many COURSES and a COURSE can have more than one STUDENT enrolled in the course. In this case, both the "student_id" and "course_id" primary keys become foreign keys and primary keys in a new entity called COURSE-STUDENT. What is the main reason for creating a new entity?
a. To reinforce data accuracy
b. To preserve data completeness
c. To eliminate possible data redundancy
d. To achieve data consistency
Answer:C. To eliminate possible data redundancy.
Explanation:Data redundancy is a term used in data management system or process to mean the storage of the same data in different locations, this type of situation need to prevented for effective and efficient data management system or process.The main reason for creating a new entity is to eliminate the possibility of data redundancy which not desireous and not required.
You want to use the motherboard with DDR3 to triple channel the RAM in order to increase performance. When you open your computer, you notice that four RAM slots are available. How can you use the increased performance of triple channel with four slots available?
Answer:
Check the motherboard documentation to find which modules are supported. Purchase additional modules that are the same as what is currently installed.Final answer:
Triple channel RAM requires three memory sticks and a compatible motherboard, typically with six slots. If your motherboard has four slots, it likely only supports dual-channel or single-channel configurations. You should use pairs of identical RAM modules to benefit from dual-channel mode.
Explanation:
To utilize the increased performance of triple channel RAM on a motherboard with DDR3 memory and four RAM slots, you need to understand that triple channel memory configurations require three memory sticks working in concert. Unfortunately, if your motherboard supports only dual-channel or single-channel modes with its four slots, you cannot set up a triple channel configuration. Instead, to maximize performance, you should fill either two or four slots with identical RAM modules (same capacity, speed, etc.) to take advantage of dual-channel capabilities.
If your motherboard actually supports triple channel memory (which is less common and typically associated with older Intel platforms like X58), it would often have six slots to accommodate the triple channel configuration. In such a case, three identical RAM sticks should be installed in the correct slots as indicated by the motherboard's manual to enable triple channel mode. Since your motherboard has only four slots, this indicates it likely does not support triple channel memory configuration.
In your scenario, with only four RAM slots, the best approach is to use pairs of identical RAM modules to enable dual-channel mode, which also offers a performance boost over single-channel, albeit less than what triple channel would provide.
Create a Time Conversion application that prompts the user for a time in minutes and then displays the time in hours and minutes. Be sure to consider times whether the number of minutes left over is less than 10. For example, 184 minutes in hour:minute format is 3:04 (Hint: use the modulus operator). The application output should look similar to:
Answer:
The following are the program in the Java Programming Language.
//import the following class
import java.util.Scanner;
//define class
public class TimeConversion
{
//define main function
public static void main(String[] args)
{
//create the object of the scanner class
Scanner s = new Scanner(System.in);
//print message
System.out.println("Enter the minutes: ");
//get input in the variable
int t=s.nextInt();
//initialize in the variable
int hr=t/60;
//initialize in the variable
int min=t%60;
//declare the string type variable
String result;
//initialize in the variable
result=""+hr;
//check that the variable is less than 10
if(min<10)
//then, initialize this
result=result +":0"+min;
//otherwise
else
//initialize this
result=result +":"+min;
//print the result
System.out.println(result);
}
}
Output:
Enter the minutes:
184
3:04
Explanation:
The following are the description in the program.
Firstly, import the scanner class and define the class 'TimeConversion', inside the class, we define the main method and inside the main method. Create the object of the scanner class 'c' and then get input from the user in the variable 't' through the scanner class object. Then, declare the variable 'hr' and initialize the value input divided by 60. Declare the variable 'min' and initialize the value input mod by 60. Declare the string data type variable 'result' then, check that the variable 'min' is less than 10 then, initialize the following format in the variable 'result' and otherwise the initialize the other formate in the variable 'result'. Finally, we print the variable 'result'.To create a Time Conversion application that prompts the user for a time in minutes and displays the time in hours and minutes, you can use the modulus operator and format the output using String.format().
Explanation:To create a Time Conversion application, you can use the modulus operator to calculate the number of hours and minutes. Here is an example of how you can do this:
import java.util.Scanner;
public class TimeConversion {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter time in minutes: ");
int totalMinutes = scanner.nextInt();
int hours = totalMinutes / 60;
int minutes = totalMinutes % 60;
System.out.println("Time in hour:minute format is " + hours + ":" + String.format("%02d", minutes));
}
}
In this example, the total number of minutes entered by the user is divided by 60 to get the number of hours. The modulus operator (%) is used to find the remaining number of minutes. The String.format("%02d", minutes) is used to ensure that the minutes are displayed with two digits if it is less than 10.
Learn more about Time Conversion Application here:https://brainly.com/question/35896621
#SPJ3
2. Feet to Inches One foot equals 12 inches. Design a function named feetToInches that accepts a number of feet as an argument, and returns the number of inches in that many feet. Use the function in a program that prompts the user to enter a number of feet and then displays the number of inches in that many feet.
Final answer:
To create a function that converts feet to inches, you multiply the number of feet by 12, which is the unit equivalence. For conversions, you can also set up proportions to find the resulting number of inches. Understanding these conversions is crucial in various measurement situations.
Explanation:
Designing a Function to Convert Feet to Inches
To design a function that converts feet to inches, you simply need to multiply the number of feet by 12 because one foot is equivalent to 12 inches. This process of conversion uses the unit equivalence to go from a larger unit to a smaller unit of measure, which involves multiplication. For example, to convert 5 feet to inches, the calculation would be 5 feet multiplied by 12 inches per foot, which equals 60 inches.
Using Proportions for Conversion
To use proportions, you can set up a proportion such as 1 foot is to 12 inches as x feet is to the unknown number of inches. You would then cross multiply to solve for the unknown number of inches. This method is also helpful when dealing with fractional feet and ensures accuracy in conversion.
Conversion factors and the understanding of customary units of length, such as inches and feet, are essential for comparing and converting measurements effectively. Being familiar with these methods is useful in various practical scenarios, such as estimating the height or length of objects.
A SOHO's connection to the internet is through an antenna that sends and receives a microwave signal to the ISP's antenna. There can be no obstacles on the direct path between the two antennae.
The internet connection type described in this scenario is a Fixed Wireless Connection. In a Small Office/Home Office (SOHO) setup, where a direct path without obstacles is required between the user's antenna and the Internet Service Provider's (ISP) antenna, fixed wireless technology becomes a suitable choice. Therefore the correct option is D.
Here are the characteristics of a Fixed Wireless Connection in this context: Antenna Transmission: The connection involves the transmission of microwave signals between the user's antenna (often mounted on the roof or an elevated position) and the ISP's antenna. These antennas are directional and require a clear line of sight to establish a reliable connection.
Microwave Signals: Microwave signals operate in the radio frequency (RF) spectrum. In fixed wireless connections, these signals are used to establish a point-to-point or point-to-multipoint link between the user's premises and the ISP's infrastructure.
Direct Path and Line of Sight: The key requirement for fixed wireless connections is an unobstructed, direct path between the transmitting and receiving antennas. Any obstacles such as buildings, trees, or other structures can degrade the signal quality or cause signal loss, making line-of-sight crucial for optimal performance.
Suitable for Rural and Remote Areas: Fixed wireless connections are often deployed in rural or remote areas where laying traditional wired infrastructure like fiber-optic cables may not be cost-effective. It provides a viable solution for bridging the connectivity gap in such locations.
Reliability and Speed: Fixed wireless connections can offer reliable and high-speed internet access, comparable to other broadband technologies. The quality of service depends on factors such as the frequency band used, equipment quality, and the distance between the antennas.
Scalability: Fixed wireless connections can be scalable to meet the increasing bandwidth demands of users. Upgrades can involve equipment enhancements or adjustments to frequency bands used.
In summary, a Fixed Wireless Connection, utilizing microwave signals and requiring a direct line of sight between antennas, is an effective and flexible solution for providing internet connectivity to a Small Office/Home Office (SOHO) setting, especially in areas where traditional wired options are challenging to implement.
The complete question is given below:
A SOHO's connection to the internet is through an antenna that sends and receives a microwave signal to the ISP's antenna. There can be no obstacles on the direct path between the two antennae.
A. DSL
B. Cable
C. Fiber-optic
D. Fixed Wireless
Present a detailed data model for your project scenario. You can create your data model using Microsoft Visio 2010, which you will have access to through Lab and Microsoft Excel, which comes with Microsoft Office. Other tools may be used as long as the output is legible and conforms to standard format. (i.e., I will not be able to grade the data model if I cannot tell what it is supposed to be!). Your data model should include a minimum of an ERD and metadata chart (data dictionary).
Answer:
THE FARMERS PRICE CENTER
The farmer's price center is about helping farmers acquire farm inputs easily
and conveniently. Through relevant branches and supportive statt, the farmers
price center provides a fresh perspective on the day to day hardships that farmers
Tace. The tarmer's price center is run by a practicing tarnmer with tirst hand
information as he holds a bachelors degree in agriculture. His unique perspective
allows farmers to automatically connect with his point of view. The farmer's center
is equally informal as it is also a mentor or a friend. Besides selling farm inputs,
the center guides tarmers overcome their challenges.
The tarmer's price center addresses the tarming and tarming management
sector. The people who purchase from famers price center are either practicing
tarmers or want to start a venture in agriculture. They have a natural drive to create
agricultural products and seek out professional advice. The ideal customer for the
farmer's price center would be the new farmer or investor who wants to start an
agricultural venture or manage their firm better. The farmer's price center provides
a comprehensive resource that answers the questions farmers have while at the
same time giving thema step by step way to succeed. Mostly, farmers do not have
The farrmers price center will be getting 5,000 unique customers per month
and be ranked as a pace setter and a trusted mentor and be ranked as a leader in
agricultural products and advice site. To achieve these long term goals, the
Tarmer s price center needs to apply imbound marketing te chniques to get tound.
Part or this strategy will be to contract sales representatives to market the varlous
products to the retail shops across the countryside. These sales representatives are
to be paid a retainer and commission upon hitting their sales target. The (products
are transported by our fleet of trucks to the customer's premises. Payment shall be
made on cheque at the end of the month according to the number of products
delivered. Each sales representative shall prepare a report on their daily sales with
accordance to their specitic routes.
ne raners price center is all about neiping ramers tnve n tne cndotic
world of business filled with scrupulous products. The farmer's price center will
achieve upwards of 5,000 unique customers and S10,000 in revenue per month
within the next two years.
What is the output of the following program?
public class testmeth
{
static int i = 1;
public static void main(String args[])
{
System.out.println(i+" , ");
m(i);
System.out.println(i);
}
public void m(int i)
{
i += 2;
}
}
a) 1 , 3
b) 3 , 1
c) 1 , 1
d) 1 , 0
e) none of the above.
Answe:
none of the above
Explanation: non-static method m(i) cannot be cannot be referenced from a static context
Explanation:
The output of the program is 1 , 1. The parameter i inside the method m does not affect the original variable i in the testmeth class.
Explanation:The output of the program is 1 , 1.
In the program, the variable i is initially assigned the value of 1. The System.out.println(i+" , ") statement will print the value of i, which is 1, followed by a comma and a space. Then, the m(i) method is called.
However, the m(int i) method does not modify the value of the i variable in the testmeth class. In Java, primitive data types such as int are passed by value, so any modifications made to the parameter i inside the method will not affect the original variable i. Therefore, the value of i remains 1 and the last System.out.println(i) statement will print 1.
Write a program that allows the user to play a guessing game. The game will choose a "secret number", a positive integer less than 10000. The user has 10 tries to guess the number.
Answer:
// This program is written in C++
// Comments are used for explanatory purpose
// Program starts here
#include<iostream.h>
#include<stdlib.h>
int main()
{
// Declare variables
int num, selectno;
string status;
randomize();
//Generate random number;
num=rand()%10000;
// Prompt to guess a number
cout<<"You have only 10 tries\nTake a guess: ";
int tries = 0;
while (tries != 10)
{
cin>>selectno;
if(selectno == num){
cout<<"You passed at the "<<count+1<<" attempt";
tries = 10;
}
else
{
cout<<"You failed. Take another guess\n You have "<<10 - count + 1 <<" attempts";
}
tries++;
if(tries >= 10)
{
break;
}
}
return 0;
}
An internet access provider (IAP) owns two servers. Each server has a 50% chance of being "down" independently of the other. Fortunately, only one server is necessary to allow the IAP to provide service to its customers, i.e., only one server is needed to keep the IAP’s system up. Suppose a customer tries to access the internet
Question Continuation
Suppose a customer tries to access the internet on 8 different occasions, which are sufficiently spaced apart in time, so that we may assume that the states of the system corresponding to these 8 occasions are independent. What is the probability that the customer will only be able to access the internet on 2 out of the 8 occasions?
Answer:
0.311
Explanation:
Given
p = success = 2/8 = ¼ --- Probability that both servers down at any one event
p + q = 1
q = failure = 1 - ¼ = ¾ --- Probability that at most one server down at any one event
The number of ways that the customer will only be able to access the internet on 2 out of the 8 occasions is solved by applying binomial distribution below;
(p + q) ^n where n = 8 and r = 2 is
nCr * p^r * q ^ (n-r)
This becomes
8C2 * (¼)² * (¾)^6
= 8!/(6!2!) * 1/16 * 729/4096
= 0.31146240234375
= 0.311 --- approximated
Final answer:
The probability that at least one server is operational and the IAP can provide service is 75%, calculated by considering the independent 50% chance of each server being up and subtracting the 25% probability that both servers are down simultaneously.
Explanation:
Considering the scenario provided, we can calculate the probability of the Internet Access Provider (IAP) being able to provide service to its customers even with only one functioning server. Each server has a 50% chance of being down, which equivalently means each has a 50% chance of being up and operational. Since the occurrence of one server being down is independent of the other, we find the probability of both servers being down simultaneously to calculate the likelihood the IAP cannot provide service.
The probability of both servers being down is 0.5 (probability of Server 1 being down) × 0.5 (probability of Server 2 being down), which equals 0.25 or 25%. Consequently, the probability of at least one server being up and thus the IAP being able to provide service is 1 - 0.25, which equals 0.75 or 75%. This probability indicates a relatively high chance that the IAP will have at least one operational server at any given time.
Your company is implementing a wireless network and is concerned that someone from a competing company could stand outside the building and collect wireless data. You have assured the company that WPA2 is secure.
What makes WPA2 more secure than WPA?
A. AES
B. TKIP
C. RADIUS
D. TACACS
Answer:
Option A i.e., AES is correct.
Explanation:
The user corporation is installing the wireless server and seems to be worried when anyone representing the rival corporation might stands outside that property as well as gather wireless information. He ensured that corporation which WPA2 is safe. However, AES creates WPA2 stronger than WPA.
Option B is incorrect according to the following scenario because it is the security mechanism used when component through the IEEE 802.11i WLAN standard. Option C is incorrect according to the following scenario because it is the protocol initially developed for configure wireless clients to such a dial-in connection device. Option D is also incorrect according to the following scenario because it is the terminal access control.In a batch operating system, three jobs are submitted for execution. Each job involves an I/O activity, CPU time and another I/O activity of the same time span as the first. Job JOB1 requires a total of 23 ms, with 3 ms CPU time; JOB2 requires a total time of 29 ms with 5 ms CPU time; JOB3 requires a total time of 14 ms with 4 ms CPU time. Illustrate their execution and find CPU utilization for uniprogramming and multiprogramming systems.
Answer:
a) CPU utilization for uniprogramming system = 18.2%
b) CPU utilization for multiprogramming system = 41.379%
Explanation:
IO time = total time – CPU time
For JOB 1
CPU time = 3ms ,
total time= 23ms
IO time = 23-3 = 20ms ,
For JOB 2
CPU time =5ms
total = 29ms
IO time = 29-5 = 24ms
For JOB 3
CPU time = 4ms
total = 14ms
IO time = 14-10 =10ms
1.) In uniprogramming system, operations are performed sequentially
CPU utilization=total CPU time / total real time
CPU utilization =(3+5+4) / (23+29+14)
CPU utilization =0.182 or 18.2%
2) In multiprogramming system, jobs wait for the CPU to get free while performing IO operations concurrently
steps followed by the os
1. IO for 1st job at 0ms
2. IO for 2nd job at 0ms
3. IO for 3rd job at 0ms
4. CPU time for 3rd job at 5ms
5. Next IO job for 3rd job at 9ms END at 14ms
6. CPU time for 1st job at 9ms
7. Next IO job for 1st job at 14ms END at 23ms
8. CPU time for 2nd job at 14ms
9. Next IO job for 2nd job at 15ms END at 29ms
CPU time is 3+5+4 =12ms
Total execution time = 29ms
CPU utilization = 12*100/29= 41.379%
Kelvin called the meeting to order. The first person to address the group was Susan Hamir, the network design consultant from Costly & Firehouse, LLC. She reviewed the critical points from the design report, going over its options and outlining the trade-offs in the design choices. When she finished, she sat down and Kelvin addressed the group again: "We need to break the logjam on this design issue. We have all the right people in this room to make the right choice for the company. Now here are the questions I want us to consider over the next three hours." Kelvin pressed the key on his PC to show a slide with a list of discussion questions on the projector screen.
a. What questions do you think Kelvin should have included on his slide to start the discussion?
b. If the questions were broken down into two categories, they would be cost versus maintaining high security while keeping flexibility. Which is more important for SLS?
Answer:
a. Some of the questions Kelvin should have included on his slide to start the discussion are:-
• Why are there differences in opinion on internet architecture?
• What is the level of security that needs to be implemented?
• How can it be achieved, and what is the cost of this implantation?
• What is the best design, loops and pitfalls identified in each design, and shortcomings with each design?
b. It is always better to invest in maintaining high security with flexibility. Investing in a great design helps not only establishing a better ground to begin with, but can avoid headaches for later, when there may be a security breach/threat. Investing in a better design may help to prevent future issues.
Explanation:
The questions that Kelvin should have included on his slide to start the discussion include:
What is the importance of internet architecture to the company?Are there any challenges in its implementation?Internet architecture refers to distinct networks that interact with a common protocol. The layers of internet architecture include the network layer, data link layer, and application layer.
It should be noted that cost, high security, and flexibility are important for SLS. Therefore, it's important to choose an architecture that addresses all of them.
Read related link on:
https://brainly.com/question/12769747