Coursehelp
April 16, 2019

## (Solved) : Work Function Material 452 Ev Threshold Wavelength Photo Electronic Emission Q30301267 . . .

The work function of a material is 4.52 eV. What is thethreshold wavelength for photo electronic emission?

. . .

OR
OR

## Questions viewed by other students

• QUESTION : (Solved) : Code Reentrant Line Would Interrupt Haveto Occur Cause Bug Manifest Please Explain Answer Q32317704 . . .

A) Why is this code not reentrant? On what line would aninterrupt haveto occur to cause the bug to manifest? Please explainyour answer

9. During a driver’s interrupt handling routine, once the interrupt has been acknowledgedit is possible for another interrupt to occur that will invoke the same handler. Drivers that produce correct results in this scenario are called reentrant. Consider the following interrupt handler: or athe 1 char temp void interrupt hardlar(void) char , x2; x1-inb (Ox120); // read from 1/0 port x2 1nb (0x121); // read from 1/0 Port 1 acknovledgeinterrupt O 12 temp=x1; x1-x2 x2-tep printf(“Cot and swapped x1-% d x2-%dn.’ x1, x2); is Show transcribed image text 9. During a driver’s interrupt handling routine, once the interrupt has been acknowledgedit is possible for another interrupt to occur that will invoke the same handler. Drivers that produce correct results in this scenario are called reentrant. Consider the following interrupt handler: or athe 1 char temp void interrupt hardlar(void) char , x2; x1-inb (Ox120); // read from 1/0 port x2 1nb (0x121); // read from 1/0 Port 1 acknovledgeinterrupt O 12 temp=x1; x1-x2 x2-tep printf(“Cot and swapped x1-% d x2-%dn.’ x1, x2); is

. . .

• QUESTION : (Solved) : Code Re Write Following Code Segment Using Switch Case Statement Assume Variables Already Q36000297 . . .

Which code is the re-write the following code segment usingswitch-case statement?
We assume that all variables are alreadydefined.
int choice;
choice = scan.nextInt(); //input the choicenumber and store as integer.
// Respond to the user’s menu selection.
if (choice == 1) {
cout<<“For how many months? “<<endl;
months =scan.nextInt();
cout<<“The total charges are \$”<<charges<<endl;
}
else if (choice == 2) {
cout<<“For how many months?”<<endl;
months = scan.nextInt();
charges = months * CHILD;
cout<<“The total charges are \$”<<charges<<endl;
}
else if (choice == 3) {
cout<<“For how many months?”<<endl;
months = scan.nextInt();
charges = months * SENIOR;
cout<<“The total charges are \$”<<charges<<endl;
}
else if (choice == 4) {
cout<<“Programending.”<<endl;

}
else  {
cout<<“The valid choices are 1through 4. Run the”<<endl;
cout<<“program again and selectone of those.”<<endl;

}

. . .

• QUESTION : (Solved) : Code Radiationsensorjava Package Pattreactormonitoring Public Class Radiationsensor Extend Q36823758 . . .

Code:

package patt.ReactorMonitoring;import java.text.SimpleDateFormat;import java.util.Calendar;public abstract class RadiationMonitor implements Observer { /** * Constructs a RadiationMonitor object. * * @param location An arbitrary location. */ public RadiationMonitor(String location) { } /** * Gets the location * * @return location */ public String getLocation() { } /** * Generates a report based on the current observation. * * @return a report */ public abstract String generateReport(); /** * Gets the current time. * * @return The current time in yyyy-MM-dd HH:mm:ss format */ public String now() { String DATE_FORMAT_NOW = “yyyy-MM-dd HH:mm:ss”; Calendar calendar = Calendar.getInstance(); SimpleDateFormat date = new SimpleDateFormat(DATE_FORMAT_NOW); return date.format(calendar.getTime()); }}

ReactorMonitoring.java:

