#include ... void sig_handler(){ static int i = 1; printf("Beep\n"); alarm(i); ++i; } int main(){ struct sigaction sa; sa.sa_flags = 0; sa.sa_handler = sig_handler; if(sigaction(SIGALRM, &sa, NULL) != 0){ printf("Failed to bind handler.\n"); exit(1); } printf("Going into an infinite loop.\n"); alarm(1); while(1); return 0; }

Suppose the above program is run for 7.5 seconds after it prints "Going into an infinite loop". The program is run multiple times where the "system load" from other processes sharing the cpu will vary from none to many other processes. Which best characterizes how many times "Beep" is printed?

Answers

Answer 1

Answer:

Explained below

Explanation:

After the compiling the program it prints "Going to infinite loop" after that i started the timer till 4.5 sec. The program prints more than 4 beeps nearly 6-7 beep messages were printed.

The number "Beep" would always be strictly greater than 4.

Hence, if the above program is run for 7.5 seconds after it prints "Going in an infinite loop", it will print Beep for about 9-10 times. Hence, the number will always be greater than 7


Related Questions

Physical access, security bypass, and eavesdropping are examples of how access controls can be ________.

Answers

Answer: Compromised

Explanation:

Access control is the controlling and management unit for handling the  access of any user on a particular system. It implements a selective restriction on the users to access the function of computing system.

Authorized and permitted user are allowed to access the services and unauthorized party is not allowed for accessing the resources of the system. Permissible user can perform any task and consume service device.Compromising in access control depicts about intruding and spying of unauthorized user in devices that is eavesdropping. Security bypass is fault that lets the access to access system by another route.Thus, flaw in access control occurs then security of controlling and managing the system will be at risk as hacker and attacker can get access to perform function.

Final answer:

Physical access, security bypass, and eavesdropping can compromise access controls that protect information within an organization. Implementing strong access control policies helps prevent unauthorized access and data breaches.

Explanation:

Physical access, security bypass, and eavesdropping are examples of how access controls can be compromised.

Access control mechanisms are critical for protecting the confidentiality, integrity, and availability of information. When these controls fail or are bypassed, it can lead to unauthorized access and potentially to the leakage or corruption of sensitive data. Physical access refers to situations where an unauthorized individual gains direct access to hardware or systems. Security bypass occurs when normal security procedures are avoided or circumvented, often due to system or human vulnerabilities. Eavesdropping is the act of secretly listening to private conversations or monitoring transmissions, which can be a form of information theft.

Organizations must implement strong access control policies and measures, including physical security, authentication protocols, and encryption, to reduce the risk of these types of compromises and to safeguard their information assets effectively.

Which of the following is the definition of registration authority ( RA)?

a. The process of applying an algorithm to cleartext (or plain text) data, resulting in a ciphertext.
b. The certificate authority’s list of invalid certificates.
c. The concept of ensuring that an originator cannot refute the validity of a statement or document.
d. An entity that is responsible for the registration and initial authentication of certificate subscribers.

Answers

Answer:

The correct answer following question will be Option D.

Explanation:

An authority that verifies the user requests for digital certificates and tells to the CA (Certificate authority) to issue the certificates, known as Registration Authority (RA). The digital certificate contains a key named "public key" which is used to encrypt and decrypt digital signatures.

Hence, registration authority, it's an entity that is responsible for the authentication of certificate and registration and the other given options are not relatable to this authority.

So, option D is the correct answer.

In evaluating a loop, you find the following statement:
"value += 1".
What happens to the value variable upon each iteration of the loop?
Group of answer choices:
A. The variable's value is changed to a positive value.
B. The variable is reset to an int type, with a value of 1.
C. The variable is incremented by itself.
D. The variable is increased by 1 each iteration through the loop.

Answers

Answer:

D) The variable is increased by 1 each iteration through the loop

Explanation:

In Most popular programming languages such as java, c++, python etc, there is a variance to the simple assignment operator. (=). This variance is called a compound assignment operator. Compound operators come in different styles for example

x = x+1 equivalent x+=1

x = x-1 equivalent x- =1

x = x/y equivalent x/=y

In the question scenario value += 1 is equivalent to value = value+1. Compound operators are important in providing short hands while coding as well as helping the programmer from having to cast variable types explicitly

