CASE INCIDENT
What Should Wilma and Frank Do?
Frank and Wilma Rogers live in the Toronto area. Frank is a product engineer in the automotive industry and Wilma is a professor for a local community college. Wilma has been working on her doctorate for the last five years and is scheduled to graduate with her PhD in Business
Administration shortly. Wilma has just received an interesting telephone call and can’t wait to talk to Frank about it.Over dinner that night Wilma tells Frank about the phone call: a past boss of hers called to tell her about an open position at a university in Nunavut. As Wilma excitedly discusses the associate professor of business position and the opportunities it will bring, Frank is thinking to himself what a great opportunity it is, but that he doesn’t find the location appealing. He subsequently tells her this and nothing more is discussed. A week goes by and Wilma still finds herself yearning to know more about this position and wanting to apply. She calls Frank and explains this to him and he encourages her to apply. Wilma calls her former boss and applies for the position. Eventually she gets an offer. Wilma gives her notice at the college and within the next six months starts her new position. Wilma moves to Nunavut, but Frank stays in Toronto until he can find a job in Nunavut. A few more months go by and Frank has not been able to find a comparable job, so he pressures Wilma to consider moving back to Toronto and leaving her new position. Wilma is torn about what to do as she loves her new job but understands why Frank is frustrated.
Questions
1.According to Edgar Schein, what career anchors are driving Wilma’s and Frank’s careers at this point?
2.If Wilma wishes to stay in her new job, how could her employer assist her with this dilemma?
3.Is there anything Frank and Wilma should have done differently in your opinion? If so, what?
In: Psychology
Acquire the first name of the applicant. Use the applicant’s name in the required prompts to show that you are a friendly bank.
Prompt the customer to enter the percentage of his/her down payment which is a double value. Note if the percentage is 23.4%, the customer will enter “23.4” without the percentage sign.
If the customer can NOT put at least 15% down, reject the application.
If the customer can put 15% or more as the down payment, prompt the customer to enter his/her credit score which is supposed to be an integer.
If the customer’s credit score is less than 500, reject the application.
If the customer’s credit score is greater than or equal to 500, approve the application.
At the very beginning of the file, write the following lines as comments.
// By Joe Smith (replace it by your name)
// Homework 2, xx/xx/xxxx (replace it by the submission date)
// Home Loan Approval Engine
If the customer’s credit score is less than 500, reject the application.
If the customer’s credit score is greater than or equal to 500, approve the application.
At the very beginning of the file, write the following lines as comments.
// By Joe Smith (replace it by your name)
// Homework 2, xx/xx/xxxx (replace it by the submission date)
// Home Loan Approval Engine
Name your file HomeLoanApproval.java
In: Computer Science
Hi, someone please do every part. I'm desperate!! :(
Using RStudio, Create an R-Script:
(1) You will generate a numeric matrix of size 21 by 21 and will name it tmp. To do so, draw 21×21 = 441 random observations from the standard normal distribution. Before doing so, set the seed for the random number generator to 37. See help for set.seed().
(2) Change the diagonal elements of tmp to 1s.
(3) Calculate condition number of tmp. See help for cond().
(4) Calculate the inverse of tmp. See help for solve().
(5) Calculate the trace of tmp.
(6) Sort tmp across rows.
(7) Delete the last row and last column from tmp and name the submatrix as tmp again.
(8) Reshape tmp as 40 by 10 matrix and name it as tmp1.
(9) Repeat tmp1 four times to generate 40 by 40 array, and name it as tmp2.
(10) Calculate condition number of tmp2.
(11) Calculate the inverse of tmp2.
(12) Change all nonpositive (<= 0) elements of tmp2 to 0.5.
(13) Set the first row and first column element of tmp2 to its negative value.
(14) Now take the natural log of tmp2 and name it as tmp3.
(15) Find the indices for NaN values in tmp3.
In: Statistics and Probability
(Round the final answer to 4 decimal digits) 1. A brand name has a 70% recognition rate. Assume the owner f the brand wants to verify that rate by begging with a small sample of 6 randomly select consumers. a. What is the probability that exactly 4 of the selected consumers recognize the brand name?
b. What is the probability that all of the selected consumers recognize the brand name?
c. What is the probability that at least 5 of the selected consumers recognize the brand name?
d. What is the probability that at most 2 of the selected consumers recognize the brand name?
2) . The lengths of pregnancies are normally distributed with a mean of 272 days and a standard deviation of 15 days. If 35 women are randomly selected, find the probability that they have a mean pregnancy between 271 days and 275 days.
3) The body temperatures of adults are normally distributed with a mean of 98.6° F and a standard deviation of 0.50° F. If 25 adults are randomly selected, find the probability that their mean body temperature is greater than 98.4° F.
4) The average number of pounds of red meat a person consumes each year is 190 with a standard deviation of 24 pounds (Source: American Dietetic Association). If a sample of 60 individuals is randomly selected, find the probability that the mean of the sample will be Less than 192 pounds.
In: Statistics and Probability
JAVA
(1) Create two files to submit:
Build the Payroll class with the following specifications:
(2) In main(), create two Payroll objects: one use the info
inputted by the user, and the other use the default constructor,
and print the info for each employee (2 pts)
Ex:
Enter the name, ID, pay rate, and hours worked of an employee: Linda Smith 1234 20.5 35 Employee Records: Name ID Pay Rate Hrs Worked Gross Pay Linda Smith 1234 $20.50/hr 35.0 $717.50 John Doe 9999 $15.00/hr 40.0 $600.00
In: Computer Science
Write a complete and
syntactically correct Python program to solve the following
problem:
Write a program for your professor that allows him to keep a record
of the students’ average grade in his class. The program must be
written in accordance with the following specs:
1. The input must be interactive from the keyboard. You will take
input for 12 students.
2. You will input the students’ name and an average grade. The student cannot enter an average below zero or above 100. Your program must raise and handle an exception should this occur.
a. The exception should cause the program to return and get a new grade
3. Write all output to a file named grades.txt
4. Close the output file.
5. Open the file grades.txt for input.
6. Your program will raise and handle an exception if the file is not found.
a. I will
test this aspect by changing the file name and looking for your
exception
code (your exception should cause program to ask for correct file
name).
7. Read all the records from the file and display them.
Please help me to finish this code:
name,grade=input().split()
grade=int(grade)
if grade <0 or grade>100:
exceptioncheck()
def execptioncheck():
name,grade=input().split()
In: Computer Science
Below are four bivariate data sets and the scatter plot for each. (Note that each scatter plot is displayed on the same scale.) Each data set is made up of sample values drawn from a population.
|
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|
Answer the following questions. The same response may be the correct answer for more than one question.
|
In: Statistics and Probability
Data Analysis & Visualization
Topic R vector and save the r code in a text file
Problem 1.
Create two vectors named v and w
with the following contents:
v : 21,10,32,2,-3,4,5,6,7,4,-22
w : -18,72,11,-9,10,2,34,-5,18,9,2
A) Print the length of the vectors
B) Print all elements of the vectors
C) Print elements at indices 3 through 7.
D) Print the sum of the elements in each vector.
E) Find the mean of each vector. (Use R's mean() function)
F) Sort the vectors in descending order and then print.
G) Add vectors v and w.
H) Multiply vectors v and w.
I) In vector v select all elements that are greater than
zero.
J) In vector w select all elements that are less than zero.
K) Multiply each element of vector v by 6. And then print.
L) Find maximum and minimum of each vector.
M) In each vector, replace all negative values with the average of
all numbers in the vector.
Problem 2.
Write a for loop to print the numbers 100, 98, 96, . . . , 4, 2.
Problem 3.
Create a data frame with the following content:
|
city |
county |
state |
population |
|
Chicago |
Cook |
IL |
2853114 |
|
Kenosha |
Kenosha |
WI |
90352 |
|
Aurora |
Kane |
IL |
171782 |
|
Elgin |
Kane |
IL |
94487 |
|
Gary |
Lake(IN) |
IN |
102746 |
|
Joliet |
Kendall |
IL |
106221 |
|
Naperville |
DuPage |
IL |
147779 |
|
Arlington Heights |
Cook |
IL |
76031 |
|
Bolingbrook |
Will |
IL |
70834 |
|
Cicero |
Cook |
IL |
72616 |
|
Evanston |
Cook |
IL |
74239 |
|
Hammond |
Lake(IN) |
IN |
83048 |
|
Palatine |
Cook |
IL |
67232 |
|
Schaumburg |
Cook |
IL |
75386 |
|
Skokie |
Cook |
IL |
63348 |
|
Waukegan |
Lake(IL) |
IL |
91452 |
Hint: Create vectors for each column and then
create a data frame using vectors and the data.frame() function. A
sample is given in the lecture notes.
city<-
c("Chicago","Kenosha","Aurora","Elgin","Gary","Joliet","Naperville","Arlington
Heights","Bolingbrook","Cicero","Evanston","Hammond","Palatine","Schaumburg","Skokie","Waukegan")
county<- c( "Cook", "Kenosha", "Kane", "Kane", "Lake(IN)",
"Kendall", "DuPage", "Cook", "Will", "Cook", "Cook", "Lake(IN)",
"Cook", "Cook", "Cook", "Lake(IL)")
state<- c( "IL", "WI", "IL", "IL", "IN", "IL", "IL", "IL", "IL", "IL", "IL", "IN", "IL", "IL", "IL", "IL")
population<-c(2853114,90352,171782,94487,102746,106221,147779,76031,70834,72616,74239,83048,67232,75386,63348,91452)
A) Print the mean of population.
B) Print the population of all cities greater than 800,000.
C) Print city, county,state and population of all cities with population less than 1,000,000.
D) Print city, county, state, and population of the most crowded city.
Hint: You can use subset() function with max() in your selection criteria in the subset() function.Then print the data in the subset.
E) Print the city and state of the least crowded city.
Hint: You can use subset() function with min() in your selection criteria in the subset() function. Then print the data in the subset.
In: Computer Science
INPUT FILE INTO ARRAY. CHECKING FOR COMMAS AND SUCH. HOW TO DO?
void readFile(Candidate candidates[]) – reads the elections.txt file, fills the candidates[] array. Hint: use substr() and find() functions. Set Score to 0.
void List(Candidate candidates[]) – prints the array of Candidate
structs. One candidate per one line, include all fields. Use setw()
to display nice looking list.
void displayCandidate(Candidate candidates[]) – prints the complete
information about the candidate
.
Candidate First(Candidate candidates[]) – returns single struct
element: candidate with highest score
Candidate Last(Candidate candidates[]) – returns single struct
element: candidate with lowest score
void Votes(Candidate candidates[]) – function sorts the
candidates[] array by number of votes, the order in candidates[]
array is replaced
void Scores(Candidate candidates[]) – calculates the percentage
score for each candidate. Use the following formula:
??????=(CandidateVotes)/(sum of votes)*100%
Correct line for the reference: F=John,L=Smith,V=3342
The line errors that your program needs to detect, are as follows:
incorrect token / separator, example in line 5: F=Steven,L=JohnV=4429 --- (comma missing) – lines with this error need to be ignored
space in token, example in line 3: F=Hillary,X=Clinton, V=1622 --- lines with this error need to be read, error fixed, data included in your dataset
empty line, example in line 6 – empty lines need to be ignored
Example Textfile
F=Michael,L=John,V=3342
F=Danny,L=Red,V=2003
F=Hillary,L=Clinton, V=1588
F=Albert,L=Lee,V=5332
F=Steven,L=JohnV=4429
*IMPORTANT* How would I do the readFile function? It says to check if the commas are present, and that the program will correct the line if there is white spaces. How do i use the find() function? Please be DETAILED in explanations of each part of code. Beginner Coder. *IMPORTANT*
Code Skeleton We HAVE to follow:
#include
#include
#include
#include
#include
using namespace std;
struct Candidate {
string Fname;
string Lname;
int votes;
double Score;
};
const int MAX_SIZE = 100;
void readFile(Candidate[]);
void List(Candidate[]);
void Votes(Candidate[]);
void displayCandidate(Candidate);
Candidate First(Candidate[]);
Candidate Last(Candidate[]);
void Scores(Candidate[]);
int main() {
}
void readFile(Candidate candidates[]) {
string line;
ifstream infile;
infile.open("elections.txt");
while (!infile.eof()) {
getline(infile,line);
// your code here
}
infile.close();
}
void List(Candidate candidates[]) {
}
void Votes(Candidate candidates[]) {
}
void displayCandidate(Candidate candidates) {
}
Candidate First(Candidate candidates[]) {
}
Candidate Last(Candidate candidates[]) {
}
void Scores(Candidate candidates[]) {
}
TO ANUNAGA: I don't know what you want, this is the code we HAVE TO go by and code by and figure out. I can't give you anymore information. Please, either help me solve this or just don't.
In: Computer Science
INPUT FILE INTO ARRAY. CHECKING FOR COMMAS AND SUCH. PLEASE READ CAREFULLY.
alot of people give me either partial answers, or incorrect skeleton. PLEASE YOU CAN'T CHANGE WHAT IS THERE, YOU CAN ONLY ADD.
void readFile(Candidate candidates[]) – reads the elections.txt file, fills the candidates[] array. Hint: use substr() and find() functions. Set Score to 0.
void List(Candidate candidates[]) – prints the array of Candidate
structs. One candidate per one line, include all fields. Use setw()
to display nice looking list.
void displayCandidate(Candidate candidates[]) – prints the complete
information about the candidate
.
Candidate First(Candidate candidates[]) – returns single struct
element: candidate with highest score
Candidate Last(Candidate candidates[]) – returns single struct
element: candidate with lowest score
void Votes(Candidate candidates[]) – function sorts the
candidates[] array by number of votes, the order in candidates[]
array is replaced
void Scores(Candidate candidates[]) – calculates the percentage
score for each candidate. Use the following formula:
??????=(CandidateVotes)/(sum of votes)*100%
Correct line for the reference: F=John,L=Smith,V=3342
The line errors that your program needs to detect, are as follows:
incorrect token / separator, example in line 5: F=Steven,L=JohnV=4429 --- (comma missing) – lines with this error need to be ignored
space in token, example in line 3: F=Hillary,X=Clinton, V=1622 --- lines with this error need to be read, error fixed, data included in your dataset
empty line, example in line 6 – empty lines need to be ignored
Example Textfile
F=Michael,L=John,V=3342
F=Danny,L=Red,V=2003
F=Hillary,L=Clinton, V=1588
F=Albert,L=Lee,V=5332
F=Steven,L=JohnV=4429
*IMPORTANT* Please be DETAILED in explanations of each part of code. Beginner Coder. *IMPORTANT*
Code Skeleton We ***HAVE*** to follow. How Would i go about using this skeleton? YOU CANNOT CHANGE FUNCTIONS OF VARIABLES, ***BUT YOU MAY ADD TO IT***. THE CODE MUST HAVE WHAT IS LISTED IN THE SKELETON CODE:
#include <iostream>
#include <iomanip>
#include <stdlib.h>
#include <fstream>
#include <string>
using namespace std;
struct Candidate {
string Fname;
string Lname;
int votes;
double Score;
};
const int MAX_SIZE = 100;
void readFile(Candidate[]);
void List(Candidate[]);
void Votes(Candidate[]);
void displayCandidate(Candidate);
Candidate First(Candidate[]);
Candidate Last(Candidate[]);
void Scores(Candidate[]);
int main() {
}
void readFile(Candidate candidates[]) {
string line;
ifstream infile;
infile.open("elections.txt");
while (!infile.eof()) {
getline(infile,line);
// your code here
}
infile.close();
}
void List(Candidate candidates[]) {
}
void Votes(Candidate candidates[]) {
}
void displayCandidate(Candidate candidates) {
}
Candidate First(Candidate candidates[]) {
}
Candidate Last(Candidate candidates[]) {
}
void Scores(Candidate candidates[]) {
}
In: Computer Science