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.')
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.
Answer:
The code snippet file is attached. There are four files:
Abstract Applicant ClassThe Graduate ClassThe Undergraduate classThe TestApplicantClassThe code is well commented and explanatory.
Explanation:
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.
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.
#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?
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
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
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.