________ symbol is used in the "Advanced" section of the time range picker to round down to nearest unit of specified time.

Answers

Answer:

@(at sign) is the correct answer to the following statement.

Explanation:

Because the following symbol is the "at sign" symbol that is used for the Advanced section in the time range picker that lets the user search for the specified time for the round down the closest entity of a particular period. So, that's why the following answer is correct for the following statement.

Write code to create a set with the following integers as members: 10, 20, 30, and 40.

Answers

Answer:

import java.util.*;  

public class Create_set

{

   public static void main(String args[])

   {

       Set<Integer> hset = new HashSet<Integer>(); //creating set using hashset of Integer type

       hset.add(10); //add method add members to set

       hset.add(20);

       hset.add(30);

       hset.add(40);

       System.out.println(hset); //printing the set

       

   }

}

OUTPUT :

[20,40,10,30]

Explanation:

The above code is implemented through java language. First a collection object is created using Set interface. Then that interface is implemented using Hashset class. As they are of generic datatype, Integer type is declared for this object. Then using add() method elements of the set are added and at last they are printed.

Set is an unordered collection which means elements can't be accessed through their particular position and no duplicate values are stored in sets.  

Write an abstract superclass encapsulating a college applicant:

A college applicant has two attributes: the applicant’s name and the college the applicant is applying to.

This class has two non-abstract subclasses: one encapsulating an applicant for undergraduate school, and the other encapsulating an applicant for graduate school.

An applicant for undergraduate school has two attributes: a SAT score and a GPA. An applicant for graduate school has one additional attribute: the college of origin.

It also has a method that returns "from inside" if the college of origin is the same as the college applied to; otherwise, it returns "from outside".

You also need to include a class to test two classes.Java please.

Answers

Answer:

The code snippet file is attached. There are four files:

Abstract Applicant ClassThe Graduate ClassThe Undergraduate classThe TestApplicantClass

The code is well commented and explanatory.

Explanation:

Given below is information about a network.

Choose one of the following three​ options:
A. the network is definitely a​ tree;
B. the network is definitely not a​ tree;
C. the network may or may not be a tree​ (more information is​ needed).

Accompany your answer with a brief explanation for your choice. The network has 11 vertices and 11 edges.

Answers

Answer:

Option (B) is the correct answer.

Explanation:

The network is used to share the information between two or more persons or systems in a connected pair. It has vertices and edges on which vertices mean the points which participate to communicate and edges are used for the medium by which communication is done.

The network can make the shape of a tree or not. If it follows the property of a tree we can say that it is a tree otherwise it can not be called a tree.

Here in the question, it is a given that there are 11 vertices and 11 edges.

But from the tree property if there are n vertices and n-1 edges then any circuit is called a tree, But this circuit has n edges and n vertices that's why it is not a tree. Hence option b is the correct answer.

While other is not valid because-

Option "a" suggests that this circuit is a tree that is not correct.Option b suggests that this circuit may or may not a tree but it is proved that this circuit is not a tree.

Sales and marketing users have similar roles, and use similar record types. However, sales uses 3 different fields and marketing has 5, how do you set up processes most efficiently?

A. 2 page layouts, 2 record types, 2 profiles
B. 2 page layouts, 1 record type, 2 profiles
C. 1 page layout, 2 record types, 2 profiles
D. 1 page layout, 1 record type, 1 profile

Answers

Answer:

B. 2 page layouts, 1 record type, 2 profiles

Explanation:

The most efficient way to setup the process is by setting 2 page layouts, 1 record type and also 2 profiles.

What should you double check for some reason its not working? You have created a workflow rule to send an email in your configuration sandbox.

A. You have the correct email address
B. HTML does not work in sandbox, make sure your email has no HTML
C. Check the deliverability settings
D. Look at the system audit trail

Answers

Answer:

Option A and C are the correct options

Explanation:

The following options is true because when the user created the flow of the work rule for sending an email in their configuration sandbox then, the user correct these email address and also users can examine their deliverability setting.

Option B is false because the HTML also works in the sandbox.

Option D is false because the audit trail did not look at the system.

