Prove that for any t > 0 xi(tp,tw) = xi(p.w), i.e. that if all prices are multiplied by the same positive number the factor inputs that maximize profits will not change, or that the factor demand functions are homogeneous of degree zero.
In: Economics
1.) Blossom, Inc. prepared the following master budget items for July:Production and sales48,000unitsVariable manufacturing costs: Direct materials$72,000 Direct labor$96,000 Variable manufacturing overhead$120,000Fixed manufacturing costs $200,000Total manufacturing costs$488,000 During August, Blossom actually sold 72,000 units. Prepare a flexible budget for Blossom based on actual sales.
In: Accounting
In Python 3.6
Question 1 for strings
a) Write a function named longest_common_prefix that takes two strings and returns the longest common prefix of the two strings. For example, the longest common prefix of distance and disinfection is dis. If the two strings have no common longest common prefix, the method returns an empty string.
b) Write a function named reverse that takes a string argument and returns its reverse. For example, reverse(‘I am testing’) should return the string ‘gnitset ma I’. Use iteration for this and answers using slicing will not be accepted. Imma like... what.
c) Write a function named check_password that checks whether a string is a valid password. Return True if it is a valid password and False otherwise. The password rules are as follows:
• A password must have at least 8 characters.
• A password must consist of only letters and digits.
• A password must contain at least two digits.
In: Computer Science
Two dice are thrown.
Let A be the event that an odd number is obtained on the first dice, B be the event that the number obtained is greater than 5 on the first dice, C be the event that the number obtained on the second dice is smaller than 5, and D be the event that the sum of the two numbers obtained is 8.
State whether each of the following is a pair of independent events or dependent events.
(a) A and B
(b) A and C
(c) B and D
(d) C and D
In: Math
a) Calculate the pH during the titration of 30.00 mL of 0.1000 M trimethylamine, (CH3)3N(aq), with 0.1000 M HCl(aq) after 24 mL of the acid have been added. Kb of trimethylamine = 6.5 x 10-5.
b)Calculate the pH during the titration of 20.00 mL of 0.1000 M methylamine, CH3NH2(aq), with 0.1000 M HNO3(aq) after 19.9 mL of the acid have been added. Kb of methylamine = 3.6 x 10-4.
In: Chemistry
Question 1: Answer, True or False
The index of refraction has units of distance.
True
False
When we make multiple measurements, we can have more confidence in the index of refraction determination.
True
False
Glass is more dense than water.
True
False
It is possible to exceed the speed of light in a vacuum
True
False
A tangent line is parallel to a normal line
True
False
The index of refraction is unitless.
True
False
There is a special case when the index of refraction is less than 1.
True
False
In: Physics
Ringing Bell Telephone Company has implemented an affirmative
action plan in compliance with the Equal Employment Opportunity
Commission. Under the current plan, to eliminate discrimination
based on sex, women must be placed in jobs traditionally held by
men. Therefore, the human resource department has emphasized
recruiting and hiring women for such positions. Women who apply for
craft positions are encouraged to try for outdoor craft jobs, such
as those titled installer-repairer and line worker.
All employees hired as outside technicians must first pass basic
installation school, which includes a week of training for pole
climbing. During this week, employees are taught to climb 30-foot
telephone poles. At the end of the week, they must demonstrate the
strength and skills necessary to climb the pole and perform
exercises while on it, such as lifting heavy tools and using a
pulley to lift a bucket. Only those who pass this first week of
training are allowed to advance to the segment dealing with
installation.
Records have been maintained on the rates of success or failure for
employees who attend the training school. For men, the failure rate
has remained fairly constant at 30 percent. However, it has
averaged 70 percent for women.
The human resource department has become concerned because hiring
and training employees who must resign at the end of one week is a
tremendous expense. In addition, the goal of placing women in
outdoor craft positions is not being reached.
As a first step in solving the problem, the human resource
department has started interview- ing the women who have failed the
first week of training. Each employee is asked her reasons for
seeking the position and encouraged to discuss probable causes for
failure. Interviews over the last two months disclosed that
employees were motivated to accept the job because of their wishes
to work outdoors, work without close supervision, obtain
challenging work, meet the public, have variety in their jobs, and
obtain a type of job unusual for women. Reasons for failure were
physical inability to climb the pole, fear of height while on it,
an accident dur- ing training such as a fall from the pole, and
change of mind about the job after learning that strenuous work was
involved.
In many instances, the women who mentioned physical reasons also
stated they were not physically ready to undertake the training;
many had no idea it would be so difficult. Even though they still
wanted the job, they could not pass the physical strength test at
the end of one week.
Some stated that they felt “influenced” by their interviewer from
the human resource depart- ment to take the job; others said they
had accepted it because it was the only job available with the
company at the time.
Questions
1. What factors would you keep in mind in designing an effective
selection process for the position of outdoor craft
technician?
2. What would you recommend to help Ringing Bell reduce the failure
rate among women trainees?
In: Accounting
Java
1. Program Specification
This will focus on strengthening your skills with manipulating Strings. The String class provides many useful methods, in which this assignment will give you further practice with. You will read in dates in a variety of different formats, parse the dates, and then print them out in a converted format. The dates will be entered in one line by the user, and they will be separated by the word “and”.
2. Date formats
Your program will parse a line of dates written in three styles: day first, month first, and all-numbers.
Day first: The day of the month is first, followed by the month, followed by the year. The month string must be at least 3 letters long, and can be a mix of upper and lowercase letters. Spaces should separate the three parts. Spaces are not allowed between numbers or month names.
ex: 8 Aug 2015
24 February 1988
Month first: The month is first, followed by the day, a comma, then the year. The month may be fully spelled out or an abbreviation at least 3 letters long and be upper or lower case. A space must separate the month and day, but there may be multiple spaces between the two.
ex: March 15, 1967
Jan 17, 1990
All numbers: Month, day, and year are entered as numbers with dashes between them. There may be many spaces around the dashes or none. Spaces are not allowed between the numbers.
ex: 12-4-2008
1-8-2003
3. Requirements
Your program must read a single line that may contain many dates in many formats separated by the word “and”. It will parse out the dates, and print them all in the correct format. The correct format is day first, a space, followed by the full name of the month with the first letter capitalized, a space, and then the year.
Your program must give an error message if a date is invalid. It should give a specific error message for the following cases:
o A month name or abbreviation is misspelled or too short (less
than three characters)
o A day or month number is incorrect. Months must be between 1 and
12. Days must be
valid for the month (ignore leap years)
o A year number is too low or high (1900 to 2019). o There are too
many dashes in All Numbers format.
It is ok if your program crashes when calling Integer.parseInt and the argument is not valid.
4. Implementation
There are some specific requirements for how you write the program.
Use the below build-in methods
o String class: substring, trim, split, toLowerCase, indexOf, or
lasIndexOf o Integer class: parseInt
In the main() method, you must prompt the user to enter the dates, read the line of dates, break the line into separate Strings based on the delimiter (“and”), and for each date print “Date : ”. You must also call the appropriate parser here.
One method for parsing each kind of date. These methods either output an error message or the corresponding standard date string.
o public static void parseDayFirst(String dateStr)
o public static void parseMonthFirst(String dateStr) o public
static void parseAllNumbers(String dateStr)
public static boolean isValidMonthDay(int day, int
month)
o returns true if the month and day numbers form a valid day of the
year (leap years
excluded)
public static int monthToNumber(String monthStr)
o Takes a string that should be the name or abbreviation of the
month name and returns
the number of the month. It returns zero if the name doesn’t match any month or is too short. This method is provided for you.
public static boolean isValidMonthAbbr(String month)
Takes a month as a String and returns boolean value. True means the
passed in month string represents a valid month string (the length
of the trimmed month string is greater than or equals 3, and the
month string abbreviation is correctly spelled!!!).
Hint: indexOf along with the provided static String array fullNameMonths declared at
the top of the class may be useful here for. public static boolean isValidYear(int year)
o returns true if the year is valid (1900 to 2018)
public static String standardDateString(int day, int month,
int year)
o takes a day, month, and year as numbers and returns a String
containing the date in the
correct format, Day Month Year. (ex. 13 March 2006)
5. Sample Output
Welcome to the Date Converter!
Enter line of dates:8 Aug 2015 and March 15, 1967 and 12-4-2008
Date 1: 8 August 2015
Date 2: 15 March 1967
Date 3: 4 December 2008
Goodbye!
Welcome to the Date Converter!
Enter line of dates:15 xyz 2000 and Date 1: ERROR: Invalid month string Date 2: ERROR: Too many dashes Date 3: ERROR: Invalid month string Date 4: ERROR: Invalid month or day number
Goodbye!
Welcome to the Date Converter!
Enter line of dates: ERROR: Empty input line
Goodbye!
Welcome to the Date Converter!
Enter line of dates:and 2-0-2222 and Jan 13, 1190 and March
12,2222 and 9 Date 1: ERROR: No date entered
Date 2: ERROR: Invalid month or day number
Date 3: ERROR: Invalid Year-too low or hi
Date 4: ERROR: Invalid Year-too low or hi Date 5: 9 September 2018
Goodbye!
2-2-22222-and J 10, 2004 andFeb 45 , 2012
- 9-2018
------------------------------------------
Code Provided
package cs251_HW2;
import java.util.Scanner;
public class DateConversion {
//Static variable you can use throughout this class
//contains the months in shorter form
private static String[] abbrMonths = { "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep",
"oct", "nov", "dec" };
//Another static variable you can use, except these contain the months fully spelled out
private static String[] fullNameMonths = { "january", "february", "march", "april", "may", "june", "july", "august", "september",
"october", "november", "december" };
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
System.out.println("Welcome to the CS251 Date Converter!\n");
System.out.print("Enter line of dates:");
String dateEntries = stdIn.nextLine();
//TODO
System.out.println("\nGoodbye!");
stdIn.close();
}
public static void parseDayFirst(String dateStr) {
//TODO
}
public static void parseMonthFirst(String dateStr) {
//TODO
}
public static void parseAllNumbers(String dateStr) {
//TODO
}
public static boolean isValidMonthDay(int day, int month) {
//TODO
}
public static int monthToNumber(String monthStr) {
String lowerCaseMonthStr = monthStr.toLowerCase().substring(0, 3);
int mNumber = 0;
for(int i = 0; i < abbrMonths.length; i++){
if(abbrMonths[i].equals(lowerCaseMonthStr)){
mNumber = i + 1;
break;
}
}
return mNumber;
}
public static boolean isValidMonthAbbr(String str) {
//TODO
}
public static boolean isValidYear(int year) {
//TODO
}
public static String standardDateString(int d, int m, int y) {
//TODO
}
}
In: Computer Science
Unit 09 Drop Box Assignment
ONLY ONE FILE may be turned in for the assignment. If you make a
mistake and need to turn
in your work again, you may do so. I will only grade the latest
file you turn in. The older ones
will be ignored. For instruction on How To do assignments and
create the file see the "How To
Do Homework" document under the "Start Here" button.
The Assignment
Create a Visual Logic flow chart with four methods. Main method
will create an array of 5
elements, then it will call a read method, a sort method and a
print method passing the array
to each. The read method will prompt the user to enter 5 numbers
that will be stored in the
array. The sort method will sort the array in ascending order
(smallest to largest). The print
method will print out the array.
A sample run might look like this:
Please enter a number: 2
Please enter a number: 7
Please enter a number: 1
Please enter a number: 10
Please enter a number: 3
Your numbers are: 1, 2, 3, 7, 10
In: Computer Science
A canister contains butane at a pressure of 760 torr and a temprature of 25C. All of contents of the canister are allowed to react with excess oxygen to produce carbon dioxide and water.
2 (C4H10) + 13O2 -------> 8CO2+ 10(H2O)
Equation is balanced and butane is completely consumed in the reaction, and 46.5g grams of CO2 are produced. What is the volume, in liters, of the canister that contained the butane??
Answer is 6.46L but can anyone please show work for this question?? I just can't get the right answer or near even near it. Please teach me how to approach this problem. Thank You!
In: Chemistry
How would have the Great Depression Devotion encouraged Americans struggling through the Great Depression?
In: Economics
I need to know the following values in the table below. All the info you need should be listed.
1. Write the balanced equation for the reaction between solid zinc and aqueous hydrochloric acid. Be sure to include physical states.
|
Zn(s) + 2HCl (aq) |
In: Chemistry
create database shop;
use shop;
create table users(
id int null auto_increment,
firstname varchar(255),
lastname varchar(255) not null,
primary key (id)
);
create table products(
id int null auto_increment,
name varchar(255),
price float,
primary key (id)
);
create table orders(
id_users int not null,
id_items int not null,
primary key (id_users,id_items),
foreign key (id_users) references users(id),
foreign key (id_items) references items(id)
);
write three SQL queries to answer the following questions
1.- Products in the shop catalog; product name.
2.- List of products in stock (not sold); product name, code,
price.
3.- Products sold in the shop; product name, code, price and full
name of buyer.
Concepts in practice: Relational Databases, SQL.
In: Computer Science
java
declare at least five different types of arrays, one, two and three-dimension.
In: Computer Science
For this assignment, you will apply what you learned in analyzing a simple Java™ program by writing your own Java™ program. The Java™ program you write should do the following:
Complete this assignment by doing the following:
/************************************************************************************
* Program: PRG/420 Week 5
* Purpose: Week 5 Coding Assignment
* Programmer: TYPE YOUR NAME HERE
* Class: PRG/420
* Creation Date: TYPE TODAY'S DATE HERE
*************************************************************************************
* Program Summary:
* This program converts a given date to a string.
* The code includes exception handling for a
ParseException.
************************************************************************************/
package prg420week5_codingassignment;
import java.util.*; // wildcard to import all the util.
classes
import java.text.*; // wildcard to import all the text classes
public class PRG420Week5_CodingAssignment {
public static void main(String[] args){
// The getInstance() method returns a Calendar object whose
calendar fields have been initialized with the current date and
time.
Calendar calendar = Calendar.getInstance(); {
LINE 1. BEGIN THE TRY BLOCK.
String str_date="01-Nov-17"; // Declare a string that we will use
later to format a date like this: ##-XXX-##
DateFormat formatter; // Declare an object of type DateFormat so
that we can call its parse() method later
Date myFormattedDate; // Declare a variable of type Date to hold
the formatted date
formatter = new SimpleDateFormat("dd-MMM-yy"); // Assign a specific
date format to the formatter variable
// The given date is taken as a string that is converted into a
date type by using
// the parse() method
myFormattedDate = (Date)formatter.parse(str_date);
// setting up the format
System.out.println("The formatted date is " +
myFormattedDate);
System.out.println("Today is " +calendar.getTime() );
LINE 2. WRITE THE CATCH BLOCK TO CATCH EXCEPTIONS OF TYPE
ParseException (TO HANDLE EXCEPTION, SIMPLY PRINT THE
EXCEPTION)
}
}
}
In: Computer Science