1.Write a function div7(lst) which takes in a list of integers, and returns a list of booleans of the same length, such that for each integer in the original list, the boolean in the output list is True if that integer was divisible by 7, or False if not. Use list comprehensions in python, the function only could be at most two lines long.
Here is some examples:
>>> div7([14, 5, 7, 3, 29, 28, 10])
[True, False, True, False, False, True, False]
2. Write a invert function.This function
performs a color inversion, as though you were producing a negative
of a photo. Recall that each color component in every pixel is an
integer between 0 and 255, inclusive. In every pixel, for each of
the three color components, if the original value for the component
was x, to invert the color you must set it to 255-x.
Examples:
>>> invert([[[127, 127, 127], [0, 0, 0]],
[[255, 255, 0], [50, 128, 255]],
[[0, 0, 255], [0, 255, 0]],
[[255, 0, 0], [255, 255, 255]]])
[[[[128, 128, 128], [255, 255, 255]],
[[0, 0, 255], [205, 127, 0]],
[[255, 255, 0], [255, 0, 255]],
[0, 255, 255], [0, 0, 0]]]
(note that the highlighting and the new line for each row are for clarity purposes only and will not be present in the actual console output, but the numbers should be correct)
Both need to use python.
In: Computer Science
Chloride ions, Cl- (aq) can be electrolyzed in water to Cl2
(aq). If 198.3 mA of current flows through a platinum electrode
immersed in a 0.200 M Br solution for 4.44 hr, how many grams of
cl2 will be produced? MM Cl2= 35.45 g.
I got 1.15 grams but im not sure if i am doing this right
In: Chemistry
The Bigbee Bottling Company is contemplating the replacement of one of its bottling machines with a newer and more efficient one. The old machine has a book value of $550,000 and a remaining useful life of 5 years. The firm does not expect to realize any return from scrapping the old machine in 5 years, but it can sell it now to another firm in the industry for $295,000. The old machine is being depreciated by $110,000 per year, using the straight-line method.
The new machine has a purchase price of $1,200,000, an estimated useful life and MACRS class life of 5 years, and an estimated salvage value of $145,000. The applicable depreciation rates are 20%, 32%, 19%, 12%, 11%, and 6%. It is expected to economize on electric power usage, labor, and repair costs, as well as to reduce the number of defective bottles. In total, an annual savings of $230,000 will be realized if the new machine is installed. The company's marginal tax rate is 35%, and it has a 12% WACC.
Year | Depreciation Allowance, New | Depreciation Allowance, Old | Change in Depreciation |
1 | $ | $ | $ |
2 | |||
3 | |||
4 | |||
5 |
Year 1 | Year 2 | Year 3 | Year 4 | Year 5 |
$ | $ | $ | $ | $ |
In: Finance
1.) What is strategic planning? Is strategic planning an effective or ineffective tool for organizations? What elements make for an effective strategic planning process in organizations?
Your answers will be short essays and should be three full paragraphs or longer.
In: Operations Management
***Please show the math! Thank you!
Assume that security returns are generated by the single-index model,
Ri = αi +
βiRM + ei
where Ri is the excess return for security
i and RM is the market’s excess
return. The risk-free rate is 3%. Suppose also that there are three
securities A, B, and C, characterized by
the following data:
Security | βi | E(Ri) | σ(ei) | ||
A | 1.0 | 10 | % | 23 | % |
B | 1.3 | 13 | 9 | ||
C | 1.6 | 16 | 18 | ||
a. If σM = 20%, calculate the variance of returns of securities A, B, and C.
|
b. Now assume that there are an infinite number of assets with return characteristics identical to those of A, B, and C, respectively. What will be the mean and variance of excess returns for securities A, B, and C? (Enter the variance answers as a percent squared and mean as a percentage. Do not round intermediate calculations. Round your answers to the nearest whole number.)
|
In: Finance
1.) Briefly outline and describe the five competitive forces
that shape strategy. Which competitive force is the strongest?
Why?
Your answers will be short essays and should be three full paragraphs or longer.
In: Operations Management
•Create a state machine that is sort of like a computer mouse with right clicks and left clicks. Instead it uses pB1 and pB2.
–Two fast clicks of pB1 turns on led 1 for 5s
–Click on pB2 from the idle state you simply turn on LED2 while the button is held in
Below is a state machine I've set up to turn on an LED for 5
s
if a pB is pushed one time, which is only a small part of what i
need, i need to make it so it will take a double click instead of a
single click and i also need to add a part that turns on a
different LED that only turns on when the buttons is pressed, if
you can help me complete my code that would be great, thank
you
#include <myGPIO.h>
#include <myTimer.h>
void setup() {
init_gpio_b(4,0); // PB init for input
init_gpio_b(5,0);
init_gpio_d(2,1); // Init LED outputs
init_gpio_d(3,1);
// init_TimerInterrupt();
Serial.begin(9600);
}
void loop() {
while(1){
whichCase();
myDelay1ms(5);
}
}
void whichCase(void){
static int val=0;
static int state=0;
static int count=0;
Serial.println(PORTD);
switch(state){
case 0:{ //****** Idle ****
// *** Do what the state does ****
gpo_d(3,1);
// *** criteria to leave the state ****
if(gpi_b(4)==0)state=1;
}
break;
case 1:{ //****Wait****
// *** Do what the state does ****
count++;
// *** criteria to leave the state ****
if(count>100){
state=0;
count=0;
}
else if(gpi_b(4)==1){
state=2;
count=0;
}
}
break;
case 2:{ //****ledOn****
// *** Do what the state does ****
gpo_d(3,0);
count++;
// *** criteria to leave the state ****
if(count>1000){
state=0;
count=0;
}
}
break;
default:{
break;
}
}
}
In: Computer Science
What would SE business do during a pandemic? Use HelloFresh company as your discussion. How would business be impacted if it were open during this Covid-19 pandemic? What would firm do for the customers and employees?
HelloFresh's business model is to prepare the ingredients needed for a meal, and then deliver them to customers, who must then cook the meal using recipe cards, which takes around 30–40 minutes. It generally provides about three two-person meals a week for about $60 to $70. It offers a choice from about 19 recipes. In the United States, HelloFresh offers a wine-subscription service, based on that of its competitor Blue Apron. In several markets, it provides "Rapid Box" meals which take only 20 minutes to prepare.
In: Operations Management
Write a Java application that implements the following class(es) as per business requirements mentioned below:
Create an abstract Insurance class (Insurance.java) that has the following instance variables:
- Insurance number,
- customer name,
- start date of policy ( This should be represented by an object of predefined date class in java),
- customer address [( Create a new Address class ( Address.java ) having following instance data members: House number , Street name, City, Province, Zip code. Implement getter and setter and toString() method for Address class. )]
- Define getter and setter along with validations for all the above instance variables.
- Insurance class should have defined two overloaded constructors: o One for initializing all the instance data members to their default values
o Second for initializing only Insurance number, customer name, start date of policy and address
- Declare an abstract public method double MonthlyPayments() which is used for calculating monthly Insurance installment amount.
- Define toString() to display the values
Create following two subclasses of Insurance class:
• a) LifeInsurance (LifeInsurance.java)
• b) VehicleInsurance (VehicleInsurance .java)
For LifeInsurance class, implement the following:
- Define an instance variable – age of the person. Minimum is 1 and Max is 100.
- Define another Boolean variable – smoker.
- Define getters and setters for the above and validations.
- A constructor for initializing all the instance variables with appropriate values.
- Overriding the method - double MonthlyPayments () which calculates monthly insurance installment.
- Business requirements for calculating the yearly insurance – if the person is <= 25 years of age, then yearly insurance amount is $1500.00. if between 26 and 45, then it is 1.5 times and if above 45, then it is two times of the amount. And if the person is smoker, then add $250.00 to yearly insurance amount but if a person is non-smoker, then give 5% discount on yearly insurance amount before calculating the monthly installment. You need to add GST also which is 13%.
- You need to override toString() method to display the object’s data.
For VehicleInsurance class, implement the following:
- Define an instance variable – model year. It cannot be more than 2020 which is current year. And vehicle cannot be older than 15 years. So if current year is 2020 then model year should >= 2005.
- Define another Boolean instance variable – greenVehicle. (yes – means – electric, no means gasoline)
- Constructor for initializing all the instance variables
- Overriding the method - double MonthlyPayments () which calculates monthly vehicle insurance installment
- Business requirements for calculating the yearly insurance – if the vehicle is <= 5, then yearly insurance amount is $3000.00. if between 6 and 10, then 1.5 times and if above 10, then it two times of the amount. And if the vehicle is not green, then add $300.00 as environment fee to yearly insurance amount but if a vehicle is green, then give 10% discount on yearly insurance amount. You need to add GST also which is 13%.
- You need to override toString() method to display the object’s data.
Create a driver class – InsuranceTest (InsuranceTest.java) which tests above classes by at least creating two objects each of the LifeInsurance and VehicleInsurance classes and then processing them normally and polymorphically
In: Computer Science
When performing a REAGENT BLANK in chemistry, do you add or subtract the volume of the blank determination from the volume of titrant to get the corrected volume of titrant used? In this particular experiment we are determining Ca2+ and Mg2+ in natural water samples. And, do you always add or subtract the blank reagent or does it change with reactions? Probably simple questions but they have me completely stumped. Thanks!
In: Chemistry
is all conflict bad? share some situations
In: Psychology
1.) Briefly outline and describe the five generic competitive strategies? Illustrate a specific example of each generic strategy in your description?
Your answers will be short essays and should be three full paragraphs or longer.
In: Operations Management
In: Computer Science
Please give examples for my study guide, Thank You
In: Computer Science
Netflix Now that you’ve identified the organization’s SWOT, you need to determine the project and its objectives and metrics. This project should be based on an unmet opportunity for the organization, or to minimize a potential threat. What does the organization need to do to advance its goals and/or expand its competitive advantage? How will you measure their progress? Complete the following: Explain why this opportunity/threat was selected, and how it is anticipated to benefit the organization. Create at least 3 measurable project objectives based on your analyses. Determine timelines and responsibilities for each objective (e.g. with a RACI chart) Explain why these objectives are appropriate for the project. Develop at least 2 metrics to evaluate achievement of each of the project objectives. Provide a 1-page explanation for why these are appropriate metrics for each of the objectives.
In: Operations Management