Alice is working on a web page to attract the maximum number of people to join her cause. She wants to inform people about the benefits of adopting eco-friendly methods of living. Which writing style should she use to get visitors to join her cause?


A. formal writing style

B. informal writing style

C. standard writing style

D. persuasive writing style

#.

Answers

Answer:

Option D.    Persuasive writing style

is correct answer.

Explanation:

Alice should adopt the persuasive writing style as she wants to convince the people to adopt eco-friendly methods of living.When a person write persuasively, this means he/she will present justifications and reasons for that specific opinion he/she is trying to convince the audience.For the correctness of their opinion, different kinds of evidences are prepared so that the fact persuade the reader.Persuasive writing is used widely while writing academic papers, advertisements  and argumentative essays as well.i hope it will help you!

Answer:

D.) persuasive writing style

Explanation:

A company has made the decision to host their own email and basic web services. The administrator needs to set up the external firewall to limit what protocols should be allowed to get to the public part of the company's network. Which ports should the administrator open? (Choose three.)

Answers

Answer:

Port 25

Port 53

Port 80

Explanation:

Port 25 is to be used for relaying messages between MTAs (Mail Transfer Agents) or from MSAs (Mail Submission Agents) to MTAs.

Port 53 is used by the Domain Name System (DNS), a service that turns human readable names like AuditMyPc.com into IP addresses that the computer understands. Because port 53 is usually open, malicious programs may attempt to communicate on it.

On a Web server or Hypertext Transfer Protocol daemon, port 80 is the port that the server "listens to" or expects to receive from a Web client, assuming that the default was taken when the server was configured or set up. By default, the port number for a Web server is 80.

To create the array variable named ar, you would use :A. int ar;
B. int() ar;
C. int[] ar;
D. None of these

Answers

Answer: (C)

Explanation:

You can declare it as:

int[ ] ar; or

int ar[ ];

Final answer:

To create an array variable named 'ar', the correct syntax is  'int[] ar;'. This declares 'ar' as an array of integers,

Therefore, the correct answer is option c  'int[] ar;'

Explanation:

To create an array variable named ar in many programming languages such as Java, you would use the syntax provided in option C: int[] ar; This line of code defines an array of integers. The square brackets ([]), which come after the data type, tell the compiler that this variable will be used as an array, which can store multiple values of the specified type, in this case, integers.

A dictionary attack works by hashing all the words in a dictionary and then comparing the hashed value with the system password file to discover a match.

A. True
B. False

Answers

Answer:

True

Explanation:

A dictionary attack is an attempts to gain illegal access to a computer system by hashing all the words in a dictionary and then systematically entering each hashed value as a password so as to discover a match. it has been the most successful password guessing technique over the years because many users and organization use ordinary words as passwords.

A line in the Agile Manifesto reads, "____________ and _____________ over processes and tools". Please select which option best completes the statement. Select one:
a. People; Relationships
b. Customer; Individuals
c. Customers; Employees
d. Individuals; Interactions

Answers

Answer:

Option D i.e., Individuals; Interactions is the correct option.

Explanation:

Because Agile Manifesto is the development software tool that is used to reads the line for the individuals and it also interacts with the process of the user. It also used to collaborate with their customers to negotiates the contacts of the customers.

Other option is not correct because they are not related to the following statement.

You have several pictures of different sizes that you would like to frame.A local picture framing store offers two types of frames—regular andfancy. The frames are available in white and can be ordered in any colorthe customer desires. Suppose that each frame is 1 inch wide. The costof coloring the frame is $0.10 per inch. The cost of a regular frame is$0.15 per inch and the cost of a fancy frame is $0.25 per inch. The costof putting a cardboard paper behind the picture is $0.02 per square inchand the cost of putting glass on top of the picture is $0.07 per square inch. The customer can also choose to put crowns on the corners,which costs $0.35 per crown. Write a program that prompts the userto input the following information and then output the cost of framing the picture:a. The length and width, in inches, of the picture.b. The type of the frame.c. Customer's choice of color to color the frame.d. If the user wants to add the crowns, then the number of crowns.

Answers

Answer:

written in java

Note :  Package name was excluded

 

import java.util.Scanner;

public class Main {

