Regarding Python and Scripting
1. What SQL clause is used to combine rows from two or more tables, based on a related column in a relational database.
Question options:
|
CONNECT |
|
|
JOIN |
|
|
WHERE |
2. The highlighted portion of this program output indicates ____________.
Tracks:
(u'Thunderstruck', 20)
(u'My Way', 15)
Question options:
|
Unknown values that are recently inserted into the Tracks table |
|
|
Unicode strings that are capable of storing non-Latin character sets |
|
|
Universal variables that can fit into any column |
3. In technical descriptions of relational databases, the concept of column is formally referred to as ____________.
Question options:
|
dictionary |
|
|
variable |
|
|
attribute |
4. What is wrong with this SELECT statement?
SELECT FirstName LastName
FROM TableName
Question options:
|
This SELECT statement has no errors |
|
|
A comma is missing between the field names |
|
|
A table name is missing from the SELECT statement |
5. What is meant by this error message in the SQL query window:
Cannot insert explicit value for identity column in table 'Tracks'
Question options:
|
It means that the identity field has a specified value or is auto-incremented, so a value shouldn't be forced into the field. |
|
|
It means that the identity field has an unspecified variable or is auto-incremented, so a value should be entered manually. |
|
|
It means that the identity field has an automated constant attribute, so a value can only be entered remotely. |
6. What is returned by this SQL SELECT statement?
SELECT LoginID, JobTitle, BirthDate
FROM Employee
WHERE JobTitle Like '%Engineer%'
Question options:
|
All rows that contain the word "Engineer" |
|
|
All rows where the JobTitle field ends with the word "Engineer" |
|
|
All rows where the JobTitle field equals Engineer |
7. An integer that is automatically assigned by the database to link rows from different tables together is referred to as ______________.
Question options:
|
auto link |
|
|
primary key |
|
|
foreign integer |
8. Which of the following conclusions about the table Follows is INCORRECT?
CREATE TABLE Follows
(from_id INTEGER, to_id INTEGER, UNIQUE(from_id, to_id) )
Question options:
|
The table contains two columns |
|
|
The table contains two rows |
|
|
Columns in the table only takes integer values |
In: Computer Science
A retail carpet business has primarily residential customers together with a few commercial customers that make large purchases. Usually, the business sells an average of 100 square yards of carpet with a standard deviation of 90 square yards. The distribution of carpet sales is
Select one:
a. right-skewed.
b. left-skewed.
c. skewed, but we canât tell whether itâs left-skewed or right-skewed
d. approximately symmetric, but not Normal.
e. approximately Normal.
f. Thereâs no way to tell what shape the distribution has.
g. It doesn't make sense to talk about the shape of this distribution.
Suppose the histogram in FIGURE 3 is the sampling distribution for sample averages from samples of size n = 25 from some population. Which of the following statements would be true if the sample sizes were increased to 150?
Select one:
a. The shape of the distribution would not change.
b. The shape of the distribution would be more bell-shaped.
c. The shape of the distribution would be more skewed.
"95% confident" means...
Select one:
a. if we took many random samples from the population, and computed a 95% confidence interval for each sample, we would expect 95% of the confidence intervals to contain the true parameter.
b. if we took one random sample from the population, we would expect 95% of the people in the sample to have a value within the confidence interval.
c. Both A and B are true
d. Neither A nor B are true
Using the sampling distribution in FIGURE 3, how likely is a sample mean around 76?
Select one:
a. Reasonably likely to occur from a sample of this size
b. Unusual but might occur occasionally
c. Extremely unlikely to ever occur
We have a large collection (5574) of real SMS text messages from cellphone users in 2010. 747 of these messages are classified as "spam", and the rest are not. The word âtextâ (or âtxtâ) is contained in 7.01% of legitimate (not spam) messages, and in 38.55% of all spam messages. What is the probability that a message is spam, given that it contains the word âtextâ (or âtxtâ)?
Select one:
a. 7.01%
b. 13.40%
c. 38.55%
d. 45.97%
e. 57.56%
f. 84.61%
g. We can't determine this probability.
In: Statistics and Probability
Question Three: Capital Budgeting
You are considering starting a small coffee shop in Auckland. After some market research and analysis, you have come up with two potential locations, one in the Central City (to be named as City Café) and the other one in Ellerslie (to be called Ellerslie Café). The setup costs are estimated to be $50,000 for City Café and $45,000 for Ellerslie Café. Given your budget constraint, you can only choose one of these options.
You have learned that small businesses would generally struggle during the first few years of operations. You took an optimistic forecasting approach and estimated that the first year after-tax net cash flows would be $8,000 and $6,800 for City Café and Ellerslie Café, respectively. The annual growth in net cash flows is estimated to be 3% for City Café and 2% for Ellerslie Café for the first 5 years (years 2 to 5) and then based on the end of year 5 cash flows, the growth in cash flows will increase to 6% for City Café and 5% for Ellerslie Café from years 6 to 10 as you improve your customer service and gain more loyal customers.
You are optimistic that you will be running the business for at least 10 years. At the end of the 10th year, if you were to end the business, you estimated the salvage values (after depreciation) to be $10,000 for City Café and $7000 for EllerslieCafé. Your estimated cost of capital is 9.5%.
a) Using the above information, conduct an NPV analysis for each option.
NPV for City Café: Central Cafe :
NPV for Ellerslie Café:
a) Based on your NPV results, which option shall you adopt to start your small business?
Option to be adopted: City cafe
Explanation:
b) Before you make your final decision, what financial analysis can be performed for a more in-depth or comprehensive capital budgeting analysis? Why would that be useful? Use an example to clearly illustrate your point.
[Word limit: 80 words; answers beyond the word limit will not be marked.]
i. Further financial analysis to perform: [Type here]
ii. Explanation using an example: [Type here]
In: Finance
A9-75
in this activity, you will be creating budgets for a single product for each of the months in an upcoming quarter. Select a product that you could purchase in large quantities (at a Sam's Club or other warehouse retail chain) and repackage into smaller quantities to offer for sale at a sidealk cafe, a sporting event, a flea market, or other similar venue. Investigate the price a quantity at which this product is available at the warehouse. Choose a selling price for the smaller (repackaged) package. Make Reasonable assumptions about how many of the smaller units you can sell in each of the next four months (your will need the fourth month's sales in units for the operating budgets).
A. Describe your product. What is your cost of this product? What size (quantity) will you purchase? At what price will you sell your repackaged product? Make projections of your sales in units in each of the upcoming three months.
B. Estimate how many hours you will spend in each of the upcoming three months doing the purchasing, repackaging, and selling. Select a reasonable wage rate for yourself. What will your total labor costs be in each of the upcoming three months?
C. Prepare a sales budget for each of the upcoming three months.
D. Prepare the direct material budgets for the upcoming three months, assuming that you need to keep 10% of the direct materials needed for next month's sales on hand at the end of each month (this requirement is why you needed to estimate unit sales for four months).
E. Prepare a direct labor budget (for your labor) for each of the upcoming three months.
F. Think about any other expenses you are likely to have (i.e., booth rental at a flea market or a vendor license). Prepare the operating expenses budget for each of the upcoming three months.
G. Prepare a budgeted income statement that reflectcs the budget you prepared, including the sales budget, direct materials budget, direct labor budget, and the operating expenses budget. This budgeted income statement should include one column for each of the three months in the quarter, and it should also include a total column that represents the totals of the three months. What is your projected by month and for the quarter?
This is the only information given word for word from the textbook.
In: Accounting
Write a class called Name. A tester program is provided in Codecheck, but there is no starting code for the Name class. The constructor takes a String parameter representing a person's full name. A name can have multiple words, separated by single spaces. The only non-letter characters in a name will be spaces or -, but not ending with either of them.
The class has the following method:
âą public String getName() Gets the name string.
âą public int consonants() Gets the number of consonants in the name. A consonant is any character that is not a vowel, the space or -. For this problem assume the vowels are aeiou. Ignore case. "a" and "A" are both vowels. "b" and "B" are both consonants.
You can have only one if statement in the method and the if condition cannot have either && or ||. Do not use the switch statement, which is basically the same as an if statement with multiple alternatives. Hint: call method contains().
- public String initials() Gets the initials of the name.
Do not use nested loops for the method. Hint for initials(): Each word after the first is preceded by a space. You can use the String method indexOf (" ", fromIndex) to control a while loop and to determine where a new word starts. This version of indexOf() returns the index of the first space starting at the fromIndex. The call of indexOf (" ", fromIndex) returns -1 if the space is not found in the string. Remember that the name does not have 2 consecutive spaces and does not end in a space.
NameTester.java
/**
* A Java tester program for class Name.
*
* @author Kathleen O'Brien, Qi Yang
* @version 2020-07-25
*/
public class NameTester
{
public static void main(String[] args)
{
Name name = new Name("Allison Chung");
System.out.println(name.getName());
System.out.println("Expected: Allison Chung");
System.out.println(name.consonants());
System.out.println("Expected: 0");
name = new Name("a-abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ");
System.out.println(name.getName());
System.out.println("Expected: a-abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ");
System.out.println(name.consonants());
System.out.println("Expected: 0");
name = new Name("Alhambra Cohen");
System.out.println(name.initials());
System.out.println("Expected: null");
name = new Name("George H W Bush");
System.out.println(name.initials());
System.out.println("Expected: null");
name = new Name("John Jacob Jingleheimer Schmidt");
System.out.println(name.initials());
System.out.println("Expected: null");
name = new Name("Zorro");
System.out.println(name.initials());
System.out.println("Expected: null");
}
}In: Computer Science
Python
10 - (10 pts) - Implement a program that starts by asking the user to enter a userID (i.e., a string). The program then checks whether the id entered by the user is in the list of valid users.
The current user list is: ['joe', 'sue', jamal, 'sophie']
Depending on the outcome, an appropriate message should be printed. Regardless of the outcome, your function should print 'Done.' before terminating.
Here is an example of a successful login:
>>> Login: joe
Welcome back, joe
Done.
And here is one that is not:
>>> Login: john
Unknown users or passwords
Done.
11 â (10 pts) - Using Python, create a random password generator with length = 10 characters. The password should consist of upper- and lower-case letters and digits.
12 - (15 pts) - An acronym is a word formed by taking the first letters of the words in a phrase and then making a word from them. For example, RAM is an acronym for random access memory.
Write a function acronym() that takes a phrase (i.e., a string) as input and then returns the acronym for that phrase.
Note: The acronym should be all uppercase, even if the words in the phrase are not capitalized.
>>> acronym('Random access memory')
'RAM'
>>> acronym('central processing unit')
'CPU'
13 - (10 pts) â Using Python, write a segment of code to populate the table "employee" of the database "EmployeeDBâ with the data below. Import your choice of DB connector (import MySQLdb/sqlite3âŠ)
Create theâemployeeâ table with schema = [name, address, age]
Insert this employee: John Doe, 7001 E Williams Field, 32
14 - (20 pts) - Define a class called Animal that abstracts animals and supports three methods:
setSpecies(species): Sets the species of the animal object to species.
setLanguage(language): Sets the language of the animal object to language.
speak(): Prints a message from the animal as shown below.
The class must support supports a two, one, or no input argument constructor.
Then define Duck as a subclass of Animal and change the behavior of method speak() in class Duck.
>>> snoopy = Animal('dog', 'bark')
>>> snoopy.speak()
I am a dog and I bark.
>>> tweety = Animal('canary', âtweetâ)
>>> tweety.speak()
I am a canary and I tweet
>>> animal = Animal()
>>> animal.speak()
I am an animal and I make sounds.
>>> daffy = Duck()
>>> daffy.speak()
quack! quack! quack!
In: Computer Science
In the mid-1990s, Colgate-Palmolive developed a new toothpaste for the U.S. market, Colgate Total, with an antibacterial ingredient that was already being successfully sold overseas. At that time, the word antibacterial was not allowed for such products by the Food and Drug Administration (FDA). In response, the name âTotalâ was given to the product in the United States. The one word would convey that the toothpaste is the âtotalâ package of various benefits. Young & Rubicam developed several commercials illustrating Totalâs benefits and tested the commercials with focus groups. One commercial touting Totalâs long-lasting benefits was particularly successful. The product was launched in the United States in January of 1998 using commercials that were designed from the more successful ideas of the focus group tests. Suppose 32% of all people in the United States saw the Total commercials. Of those who saw the commercials, 40% purchased Total at least once in the first 10 months of its introduction. According to U.S. Census Bureau data, approximately 20% of all Americans were in the 45-64 age category. Suppose 24% of the consumers who purchased Total for the first time during the initial 10-month period were in the 45-64 age category. Within three months of the Total launch, Colgate-Palmolive grabbed the number one market share for toothpaste. Ten months later, 21% of all U.S. households had purchased Total for the first time. The commercials and the new product were considered a success. During the first 10 months of its introduction, 43% of those who initially tried Total purchased it again.
e. What percentage of people who did not see the commercials purchased Total at least once in the first 10 months of its introduction?
In: Statistics and Probability
Review information for The South African Motor Industry (The South African motor industry originally emerged through the assembly of knock-down kits of parts from abroad. Over the years, these developed into fully fledged manufacturers. This was largely due to the active industrial policies of the apartheid government (in power from 1948 to 1994), which aggressively promoted import substitution. Under apartheid, racial discrimination in the communities was mirrored by racial Fordism: blacks were largely condemned to poorly paid unskilled work. This led to many industries relying on cheap labor to solve systemically imposed inefficiencies.
In the 1970s, a wave of unionization of blacks took place, eclipsing the older, white- dominated trade unions. By the early 1980s, the new (âindependentâ) unions became increasingly outspoken in opposing the apartheid order. Mass resistance in communities was paralleled by an upsurge in strike action. In the Mercedes-Benz plant in East London, the resistance became so intense that large areas of the factory were rendered no-go areas for management. Finally a grouping of workers occupied the plant, damaging inventories and machinery.
The close of the apartheid era alleviated much of the underlying tension; at the same time, managers began to forge cooperative deals with unions. At Mercedes-Benz, these included very much better pay and working conditions, new opportunities for up-skilling and career advancement and a range of participative mechanisms, giving workers a real say in the process of production. Today, the plant is one of the most productive car plants in the world, and its products have the fewest defects of any Mercedes-Benz plant. While previously the plant was marginal, and by the late 1980s under threat of closure, today it is an integral part of the Mercedes-Benz worldwide production network.) case 3.1 then answer the following questions in accordance with the criteria below (Write 150 word minimum for each question, points will be deducted if each question does not meet the minimum 150-word required for each question):
1. Summarize the study
2. What lessons does the Mercedes-Benz East London plant hold for HR managers worldwide?
3. Is the experience of Mercedes-Benz in East London relevant to other industries.
4. If yes, please explain. If not, why not, please explain.
In: Operations Management
1.
Significant time and effort was/were spent on perfecting her cover letter.
Everyone in the accounting department was/were instructed on how to politely answer incoming calls.
The members of the Professional Committee is/are
disagreeing on how to allocate funds.
One of the male candidates failed to submit his/their cover letter.
2. Choose the sentence that is punctuated correctly.
A. Traditional job-search techniques, such as those described in your job handout, continue to be critical in landing jobs.
B. Traditional job-search techniques, such as those described in your job handout continue to be critical in landing jobs.
C. Traditional job-search techniques such as those described in your job handout continue to be critical in landing jobs.
3.
Choose the sentence that is punctuated correctly.
A. When customizing your résumé, make sure to include keywords that describe your skills, traits tasks and job titles associated with your targeted job.
B. When customizing your résumé, make sure to include keywords that describe your skills traits tasks and job titles associated with your targeted job.
C. When customizing your résumé, make sure to include keywords that
describe your skills, traits, tasks, and job titles associated with
your targeted job.
Choose the sentence that is punctuated correctly.
A. When you are organizing your qualifications, try to create as few headings as possible; more than six make the document look cluttered.
B. When you are organizing your qualifications, try to create as few headings as possible more than six make the document look cluttered.
C. When you are organizing your qualifications, try to create as few headings as possible, more than six make the document look cluttered.
4.
In the following sentences, select the correct word to fill in the blank.
When applying for a job, make sure all of your correspondence/corespondence is concise and professional.
Make sure to highlight any professional development/development you have obtained over your career.
Choose the sentence that uses the correct word.
A. I would like to express my interest in this position formally.
In: Psychology
Ex: int counter = 0;
is not allowed inside a class definition.
In: Computer Science