David E. Brown is an expert in wildlife conservation. In his book The Wolf in the Southwest: The Making of an Endangered Species (University of Arizona Press), he records the following weights of adult grey wolves from two regions in Old Mexico.
Chihuahua region: x1 variable in pounds
| 86 | 75 | 91 | 70 | 79 |
| 80 | 68 | 71 | 74 | 64 |
Durango region: x2 variable in pounds
| 68 | 72 | 79 | 68 | 77 | 89 | 62 | 55 | 68 |
| 68 | 59 | 63 | 66 | 58 | 54 | 71 | 59 | 67 |
(a) Use a calculator with mean and standard deviation keys to calculate x1, s1, x2, and s2. (Use 2 decimal places.)
| x1 | |
| s1 | |
| x2 | |
| s2 |
(b) Let μ1 be the mean weight of the population
of all grey wolves in the Chihuahua region. Let
μ2 be the mean weight of the population of all
grey wolves in the Durango region. Find a 99% confidence interval
for μ1 – μ2. (Use 2 decimal
places.)
| lower limit | |
| upper limit |
(c) Examine the confidence interval and explain what it means in the context of this problem. Does the interval consist of numbers that are all positive? all negative? of different signs? At the 99% level of confidence, what can you say about the comparison of the average weight of grey wolves in the Chihuahua region with the average weight of grey wolves in the Durango region?
Because the interval contains only positive numbers, we can say that the mean weight of grey wolves is greater in the Chihuahua region.Because the interval contains only negative numbers, we can say that the mean weight of grey wolves is greater in the Durango region. Because the interval contains both positive and negative numbers, we can not say that the mean weight of grey wolves is greater in the Chihuahua region.We can not make any conclusions using this confidence interval.
In: Math
Locate the star Betelgeuse and click on it. Information on Betelgeuse should appear in the top left of your screen. What is its azimuth and altitude?
Az (1 pt) = ________________
Alt (1 pt) = ________________
Now let’s switch to a different coordinate system. Press “E” or
click on the globe in your bottom menu bar to turn on some new
coordinates, and press “Z” or click on the radar icon (to the right
of the globe) in the menu bar to turn off the altitude and azimuth
grid.
This new grid should be tilted relative to the horizon. You are now looking at the Right Ascension (RA) / Declination (DE) coordinate system. This system is very similar to longitude and latitude on the Earth. If you look to the north, you will see that the lines converge near a moderately bright star. This is Polaris, the North Star. Its declination is +90 degrees, just like Earth’s north pole has a latitude of +90 degrees. If we could see through the ground, the grid would converge again in the south at declination –90 degrees; this spot would be directly over the Earth’s south pole.
If you look at the RA/DE coordinates of Betelgeuse, you will notice that RA is given in units of “h m s”. These stand for “hours”, “minutes” and “seconds”. There are 24 hours in one full circle (so each hour of RA is 15 degrees of angle), 60 minutes in one hour, and 60 seconds in one minute. (We astronomers have our nefarious reasons for using this arcane system, but it isn’t important for now.)
What is the RA and DE of Betelgeuse (to the nearest degree ignoring arc mins and arc secs)?
RA (1 pt) = ________________
DE (1 pt) = ________________
For Betelgeuse, record both its Az/Alt coordinates and RA/DE in the
table below (record all values should be to the nearest degree,
i.e., don’t include the arc mins and arc secs). Keeping the time at
22:00, record the new positions for the dates specified. Note that
even when the star dips below your viewing horizon (alt < 0°),
its position is still displayed. Continue to advance in four-month
increments for an entire year (for time 22:00 at each date). (1
point each totaling 16 pts)
Date Az Alt RA
DE
2019-01-28
2019-05-28
2019-09-28
2020-01-28
Using the answers above answer the following:
Which coordinates change (1 pt)?
Which remain the same (1 pt)?
Do the changing coordinates ever come close to repeating (1
pt)?
If so, after roughly how long (1pt)?
Next, keeping the time, date, and location the same, find Polaris.
What is the altitude of Polaris to the nearest degree?
Let’s go somewhere else on the Earth. Open the Location Window (see
point 1 at the start of the lab) and type “Greenwich” into the
search box. Select the “Royal Observatory (Greenwich), United
Kingdom” from the list. Change the date and time to 2019-01-27 at
03:00PM (15:00) – this accounts for the 6-hour difference in time
between Texas and England (your clock is showing Dallas time even
though you changed positions).
Answer the following for Betelgeuse:
What are the Az/Alt (1pt)
What are the RA/DE? (1 pt)
Compare answers for a and b to the first row in your table for 3.
Which numbers are different? (1 pt)
Which are the same? (1 pt)
Let’s say you are studying a new star and you need to get some
pictures soon. You email all your friends who are at big
telescopes, since it doesn’t matter from which telescope, nor what
time of night you get the pictures.
Should you send your friends the star’s current Az/Alt or its
current RA/DE? (1 pt)
Why? (1 pt)
What is the altitude of Polaris as seen from Greenwich (to the
nearest degree)?
Polaris is used in navigation because of the fact that its altitude
is always the same as the latitude of the observer. Using your
answers for the altitude of Polaris from Dallas and Greenwich, how
do these values compare with the latitude of those locations?
Part III: Sunrise and Sunset
We all know that the sun rises in the east and sets in the west, right? Let’s examine the position and time of the rising and setting sun over the course of the year, and see how true that is.
Toggle back to Az/Alt coordinates (press Z) for this exercise, and return your location to Dallas, United States. (and make sure to check the enable daylight savings time in the location screen) Use the arrow keys to look toward the eastern horizon.
Set your date for 2019-01-21 and change the time until you see the sun. Click on the sun to get its coordinates. Then change the time of day until the sun has an altitude as close as you can to 0 degrees, 0 arcminutes, and 0 arcseconds. Since its altitude is zero, this means that the sun is just starting to rise in the east. Get the altitude as close as you can, but because you cannot adjust time in smaller than 1 second increments, understand that you will probably not be able to get an altitude of precisely 0°0’0”. (Note that with the online version of Stellarium, the coordinates do not update with each time change unless you re-select the Sun with each time change).
Find the sunrise and sunset times, and the positions to the nearest
degree, i.e., don’t include the arc mins and arc secs) on the dates
specified and fill in the table. Note to be sure to turn on the
setting to account for daylight savings time. (1 pt each, or 16
total pts)
Date Sunrise Sunset
Time Az Time
Az
2019-09-21
2019-12-21
2019-03-21
2019-06-21
What azimuth values correspond to precisely East and West?
East azimuth: _____________________ (1 pt)
West azimuth: _____________________ (1 pt)
Which dates does the sun rise/set on these azimuths?
On which day does the sun rise farthest to the north (smallest azimuth)? (1 pt)
Calculate the length of the day for each of the dates. Which date has the longest daytime?
In: Civil Engineering
You are given the main class RecursiveMethods.java which invokes methods that can be selected from a menu. Your task is to implement two of these methods. -The first method isPal(s) determines whether a given string s is a palindrome. For example "12321" is a palindrome but "1231" is not. Currently the method isPal is a stub and you are expected to implement the method. -The second method isSAE(s) determines whether the given string s is a strict arithmetic expression (see below). This method is fully implemented for you. -The third method valueStrict(s) computes the value of the strict arithmetic expression s. Currently the method valueStrict is a stub and you are expected to implement the method using as a guide the implementation of isSAE(s). The methods should be implemented using recursive methods, no points will be given for iterative solutions. You should only need to work with the file RecursiveMethods.java but you will include your util1228 package for obvious reasons. Sample execution is shown below. SUBMISSION NOTES You will submit a single .jar file named A04.jar. Make sure that: 1) The jar file runs. In project properties under Run make sure the main class is set to a04.RecursiveMethods 2) The jar file includes all your source code. In project properties under packaging make sure .java files are not excluded. (see our Brightspace site for details about making JAR files) IMPORTANT NOTES A strict arithmetic expression (SAE) is one of the following: 1. Any nonnegative integer is a SAE (that is a nonempty string made of digits) 2. (x+y), (x*y), (-x), (+x), if x,y are SAEs Strict arithmetic expressions do not allow spaces and do not allow omitting parentheses. The following are valid SAEs: 12, (-12), (3*5), ((3*5)+10), ((-3)*((-5)+10)) The following are NOT valid SAEs: -12, 3*5, (-3)*5, (3), (5+4, (3 + 5) SAMPLE EXECUTION Menu 1. Test whether a given string is a palindrome 2. Test whether a given string is a strict arithmetic expression 3. Evaluate a strict arithmetic expression 4. Quit Enter your choice here: 1 Enter a string: 1234321 "1234321" is a palindrome Press enter to continue... Menu 1. Test whether a given string is a palindrome 2. Test whether a given string is a strict arithmetic expression 3. Evaluate a strict arithmetic expression 4. Quit Enter your choice here: 3 Enter a strict arithmetic expression: ((3*5)+10) The value is 25 Press enter to continue... Menu 1. Test whether a given string is a palindrome 2. Test whether a given string is a strict arithmetic expression 3. Evaluate a strict arithmetic expression 4. Quit Enter your choice here: 3 Enter a strict arithmetic expression: (-3)*5 ERROR: invalid arithmetic expression Press enter to continue... Menu 1. Test whether a given string is a palindrome 2. Test whether a given string is a strict arithmetic expression 3. Evaluate a strict arithmetic expression 4. Quit Enter your choice here: 4 Buy
ackage a04;
import java.util.Scanner;
import util1228.Menu;
import static util1228.Utilities.pause;
import static util1228.Utilities.isNumeric;
/**
*
* @author Joshua, Stavros
*/
public class RecursiveMethods {
public static void main(String[] args) {
Scanner kbd=new Scanner(System.in);
Menu m=createMenu();
int choice,n;
String s;
do{
m.display();
choice=m.getChoice();
switch(choice){
case 1:
System.out.print("Enter a string: ");
s=kbd.nextLine().trim();
System.out.println("\""+s+"\" is "
+((isPal(s.replace(" ", "").toLowerCase()))?"":"not ")
+"a palindrome");
pause();
break;
case 2:
System.out.print("Enter a string: ");
s = kbd.nextLine().trim();
System.out.printf("The string is %sa valid strict arithmetic"
+ " expression\n",
(isSAE(s))?"":"*not* ");
pause();
break;
case 3:
System.out.print("Enter a strict arithmetic expression: ");
s = kbd.nextLine().trim();
if (!isSAE(s)) {
System.out.println("ERROR: invalid arithmetic expression");
pause();
break;
}
System.out.printf("The value is %d\n",
valueStrict(s));
pause();
break;
case 4:
System.out.println("\nBuy!\n");
break;
case -1:
System.out.println("*** Invalid Choice");
pause();
break;
}
} while(choice!=4);
}
/**
* This method creates the Menu for the program and adds each of the options
*
* @return the created Menu
*/
private static Menu createMenu() {
Menu m = new Menu("Menu", 8, 50);
m.addOption("Test whether a given string is a palindrome");
m.addOption("Test whether a given string is a strict arithmetic "
+ "expression");
m.addOption("Evaluate a strict arithmetic expression");
m.addOption("Quit");
return m;
}
private static boolean isPal(String input) {
System.out.println("***Method isPal is a stub. It always returns false."
+ "\n***You are expected to implement this method.");
return false;
}
public static boolean isSAE(String s) {
int l = s.length();
if (l==0) return false;
if (isNumeric(s)) return true;
if (l<3) return false;
if (s.charAt(0)!='(' || s.charAt(l-1)!=')')
return false;
//Here we know that s is of the form (...)
String s1, s2;
//Next test whether s is of the form (+...) or (-...)
if (s.charAt(1)=='+' || s.charAt(1)=='-') {
s1 = s.substring(2,l-1);
return isSAE(s1);
}
//Here we know that s is not of the form (+...) or (-...)
//Next test whether s is of the form (x+y) or (x*y); that is,
//there is a position in s that contains '+' or '*' and the
//parts of s to the left and right of '+' or '*' are SAEs
for (int i=2; i<l-1; i++) {
if (s.charAt(i)=='+' || s.charAt(i)=='*') {
s1 = s.substring(1, i);
s2 = s.substring(i+1,l-1);
if (isSAE(s1) && isSAE(s2))
return true;
}
}
return false;
}
public static int valueStrict(String s) {
System.out.println("***Method valueStrict is a stub. It always returns "
+ "0.\n***You are expected to implement this method.");
return 0;
}
}In: Computer Science
Write code in SAS to do each of the following I have posted the data below from a pace delimited data set consisting of 66 randomly selected cars
"Brand" "Condition" "Fuel" "KMs" "Model" "Price" "City" "Transaction" "Year" "Daihatsu" "New" "Petrol" 19000 "Move" 1125000 "Karachi" "Cash" 2014 "Mazda" "Used" "Petrol" 89999 "Azwagon" 799999 "Karachi" "Cash" 2007 "Toyota" "Used" "Petrol" 140000 "Prius" 1225000 "Karachi" "Cash" 2007 "Toyota" "Used" "Petrol" 95000 "Corrolla Altis" 995000 "Karachi" "Cash" 1995 "Toyota" "Used" "Petrol" 61000 "Passo" 1150000 "Karachi" "Cash" 2012 "Suzuki" "Used" "Petrol" 100000 "Alto" 380000 "Karachi" "Cash" 2001 "Toyota" "Used" "Petrol" 86000 "Passo" 1650000 "Karachi" "Cash" 2015 "Suzuki" "New" "Petrol" 130000 "Alto" 525000 "Karachi" "Cash" 2001 "Nissan" "Used" "Petrol" 100000 "Tiida" 875000 "Karachi" "Cash" 2007 "Honda" "Used" "Petrol" 182000 "Civic EXi" 720000 "Karachi" "Cash" 2004 "Daihatsu" "Used" "Petrol" 85000 "Other" 625000 "Karachi" "Cash" 2011 "Suzuki" "Used" "Hybrid" 78523 "Alto" 545000 "Karachi" "Cash" 2010 "Suzuki" "Used" "CNG" 105000 "Mehran VX" 255000 "Karachi" "Cash" 2000 "Suzuki" "Used" "CNG" 100000 "Khyber" 135000 "Karachi" "Cash" 1989 "Other Brands" "New" "CNG" 660 "Other" 250000 "Karachi" "Cash" 1993 "Nissan" "New" "Petrol" 97000 "Dayz" 985000 "Karachi" "Cash" 2015 "Suzuki" "Used" "Petrol" 35000 "Cultus VXR" 580000 "Karachi" "Cash" 2008 "Toyota" "Used" "CNG" 127000 "Corolla GLI" 1390000 "Karachi" "Cash" 2012 "Suzuki" "Used" "CNG" 20880 "Mehran VXR" 430000 "Karachi" "Cash" 2011 "Suzuki" "Used" "Petrol" 88000 "Every" 885000 "Karachi" "Cash" 2012 "Suzuki" "Used" "CNG" 60000 "Mehran VXR" 150000 "Karachi" "Cash" 1998 "Toyota" "Used" "Petrol" 118000 "Corolla XLI" 975000 "Karachi" "Cash" 2008 "Honda" "New" "Petrol" 80999 "Civic VTi" 350000 "Karachi" "Cash" 1995 "Daihatsu" "Used" "Petrol" 10000 "Mira" 1500000 "Karachi" "Cash" 2017 "Toyota" "New" "CNG" 80000 "Corolla XLI" 1250000 "Islamabad" "Cash" 2005 "Toyota" "Used" "Petrol" 120000 "Prado" 5500000 "Karachi" "Cash" 2007 "Daihatsu" "New" "Petrol" 68000 "Mira" 1100000 "Karachi" "Cash" 2014 "Suzuki" "Used" "CNG" 123456 "Cultus VXR" 470000 "Karachi" "Cash" 2003 "Suzuki" "Used" "Petrol" 95000 "Mehran VX" 325000 "Gujranwala" "Cash" 2003 "Toyota" "Used" "Petrol" 127000 "Corolla GLI" 1150000 "Karachi" "Cash" 2009 "Suzuki" "Used" "CNG" 50000 "Cultus VXR" 430000 "Karachi" "Cash" 2003 "Mitsubishi" "New" "Petrol" 100000 "Pajero Mini" 500000 "Karachi" "Cash" 1998 "Suzuki" "Used" "Petrol" 8884 "Swift" 795000 "Karachi" "Cash" 2011 "Daihatsu" "Used" "Petrol" 22500 "Mira" 1250000 "Karachi" "Cash" 2016 "Honda" "Used" "Petrol" 560800 "Civic EXi" 240000 "Karachi" "Cash" 1990 "Suzuki" "Used" "CNG" 114000 "Alto" 595000 "Karachi" "Cash" 2011 "Suzuki" "Used" "Petrol" 35000 "Wagon R" 1200000 "Karachi" "Cash" 2014 "Suzuki" "Used" "CNG" 111111 "Mehran VX" 200000 "Karachi" "Cash" 1996 "Toyota" "Used" "CNG" 123 "Estima" 650000 "Karachi" "Cash" 1993 "Suzuki" "Used" "CNG" 14500 "Alto" 420000 "Karachi" "Cash" 2008 "Suzuki" "Used" "CNG" 10000 "Alto" 435000 "Karachi" "Cash" 2004 "Suzuki" "New" "CNG" 5 "Mehran VX" 250000 "Karachi" "Cash" 2003 "Toyota" "New" "Petrol" 59000 "Prado" 6000000 "Karachi" "Cash" 2009 "Suzuki" "Used" "Petrol" 28000 "Swift" 1400000 "Karachi" "Cash" 2015 "Hyundai" "Used" "Petrol" 70000 "Santro" 515000 "Karachi" "Cash" 2007 "Suzuki" "New" "Petrol" 45000 "Mehran VXR" 480000 "Karachi" "Cash" 2012 "Suzuki" "Used" "CNG" 2500 "Margalla" 335000 "Karachi" "Cash" 1996 "Daihatsu" "Used" "Petrol" 113000 "Cuore" 555000 "Karachi" "Cash" 2005 "Toyota" "Used" "Petrol" 84000 "Other" 1300000 "Karachi" "Cash" 2005
In: Statistics and Probability
Hiring Discrimination Based on Social Media Posts
Human resource officers in most companies routinely check job candidates’ social media posts when deciding whom to hire. Certainly, young people are warned not to post photos that they might later regret having made available to potential employers. But a more serious issue involves standard reviewing of job candidates’ social media information. Specifically, do employers discriminate based on such information?
An Experiment in Hiring Discrimination via Online Social Networks
Two researchers at Carnegie-Mellon University conducted an experiment to determine whether social media information posted by prospective employees influences employers’ hiring decisions. The researchers created false resumes and social media profiles. They submitted job applications on behalf of the fictional “candidates” to about four thousand U.S. employers. They then compared employers’ responses to different groups—for instance, to Muslim candidates versus Christian candidates.
The researchers found that candidates whose public profiles indicated that they were Muslim were less likely to be called for interviews than Christian applicants. The difference was particularly pronounced in parts of the country with more conservative residents. In those locations, Muslims received callbacks only two percent of the time, compared with seventeen percent for Christian applicants. According to the authors of the study, “Hiring discrimination via online searches of candidates may not be widespread, but online disclosures of personal traits can significantly influence the hiring decisions of a self-selected set of employers.”
Job Candidates’ Perception of the Hiring Process
Job candidates frequently view the hiring process as unfair when they know that their social media profiles have been used in the selection process. This perception may make litigation more likely. Nevertheless, eighty-four percent of employers report using social media to recruit job applicants. One-third of those who recruit in this manner admit that they have disqualified applicants based on content found in their social media accounts.
The EEOC Speaks Up
The Equal Employment Opportunity Commission (EEOC) has investigated how prospective employers can use social media to engage in discrimination in the hiring process. Given that the Society for Human Resource Management estimates that more than three-fourths of its members use social media in their employment screening process, the EEOC is interested in regulating this procedure.
Social media sites, examined closely, can provide information to a prospective employer on the applicant’s race, color, national origin, disability, religion, and other protected characteristics. The EEOC has reminded employers that such information—whether it comes from social media postings or other sources—may not legally be used to make employment decisions on prohibited bases, such as race, gender, and religion.
Question Presented
Can you think of a way a company could use information from an applicant’s social media posts without running the risk of being accused of hiring discrimination?
In: Economics
QUESTION 1
Bill informs the security guard in London Shop that he saw
another shopper stealing something. The security guard corners the
shopper and accuses them of shoplifting. The security guard uses
his arms to block the shopper from leaving the store until the
police arrive.
The accused shopper may be able to bring tort action against the
store on the grounds of _____________________.
|
assault. |
||
|
battery. |
||
|
false imprisonment. |
||
|
vicarious liability. |
1 points
QUESTION 2
The Queen's Wardrobe, a dressmaking boutique, agrees to make Rhonda's wedding dress for $2 000. The dress is to be ready for her wedding on June 1st. On May 14th, Jane, the owner called Rhonda to tell her that the dress would not be ready on time unless Rhonda agreed to pay an extra $500 so that Jane could hire someone to help her finish the lace embroidery. Rhonda is very upset, and feeling that she has no other choice, agrees. When she picks up the dress, she tells Jane that she does not think that it is fair that she should have to pay more than they had agreed upon and refuses to do so.
|
Since Rhonda has received the benefit of Jane having paid the extra money to get the dress completed on time, she must pay the extra money. |
||
|
By agreeing to pay and then refusing to do so, Rhonda has committed tort of deceit and a court would award Jane the $500. |
||
|
Since Jane was obligated under the contract to make the dress for $2 000, there is no consideration for Rhonda's promise to pay more and it is therefore unenforceable. |
||
|
Since Rhonda agreed to pay more, she has altered the terms of the contract and must therefore pay the extra $500. |
1 points
QUESTION 3
Mary invites some friends to dinner and they accept. They purchase a much more expensive bottle of wine than they would normally drink and a beautiful bouquet of flowers. Mary calls them two hours before the dinner to tell them she has been invited out by the man of her dreams and is postponing the dinner.
|
The friends can claim the cost of the flowers and the wine since Mary has breached the contract. |
||
|
Since Mary is merely postponing the dinner, she has not breached their dinner contract. |
||
|
Even though they accepted her dinner offer, this is not a situation in which one party can sue another, since no reasonable person would think that there was any intention on Mary's part to create a legally enforceable contract. |
||
|
Mary may not have intended to be bound to her promise, but her friends have suffered a loss and she cannot now claim she did not mean to enter a contract to provide dinner since she did not say that when she made her offer. |
In: Accounting
in this assignment you will create and use a database to find meanings and synonyms for given phrases. To do so you will use tables of synsets -- sets of one or more synonyms (specific phrases) that share the same meaning.
Your program should:
For example, for the phrase "jail"
there are 2 meanings and 11 unique synonyms
Meaning 1:
lock up or confine, in or as in a jail
Synset ID:
2494356
Synonyms:
gaol
Meaning 2:
A correctional institution used to detain persons who are in the lawful custody of the government (either accused persons awaiting trial or convicted persons serving a sentence)
Synset ID:
3592245
Synonyms:
clink
Only use the material covered in this module -- do not use more advanced functions not covered yet in the course
Submit a .py file!
In: Computer Science
Create individual python code cells for each of the three problems below. In each code cell, use any additional variables and comments as needed to program a solution to the corresponding problem. When done, download the ipynb file and submit it to the appropriate dropbox in the course's canvas page
. 1.
a. Cell Number 1 * Recreate the same list of dictionaries you used during assignment 2.09. (Scroll down to see assignment 2.09 instructions) * Create another variable and define it as an empty list. It will store middle names, so name the variable appropriately. * Loop through the list of dictionaries using a `for` loop, and add each middle name to the list created to hold middle names in the previous bullet point.
b. Cell Number 2 * Create a variable and assign it the length of the middle names list created in the previous cell. Use the appropriate instruction to calculate the length instead of just typing the correct number, which is known as hard-coding. (Hint: You don't have to redefine the list in the new cell as long as you ran the previous cell recently) * Use a `while` loop to count up to the length of the middle names list, and print out the index and value of each item in the list using a format string. (Hint: start your counter at `0` and stop iterating before you reach the length by using a `<` operator)
c. Cell Number 3 * Loop through the list of dictionaries defined in the first cell using another `for` loop. (Hint: Again, you do not need to redefine the list of dictionaries from the previous cell as long as you executed it recently) * Nested inside of that loop, loop through the keys in the current dictionary using another `for` loop and the `enumerate()` instruction. * Nested inside of the nested loop, print out the key and value using a format string. (Hint: You'll need to use the key to get the value out of the dictionary) * Also inside of the nested loop, once the index is greater than or equal to 2, break out of the loop.
2.09 assingment instructions for question 1
**Requirements:** * Create a list containing separate dictionaries for at least 3 people (family members, actors, invisible friends, etc.) and assign the list to a variable. Instead of using your actual family members' names, I want you think of different names starting with the same letter as your family member so that I can't be accused of identity theft. * Each person dictionary should have at least 4 key/value pairs: * first name * middle name. * age (rounded to the nearest decade) * your favorite thing about them * Be sure to use the same keys for each person (eg. "first_name" for everyone's first names). * Print out the entire list.
In: Computer Science
Create individual python code cells for each of the three problems below. In each code cell, use any additional variables and comments as needed to program a solution to the corresponding problem. When done, download the ipynb file and submit it to the appropriate dropbox in the course's canvas page
. 1.
a. Cell Number 1 * Recreate the same list of dictionaries you used during assignment 2.09. (Scroll down to see assignment 2.09 instructions) * Create another variable and define it as an empty list. It will store middle names, so name the variable appropriately. * Loop through the list of dictionaries using a `for` loop, and add each middle name to the list created to hold middle names in the previous bullet point.
b. Cell Number 2 * Create a variable and assign it the length of the middle names list created in the previous cell. Use the appropriate instruction to calculate the length instead of just typing the correct number, which is known as hard-coding. (Hint: You don't have to redefine the list in the new cell as long as you ran the previous cell recently) * Use a `while` loop to count up to the length of the middle names list, and print out the index and value of each item in the list using a format string. (Hint: start your counter at `0` and stop iterating before you reach the length by using a `<` operator)
c. Cell Number 3 * Loop through the list of dictionaries defined in the first cell using another `for` loop. (Hint: Again, you do not need to redefine the list of dictionaries from the previous cell as long as you executed it recently) * Nested inside of that loop, loop through the keys in the current dictionary using another `for` loop and the `enumerate()` instruction. * Nested inside of the nested loop, print out the key and value using a format string. (Hint: You'll need to use the key to get the value out of the dictionary) * Also inside of the nested loop, once the index is greater than or equal to 2, break out of the loop.
2.09 assingment instructions for question 1
**Requirements:** * Create a list containing separate dictionaries for at least 3 people (family members, actors, invisible friends, etc.) and assign the list to a variable. Instead of using your actual family members' names, I want you think of different names starting with the same letter as your family member so that I can't be accused of identity theft. * Each person dictionary should have at least 4 key/value pairs: * first name * middle name. * age (rounded to the nearest decade) * your favorite thing about them * Be sure to use the same keys for each person (eg. "first_name" for everyone's first names). * Print out the entire list.
In: Computer Science
Bell Products Corporation manufactures after-market clutch plates for motorcycles, automobiles, racing applications, and heavy industry vehicles. One of the first stages of clutch plate production is to stamp the raw plates out of rolls of metal. The process requires the use of 100 ton presses that stamp out hundreds of plates per minute.
A chemical is used to keep the presses from overheating and is automatically sprayed in fractions of seconds to keep the press operating smoothly to lubricate and prepare the metal. The chemical also keeps the press from sparking during the punching process. A small spark could cause a fire and safety hazard. Therefore, the chemical is crucial to the operation of the stamping process.
The stamping solution contains proprietary ingredients that are toxic and considered to be hazardous waste, and disposal must be through EPA approved methods. The cost to dispose of the chemical is many times greater than regular waste products.
Currently, Bell Products uses a traditional, volume-based costing system for its clutch plate products. Total manufacturing overhead for the period is allocated to the clutch plates based on machine hours.
Fred, who was recently hired, is the controller for Bell Products. He has five years of experience as a cost accountant at a lumber manufacturing facility. At the lumber plant, Fred implemented an activity-based costing system that helped the plant manager determine the profitability of various product lines. After getting to know the manufacturing process at Bell Products, Fred has determined that an activity-based costing system would help management make better decisions and track the costs of the clutch plates more accurately.
Tina is the manager of the stamping department and is good friends with Fred. Tina runs a very efficient department and has earned several bonuses for the stamping department’s production and profitability. Each of the department managers are evaluated based on the profitability of the departments based on internal cost reports.
If activity-based costing is used to allocate costs and the hazardous waste of the stamping chemical is allocated to the department that uses the product, the internally calculated profits of the stamping department would decline drastically. The decline in profitability would be due to the extreme high cost of the stamping chemical and this cost would be directed allocated to the stamping department.
Tina decides to take Fred to an expensive restaurant and eventually brings up the activity-based costing system. She voices her concern about the allocation of the hazardous waste being directly allocated to her department. She asks Fred if there is any way that he could reduce the amount of hazardous waste allocated to the stamping department. Fred values Tina’s friendship and realizes that she is on the compensation committee that evaluates Fred on an annual basis. Fred definitely wants to keep Tina happy and on his side.
As a result, Fred decides to not setup a cost pool for hazardous waste. He reasons that since the hazardous waste has always been a part of the manufacturing process, he will bury it as part of the manufacturing costs that are allocated across all departments. He justifies his decision because the activity-based system will still accurately allocate all other costs and it is much more accurate than the old traditional costing system. Fred feels no one will get hurt. Since the activity-based costing cannot be used for external reporting, Fred feels that his decision is not illegal.
Using the Institute of Management Accountants Statement of Ethical Professional Practice on page 12 of your textbook (Exhibit 1-6) as an ethical framework, answer the following questions:
What are the ethical issues in this case?
In: Accounting