   public static void main(String[] args) {

       //declared 8 uninitialised variable  

       String input;

       double cost, colorC, frameC, paperC, glassC, crownC;

       char crowns;

       int type, color, crown, length, width, area, perimeter;

       

       //creating an instance of the Scanner class to accept value from user

       Scanner scanner = new Scanner(System.in);

       System.out.print("Enter length of frame: ");

       length = scanner.nextInt();

       System.out.print("Enter width of frame: ");

       width = scanner.nextInt();

       System.out.print("Do you want a fancy frame or a regular frame\nEnter 1 for fancy, 2 for regular: ");

       type = scanner.nextInt();

       if (type == 1) {

           frameC = 0.25;

       } else {

           frameC = 0.15;

       }

       System.out.print("Do you want a white frame or a colored frame\nEnter 1 for white, 2 for colored: ");

       color = scanner.nextInt();

       if (color == 2) {

           colorC = .10;

       } else{

           colorC = 0;

       }

       System.out.print("Do you want crowns \nEnter y for yes, n for no ");

       input = scanner.next();

       crowns = input.charAt(0);

       if (crowns == 'y' || crowns == 'Y') {

           System.out.print("How many crowns?");

           crown = scanner.nextInt();

       } else

           crown = 0;

       if (crown > 0)

           crownC = crown * .35;

       else

           crownC = 0;

       area = length * width;

       perimeter = length * 2 + width * 2;

       paperC = area * .02;

       glassC = area * .07;

       cost = glassC + paperC + crownC + colorC * perimeter + frameC * perimeter;

       System.out.println("The cost of your frame is: $" + cost);

   }

}

Create a VBScript script (w3_firstname_lastname.vbs) that takes one parameter (folder name) to do the following

1) List all files names, size, date created in the given folder
2) Parameter = Root Folder name The script should check and validate the folder name
3) Optionally, you can save the list into a file "Results.txt" using the redirection operator or by creating the file in the script.
4) Make sure to include comment block (flowerbox) in your code.
5) Sample run:- C:\entd261>cscript.exe w3_sammy_abaza.vbs "c:\entd261" >results.txt

Answers

Answer:

VBScript is given below

Explanation:

As per the given details the program should be as follows:

if (WScript.Arguments.Count = 0) then

WScript.Echo "Missing parameters"

else

'Declare the File System object to be used

Dim fso

'Declare the path variable to be used for storing the path entered by user

Dim path

'Create the File System object using the FileSystemObject class

Set fso = CreateObject("Scripting.FileSystemObject")

'initialize the path

path = WScript.Arguments(0)

'Check if the path exists

exists = fso.FolderExists(path)

if (exists) then

'declare a constant of size 1024 since 1024 bytes = 1 Kb

CONST bytesToKb = 1024

'Print the selected path

WScript.Echo "Selected Path " & WScript.Arguments(0)

'get the folder on path

Set inDir=fso.GetFolder(path)

'Create the file to store the output results

Set outFile = fso.CreateTextFile("Results.txt",True)

'Print the name, date created and size of each file and store the same in output file

For Each objFile in inDir.Files

  'Calculate the padding needed for File Name. Assuming the maximum length of file name is 40 characters

  namePadding = 40 - Len(objFile.Name)

  'Calculate the padding needed for Date

  datePadding = 30 - Len(objFile.DateCreated)

  'Add spaces to file Name so that same can be printed in a tabular format

  fileName = objFile.Name & Space(namePadding)

  'Add spaces to date so that same can be printed in a tabular format

  dateCreated = objFile.DateCreated & Space(datePadding)

  'Print the details on screen

  Wscript.Echo fileName & dateCreated & CINT(objFile.Size / bytesToKb) & "Kb"

  'Store the details in ouput file with a newline character at the end

  outFile.Write fileName & dateCreated & CINT(objFile.Size / bytesToKb) & "Kb" & vbCrLf

Next

'Close the output file once the loop ends

outFile.Close

else

'Print a message if the path does not exist

WScript.Echo "Invalid Path Entered"

end if

end if

In this exercise we have to use the programming knowledge to program from python in this way, so:

The code to solve this programming can be found in the image attached below.

As per the given details the program should be as follows:

if (WScript.Arguments.Count = 0) then

WScript.Echo "Missing parameters"

else

'Declare the File System object to be used