package patt.ReactorMonitoring;public class ReactorMonitoring { public static void main(String[] args) { // Install a sensor at Reactor A RadiationSensor sensor = new RadiationSensor(“Reactor A”, 10); // Create sensor observers RadiationMonitor control = new ControlRoom(“Reactor A Control Room”, 8.0); RadiationMonitor science = new ResearchCentre(“Centre for Nuclear Research”); // Attach observers to sensor sensor.attachObserver(control); sensor.attachObserver(science); // Simulate a scenario try { while (true) { sensor.readRadiation(); Thread.sleep(4000); } } catch (InterruptedException e) { e.printStackTrace(); } }}

Observer.java:

package patt.ReactorMonitoring;/** * Observer interface as part of the Observer Pattern code * @author hogan * */public interface Observer { /** * Query the subject to determine what was the change of state * and respond appropriately based on the subject’s new state. * * @param s The subject that has been updated. */ public void update(Subject s);}

ControlRoom.java:

package patt.ReactorMonitoring;public class ControlRoom extends RadiationMonitor { /** * Constructs a ControlRoom object, which observes reactor radiation readings * and prints reports if the radiation exceeds a threshold. * * @param location An arbitrary location. * @param warningThreshold The radiation threshold for when reports should be printed. */ public ControlRoom(String location, double warningThreshold) {= } /** * Updates the monitor with a new observation and prints a report if and only if * the observation is equal to or greater than the warning threshold. */ public void update(Subject subject) { } /** * Generates a report based on the current observation. */ @Override public String generateReport() { }}

ResearchCentre.java:

package patt.ReactorMonitoring;public class ResearchCentre extends RadiationMonitor { /** * Constructs a ResearchCentre object, which observes reactor radiation readings * and constantly prints a report with the current moving average of the * recorded observations. * * @param location An arbitrary location. */ public ResearchCentre(String location) { } /** * Updates the monitor with a new observation and prints a report. */ public void update(Subject subject) { } /** * Generates a report of the current moving average, updated by a new * observation. The moving average is calculated by summing all observations * made so far, and dividing by the quantity of observations so far. */ public String generateReport() { }}

Subject.java:

. . .

• QUESTION : (Solved) : Code R Question Answered Using Weekly Data Set Part Islr Package R Package Book Introducti Q29648832 . . .

CODE IN R

This question should be answered using the Weekly data set,which is part of the ISLR package (R package) from the book“Introduction to statistical learning with applications in R.” Thisdata is similar in nature to the Smarket data from the chapter 4’slab, except that it contains 1,089 weekly returns for 21 years,from the beginning of 1990 to the end of 2010.

FILE IN R:https://github.com/elenawangcap/ml/tree/master/Review

(a) Produce some numerical and graphical summaries of the Weeklydata. Do there appear to be any patterns?

(b) Use the full data set to perform a logistic regression withDirection as the response and the five lag variables plus Volume aspredictors. Use the summary function to print the results. Do anyof the predictors appear to be statistically significant? If so,which ones?

(c) Compute the confusion matrix and overall fraction of correctpredictions. Explain what the confusion matrix is telling you aboutthe types of mistakes made by logistic regression.

(d) Now fit the logistic regression model using a training dataperiod from 1990 to 2008, with Lag2 as the only predictor. Computethe confusion matrix and the overall fraction of correctpredictions for the held out data (that is, the data from 2009 and2010).

(e) Repeat (d) using linear discriminant analysis (LDA). Thismethod uses the Bayes classifier with a Gaussian distribution. Eventhough the discriminant functions are linear functions of theinputs (x), the combination of several classifiers may lead toclassification of non-linear problems.

(f) Repeat (d) using KNN with K = 1.

(g) Which of these methods appears to provide the best resultson this data?

(h) Experiment with different combinations of predictors,including possible transformations and interactions, for each ofthe methods. Report the variables, method, and associated confusionmatrix that appears to provide the best results on the held outdata. Note that you should also experiment with values for K in theKNN classifier.