In-Class coding exercise: (try - catch) (pass / fail)
The purpose of this in-class coding exercise is to simulate various exception conditions using the program provided.
package com.InClass;
/*
* This program demonstrates the ability of catching different types
of exceptions"
* You will have to modify the method() codes to trigger
various/different exceptions.
* inClass Coding ( you will have to remove (comment out) the
previous error condition before moving to trigger the next)
* 1) throw a myExcept exception (this is defined with an extends to
Exception (see code)
* 2) use method () to trip a Arithmetic exception
* 3) use method () to trip a nullPointException
* 4) use method () call to trip a runtime exception
* 5) inside the myExcept error to inject an arithmetic error and
watch it behave differently from step1 22
*
*/
public class TestExceptions {
public static void main(String[] args) {
try {
// throw
myException() first.
method();
System.out.println(" after the method call");
}
catch (MyExcept ex){
System.out.println(" MyExcept error");
}
catch (ArithmeticException
ex){
System.out.println(" ArithmeticEx error");
}
catch (NullPointerException ex)
{
System.out.println(" nullPointException !!! ");
}
catch (IndexOutOfBoundsException e)
{
System.out.println(" index out of bounds...");
}
catch (RuntimeException ex )
{
System.out.println(" Runtime exception");
System.out.println(ex.getMessage());
}
catch (Exception e ) {
System.out.println(" Exception");
}
finally {
System.out.println(" finally After
the catch");
}
}
static void method() throws Exception {
// create ArithmeticException
// create RuntimeExceptiom
// create a null point exception here -- fix the exception above
first
// create a ClassCastException here which is NOT on catch "watch"
listed above
// throw new Exception(); // trigger an Exceptiom
}
}
class MyExcept extends Exception { // creating your custome
error
MyExcept(){
// int y = 1/0; // uncomment this
line to introduce an aritmetic exception inside your MyExcept
System.out.println(" inside my custome
MyExcept");
}
}
Please complete the missing exceptions. Ignore the spellings mistakes/grammer, it's how the professor writes.
Instructions might be a bit hard to follow so please bear that in mind. Complete as much as possible.
Thank you.
In: Computer Science
Please write a conclusion about data structure and algorithm
i need an conclusion for my Data Structure and algorithm thesis
i am writing a thesis i need conclusion topic is Data Structure and algorithm
In: Computer Science
Water, sodium hydroxide, and 1,6-hexanediamine are all potential nucleophiles. Yet only 1,6-hexanediamine reacts with the adipoyl chloride. Offer an explanation as to why.
In: Chemistry
he best test of any question posed to a job applicant is whether the employer can demonstrate a job-related necessity for asking the question. Because both the intent behind the question and how the information is to be used by the employer are important, an employer should consider whether the answers to the question, if used in making the selection, will adversely affect and screen out minorities or members of one gender. This chapter’s Develop Your Skills feature presented five improper interview questions below and should be avoided. Identify what the employer really wants to know by asking each question and come up with an alternative way to find out the same information.[i]
1. How many children do you have?
2. What is your native language?
3.To what clubs or organizations do you belong?
4. What is your height? What is your weight?
5. Are you able to work on Christmas Day?
In: Operations Management
The answers were given for this problem, but I am not sure how to derive them. Would need any kind of help
Suppose that you sell Christmas trees each holiday season for $30 a tree. Peak selling time is the 2 weeks leading up to Christmas, but since harvesting real pine trees takes time, your supplier requires a 1 month lead time.
Your purchase cost per tree is $20. Anytime a customer comes to your store requesting a tree and it is unavailable, you give them a $5 credit (per tree) to spend on other products. (You should assume they always use this credit.) Any trees not sold before Christmas are sold to a local lumber yard at $10/tree.
Demand for this Christmas is forecasted in the following table.
| Demand | Probability |
| 600 | 0.2 |
| 700 | 0.3 |
| 800 | 0.3 |
| 900 | 0.2 |
a) (3 points) To the nearest tree, what is the expected demand for this Christmas? (Remember, as with all questions, you should show work for full credit.) 750 trees
b) (3 points) Suppose you order exactly 800 trees, how many trees would you expect to sell? (Remember, as with all questions, you should show work for full credit.) 730 trees
c) (3 points) Suppose you order exactly 800 trees while the actual demand turns out to be 700 trees, what is your expected profit (including goodwill costs if there are any)? $6000
d) (3 points) What is the underage cost? What is the overage cost? Just by comparing the two costs, should we order more or less than the average demand? Briefly explain.
Underage: $15
Overage: $10
We should order more than average, but why? I don't understand the explanation
e) (3 points) What is the optimal order quantity given the demand in part a)? As with all questions, please show work for full credit. 800 trees
f) (1 point) What is the effective service level for the quantity you suggested in part e)? 80%
In: Operations Management
Max Z = 2x1 + 8x2 + 4x3
subject to
2x1 + 3x2 ≤ 8
2x2 + 5x3 ≤ 12
3x1 + x2 + 4x3 ≤15
and x1,x2,x3≥0;
Solve the LP you create by using the Simplex Method. You can use Big-M or Two-Phase Method if needed
In: Operations Management
Could you include little explanation.
What is a system call to replace the process image? If successful, what is its effect on the process that calls it?
When scheduling processes, provide an example of how round-robin which is known as one of the fairer systems, can be unfair on a multi-user system.
What is the difference between a semaphore and mutex? When would you use one over the other?
In: Computer Science
To treat a burn on your hand, you decide to place an ice cube on the burned skin. The mass of the ice cube is 11.3 g, and its initial temperature is -14.4 °C. The water resulting from the melted ice reaches the temperature of your skin, 32.0 °C. How much heat is absorbed by the ice cube and resulting water? Assume that all the water remains in your hand. Answer ______J
Constants may be found here:
| Quantity | per gram | per mole |
| Enthalpy of fusion | 333.6 J/g | 6010. J/mol |
| Enthalpy of vaporization | 2257 J/g | 40660 J/mol |
| Specific heat of solid H2O (ice) | 2.087 J/(g·°C) * | 37.60 J/(mol·°C) * |
| Specific heat of liquid H2O (water) | 4.184 J/(g·°C) * | 75.37 J/(mol·°C) * |
| Specific heat of gaseous H2O (steam) | 2.000 J/(g·°C) * | 36.03 J/(mol·°C) * |
In: Physics
•What are the primary types of evidence? Explain
In: Psychology
1. Hickory Furniture Company paid for the following costs during
the month of May:
| Inventory purchases | $ | 40,000 | |
| Advertising costs | 8,000 | ||
| Delivery costs | 2,000 | ||
Hickory sold $32,000 of the inventory and has agreed to pay
warranty expenses for its customers. These are expected to be
$1,600 and occur evenly over the next four months (i.e., starting
in June).
What is the amount of Hickory’s cash-basis expenses for the month of May?
Multiple Choice
$33,600
$50,000
$42,400
$51,600
2. The residual approach to allocate transaction prices to multiple performance obligations in a contract is appropriate when:
Multiple Choice
None of the goods and services included in the contract are not sold on a stand-alone basis.
None of the answer choices are correct.
The stand-alone price of all of the goods or services is known.
The stand-along price of one or more of the goods or services is highly variable or uncertain.
3. A patient of Dr. Jones presents his Medicare card after his appointment. The total charge for the services was $100; however, Medicare will pay only $60 for this service and the patient is to pay $20. Acceptance of the patient’s Medicare insurance creates a contract:
Multiple Choice
for payment of $60 and a price concession of $40.
for $20 and an $80 discount or price concession.
for payment of $100, regardless of what Medicare will pay.
for payment of $80 and a $20 discount or price concession.
In: Accounting
ERIKSON INDUSTRY VS. INFERIORITY
Part 1: Tell a story of a child that demonstrates industry and/or inferiority in middle childhood. (Include a name and age (i.e. 10-year-old Mary) for each case study child/teen.)
Part 2: Give advice to a group of parents with strategies to promote industry. ( Use 2nd person "YOU" format AS IF SPEAKING DIRECTLY TO the parent - i.e. "Parents, be an advocate for your children...").
PEER RELATIONSHIPS
Part 1: Tell a story of a school-aged child's friendships, peer group &/or peer acceptance in middle childhood. Contrast this with a story of a child having difficulty with peers and/or being bullied. (Include a name and age (i.e. 10-year-old Mary) for each case study child/teen.)
Part 2: Give advice to the child having difficulty with strategies for dealing with bullies and/or social success. (Use 2nd person "YOU" format AS IF SPEAKING DIRECTLY TO the child or teen (i.e. Mary, I encourage you to think about....").
FAMILY INFLUENCES
Part 1: Tell a story of a family with a child aged 6-12. Describe the family situation/family dynamics (parent-child relationships, siblings, only child families, divorce, blended family, single parents, and/or working parents). Include a name and age (between 6-12 years of age) on this case study.
Part 2: Give advice to the parent or child with strategies for coping with one of the family situations above. (Use the 2nd person "YOU" format AS IF YOU ARE SPEAKING DIRECTLY TO the parent, child or teen).
ADOLESCENT FRIENDSHIPS/DATING
Part 1: Give examples of adolescent friendships and dating relationships. Compare successful and struggling relationships in your story. (Include the name and age)
Part 2: Give advice with strategies for successful friendships and dealing with cliques &/or crowds. Give advice for positive dating experiences during adolescence. (Use 2nd person "YOU format AS IF SPEAKING DIRECTLY TO the teen)
In: Nursing
Please give a brief account of Gender socialization and Nancy Chodorow’s views on it.
In: Psychology
According to research, employers want managers to
possess three skills through education and experience. They are the
following:
Technical skill-The ability to perform a specific job
in the field they work.
Conceptional skill-The ability to think beyond the
department in which you work to understand how the entire
organization function as a whole.
Human Skill-The soft skills of connecting and
interacting with people.
Tell me about a time you encounter a manager who
possess one of these skills. How did they effectively manage their
team using the skill identified?
If a manager doesn’t possess these skills do you think
they can be an effective manager. Why or Why not.
In: Operations Management
Mercury Bag Company produces cases of grocery bags. The managers at Mercury are trying to develop budgets for the upcoming quarter. The following data have been gathered. Projected sales in units 1,960 cases Selling price per case $ 240 Inventory at the beginning of the quarter 150 cases Target inventory at the end of the quarter 100 cases Direct labor hours needed to produce one case 2 hours Direct labor wages $ 10 per hour Direct materials cost per case $ 8 Variable manufacturing overhead cost per case $ 6 Fixed overhead costs for the upcoming quarter $ 220,000
a. Using the above information, develop Mercury's sales forecast in dollars and production schedule in units.
b. What is Mercury's budgeted variable manufacturing cost per case?
c. Prepare Mercury's manufacturing cost budget.
d. What is the projected ending value of the Inventory account?
Mercury Bag Company produces cases of grocery bags. The managers at Mercury are trying to develop budgets for the upcoming quarter. The following data have been gathered.
| Projected sales in units | 1,960 | cases | |
| Selling price per case | $ | 240 | |
| Inventory at the beginning of the quarter | 150 | cases | |
| Target inventory at the end of the quarter | 100 | cases | |
| Direct labor hours needed to produce one case | 2 | hours | |
| Direct labor wages | $ | 10 | per hour |
| Direct materials cost per case | $ | 8 | |
| Variable manufacturing overhead cost per case | $ | 6 | |
| Fixed overhead costs for the upcoming quarter | $ | 220,000 | |
In: Accounting
Dmitri Ivanov is retiring soon, so he is concerned about his investments providing him steady income every year. He is aware that if interest rates , the potential earnings power of the cash flow from his investments will increase. In particular, he is concerned that a decline in interest rates might lead to annual income from his investments.
Dmitri Ivanov is retiring soon, so he is concerned about his investments providing him steady income every year. He is aware that if interest rates , the potential earnings power of the cash flow from his investments will increase. In particular, he is concerned that a decline in interest rates might lead to annual income from his investments. a) decrease, increase b) less, more
2. What kind of risk is Dmitri most concerned about protecting against?
Interest rate risk
Reinvestment rate risk
In: Finance