Dim fso

'Declare the path variable to be used for storing the path entered by user

Dim path

'Create the File System object using the FileSystemObject class

Set fso = CreateObject("Scripting.FileSystemObject")

'initialize the path

path = WScript.Arguments(0)

'Check if the path exists

exists = fso.FolderExists(path)

if (exists) then

'declare a constant of size 1024 since 1024 bytes = 1 Kb

CONST bytesToKb = 1024

'Print the selected path

WScript.Echo "Selected Path " & WScript.Arguments(0)

'get the folder on path

Set inDir=fso.GetFolder(path)

'Create the file to store the output results

Set outFile = fso.CreateTextFile("Results.txt",True)

For Each objFile in inDir.Files

 namePadding = 40 - Len(objFile.Name)

 'Calculate the padding needed for Date

 datePadding = 30 - Len(objFile.DateCreated)

   fileName = objFile.Name & Space(namePadding)

  dateCreated = objFile.DateCreated & Space(datePadding)

 'Print the details on screen

 Wscript.Echo fileName & dateCreated & CINT(objFile.Size / bytesToKb) & "Kb"

 'Store the details in ouput file with a newline character at the end

 outFile.Write fileName & dateCreated & CINT(objFile.Size / bytesToKb) & "Kb" & vbCrLf

Next

'Close the output file once the loop ends

outFile.Close

else

'Print a message if the path does not exist

WScript.Echo "Invalid Path Entered"

end if

end if

See more about python at brainly.com/question/26104476

Write a program that uses nested loops to collect data and calculate the average rainfall over a period of years. The program should first ask for the number of years. The outer loop will iterate once for each year. The inner loop will iterate four times, once for each quarter. Each iteration of the inner loop will ask the user for the inches of rainfall for that quarter.

Answers

Answer & Explanation:

Written in java

import java.util.Scanner;

public class Main{

   public static void main(String[] args) {

       int totalRainfall = 0;

       int rainfall;

       Scanner keyboard = new Scanner(System.in);

       int year;

       do {

           System.out.println("Enter number of year(s): value must be greater than 0");

           year = keyboard.nextInt();

       } while (year < 1);

//        {

//

//            System.out.println("Invalid input, please enter a number greater than zero ");

//

//            year = keyboard.nextInt();

//

//        }

       for (int i = 0; i < year; i++) {

           for (int quarter = 1; quarter <= 4; quarter++) {

               int currentYear = 1 + i;

               System.out.println("Enter the inches of rainfall for year " + currentYear + " quarter " + quarter);

               rainfall = keyboard.nextInt();

               if(rainfall > -1){

                   totalRainfall += rainfall;

               }

               while (rainfall < 0) {

                   System.out.println("Enter the inches of rainfall for year " + currentYear + " quarter " + quarter +": value must be greater or equal to 0 ");

                   rainfall = keyboard.nextInt();

               }

           }

       }

       

       System.out.println("Average quarterly rainfall is: " + (totalRainfall/(year*4)));

       System.out.println("Average yearly rainfall is: " + (totalRainfall/(year)));

   }

}

Final answer:

A Python program is provided that calculates the average rainfall over a number of years. User inputs the number of years, then for each quarter of each year, the rainfall in inches. The program computes and outputs the average rainfall in inches and converts it to millimeters.

Explanation:

The program to calculate the average rainfall over a period of years will involve two nested loops. The outer loop will iterate through the number of years, while the inner loop will iterate through each quarter of a year. For each quarter, the program will collect the rainfall data in inches and calculate the average, eventually converting the final result to millimeters.

Python Code Example:

years = int(input('Enter number of years: '))
total_rainfall = 0
for year in range(1, years + 1):
 for quarter in range(1, 5):
   rainfall = float(input(f'Enter the inches of rainfall for year {year} quarter {quarter}: '))
   total_rainfall += rainfall
average_rainfall_inches = total_rainfall / (years * 4)
average_rainfall_mm = average_rainfall_inches * 25.4
print(f'The average rainfall over {years} years is {average_rainfall_inches} inches or {average_rainfall_mm} mm.')

