Blog

Coursehelp
April 16, 2019
QUESTION : No Comments

(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?

Expert Answer


. . .

OR
OR

Have a Comment on this Question?

Questions viewed by other students


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

    9. During a drivers 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

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

    B) How could you fix it so that it is reentrant? 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

    Expert Answer


    . . .


    view full answer
  • 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();

         
 charges = months * ADULT;


       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;



    }

    Expert Answer


    . . .


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

    Use the observer pattern to implement a system for monitoring the radiation of a reactor. You are provided with Subject and o

    Code:

    RadiationSensor.java:

    package patt.ReactorMonitoring;public class RadiationSensor extends Subject { /** * Constructs a RadiationSensor object * * @param location An arbitrary location. * @param seed A seed for the random number generator used to simulate radiation * readings. */ public RadiationSensor(String location, int seed) { } /** * Gets the location * * @return location */ public String getLocation() { } /** * Gets the radiation. * * @return radiation */ public double getRadiation() { } /** * Updates radiation, changes the state to true, and notifies all observers of * the change. */ public void readRadiation() { }}

    RadiationMonitor.java:

    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:

    package patt.ReactorMonitoring;import java.util.ListIterator;import java.util.List;import java.util.ArrayList;/** * Subject abstract class for Observer pattern. * This provides the core implementation to manage a subject’s observers. * * @author Richard Thomas * */public abstract class Subject { private List<Observer> observers = new ArrayList<Observer>(); /** * Being clear that the Subject constructor does nothing. */ public Subject() { } /** * Add an observer to the list that are monitoring this subject. * @param o The observer to be added to this subject’s list. */ public void attachObserver(Observer o) { observers.add(o); } /** * Remove this observer from the list that are monitoring this subject. * It is no longer interested in updates to this subject. * @param o The observer to remove from this subject’s list */ public void detachObserver(Observer o) { observers.remove(o); } /** * Notify all of the observers monitoring this subject that the subject * has been updated. */ public void notifyObservers() { ListIterator<Observer> iter = observers.listIterator(); while (iter.hasNext()) { iter.next().update(this); } }}Use the observer pattern to implement a system for monitoring the radiation of a reactor. You are provided with Subject and observer which are equivalent to the provided Subject and observer from the practical and are already complete. Your task is to complete the implementation of four classes: Radiationsensor which extends Subject. Because we do not have a real reactor to monitor, we will simulate radiation readings using a random number generator. . readRadiation should set a private radiation variable to a random double between 0 and 10 . RadiationMonitor which implements Observer. Note that now is already complete, but you will need to implement the rest of the class . ControlRoom which extends RadiationMonitor . ResearchCentre which extends RadiationMonitor The ReactorMonitoring class is provided to help with testing and does not need to be submitted. In its current state, the expected output (when all four classes are complete) is shown below. If you code is correct, you can expect to see this output every single time, because a seed of 1O is specified when the RadiationSensor is constructed. Therefore, you should make sure you get this output before you submit to AMS 2018-04-01 16:40:10moving average 7.3043 Centre for Nuclear Research 2018-04-01 16:40:14: moving average 4.9412: Centre for Nuclear Research 2018-04-01 16:40:18: moving average3.4915: Centre for Nuclear Research 2018-04-01 16:40:22moving average 3.2289 : Centre for Nuclear Research 2018-04-01 16:40:26 moving average 4.2207 : Centre for Nuclear Research 2018-04-01 16:40:26 :WARNING:: 8.1881:: Reactor A Control Room 2018-04-01 16:40:30 moving average 4.1350: Centre for Nuclear Research 2018-04-01 16:40:34 s moving average 4.7675 Centre for Nuclear Research 2018-04-01 16:40:34 1 WARNING: 8.5628 :: Reactor A Control Room 2018-04-01 16:40:38 moving average 5.0653 : Centre for Nuclear Research 2018-04-01 16:40:42 moving average 4.8217 Centre for Nuclear Research Note that observations need to be logged upon update, not upon report generation. And when reported, the radiation levels must be rounded to four decimal places. Use String.format(O to achieve this. Finally, upload and submit your 4 classes: . RadiationSensor ControlRoom . ResearchCentre Along with: . Subject .Observer Show transcribed image text Use the observer pattern to implement a system for monitoring the radiation of a reactor. You are provided with Subject and observer which are equivalent to the provided Subject and observer from the practical and are already complete. Your task is to complete the implementation of four classes: Radiationsensor which extends Subject. Because we do not have a real reactor to monitor, we will simulate radiation readings using a random number generator. . readRadiation should set a private radiation variable to a random double between 0 and 10 . RadiationMonitor which implements Observer. Note that now is already complete, but you will need to implement the rest of the class . ControlRoom which extends RadiationMonitor . ResearchCentre which extends RadiationMonitor The ReactorMonitoring class is provided to help with testing and does not need to be submitted. In its current state, the expected output (when all four classes are complete) is shown below. If you code is correct, you can expect to see this output every single time, because a seed of 1O is specified when the RadiationSensor is constructed. Therefore, you should make sure you get this output before you submit to AMS 2018-04-01 16:40:10moving average 7.3043 Centre for Nuclear Research 2018-04-01 16:40:14: moving average 4.9412: Centre for Nuclear Research 2018-04-01 16:40:18: moving average3.4915: Centre for Nuclear Research 2018-04-01 16:40:22moving average 3.2289 : Centre for Nuclear Research 2018-04-01 16:40:26 moving average 4.2207 : Centre for Nuclear Research 2018-04-01 16:40:26 :WARNING:: 8.1881:: Reactor A Control Room 2018-04-01 16:40:30 moving average 4.1350: Centre for Nuclear Research 2018-04-01 16:40:34 s moving average 4.7675 Centre for Nuclear Research 2018-04-01 16:40:34 1 WARNING: 8.5628 :: Reactor A Control Room 2018-04-01 16:40:38 moving average 5.0653 : Centre for Nuclear Research 2018-04-01 16:40:42 moving average 4.8217 Centre for Nuclear Research Note that observations need to be logged upon update, not upon report generation. And when reported, the radiation levels must be rounded to four decimal places. Use String.format(O to achieve this. Finally, upload and submit your 4 classes: . RadiationSensor ControlRoom . ResearchCentre Along with: . Subject .Observer

    Expert Answer


    . . .


    view full answer
  • 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.

    Expert Answer


    . . .


    view full answer