Which of the following is false? Group of answer choices A) A string may include letters, digits, and various special characters (i.e., +, -, * ) B) String literals are written inside of single quotesC) A string may be assigned in a definition to either a character array or a variable of type char * D) A string in C is an array of characters ending in the null character (‘\0’)

Answers

Answer:

Option (b) is the correct answer.

Explanation:

Here in option "D", "C" language is used, so the answer is given on the behalf of "C" language and in "C" language, the String is written in double quotes which are opposite of option "b" hence it is a wrong statement. hence it is the correct option for this question.

The String is also called a word in the English language which is made of character. So in C programming language, a user needs to create a character array to store the string because the array is used to create multiple variables of the same type and variable is used to store the data.

In any programming language character array is used to store the string but for back-end and the user uses String data type for the front-end.

Option a states that the string is made up of character, letter, digits and special symbol which is correct.Option c states that a string is assigned on the character array which is correct.Option d states that the last character of the "String" is the "NULL" character which is also right.

Final answer:

The false statement is B) String literals are written inside of single quotes.

Explanation:

The false statement among the given options is B) String literals are written inside of single quotes. In programming languages like C, C++, and Java, string literals are written inside double quotes, not single quotes. For example, "Hello, World!" is a string literal.

What is the importance of having standard framework for networking and the evolution of networks?

Answers

Answer:

Generally, a framework is more comprehensive and perspective than a protocol and a structure.

Explanation:

Importance of standard framework for the evolution of the networks:

The two dealer systems can not directly communicate because every different dealer follows different apparatus and protocols.Used for communicating across different networks.

There are two types of the framework used in computer networks, these are as follows:

OSI Reference modelTCP/IP Model

To communicate between the computer, a framework can be provided by any of the models either its OSI or TCP/IP.

Other Questions
Find an ordered pair ( x, y ) that is a solution to the equation. 3x+y=7 As with anorexia nervosa, about ________ percent of individuals who develop bulimia nervosa eventually recover from the disorder. Question 1How did the Leo Frank case impact Georgia society?The rise in antisemitism in Georgia that resulted from the case contributed to the reemergence of the Ku Klux Klan.The increase in migration from the north to Georgia in response to the case helped reinvigorate the state's economy.The state government struck down various discriminatory laws in response to the events of the case to protect religiouethnic minorities.The federal government intervened to remove Georgia's governor from power for his support of the racial violence tharesulted from the case. write the equation of a line that passes through the point -5,-4 and has a slope of 1/5. Factor the expression 3x2 + 2x - 8 "During the _____ stage people are concerned with whether or not they have created something they really care about in life." Two numbers have a sum of 1,212 and a difference of 518. What are the two numbers? Find the area of a rhombus with side length 6 and an interior angle with measure $120^\circ$. How many carbon atoms are there in the empirical formula corresponding to C10H22O2? how does declaration reflect modern American value? a line intersects the points (13,-4) and (1,12).Find the slope and simplify completely Consumer surplus is___________. A. the highest price a consumer is willing to pay to consume a good or service. B. the difference between the highest price a consumer is willing to pay and the lowest price a firm would be willing to accept. C. the difference between the highest price a consumer is willing to pay and marginal benefit. D. the difference between the lowest price a firm would be willing to accept and the price it actually receives. E. the difference between the highest price a consumer is willing to pay and the price the consumer actually pays. New lithosphere is produced in association with: A. mid-ocean ridges. B. hydrothermal vents. C. fracture zones. D. transform faults. E. deep-sea trenches. vector A has a magnitude of 60 units eastward and vectorB has a magnitude of 11 units northward. What is themagnitude of the resultant between vectors A & B? Which of the following can be a symptom of AIDS? A. severe weight loss B. elevated blood pressure C. heart murmurs D. all of the above Please select the best answer from the choices provided. A In the video, where does the officer recommend placing your hands on the steering wheel during a traffic stop? Was the Nile river part of the topography Egypt What is the quotient of and?What is the quotient of 3/4 and 5/6? Which of the following effects would you expect if red blood cells were shaped like neurons?They would not be able to move as easily through capillaries. They would more easily carry out gas exchange in the alveoli.They would not need to be transported through the body.They would become more effective at picking up urea discarded by body cells. Erica says that 1/5 of the national flag of Thailand shown on the right is blue. whats wrong? Steam Workshop Downloader