Questions
1. Adhere to the naming conventions discussed in class for variable names, program names, and function...

1. Adhere to the naming conventions discussed in class for variable names, program names, and function names

2. Use meaningful names for variables

3. Follow the coding standards and homework submission rules as covered in class.

4. If there are more than one word in the variable use all lowercase and separate them with underscores, e.g., first_name, shipping_cost.

5. Include appropriate comments in the code, but not too many.

6. Output should be displayed exactly as shown for each problem below. The output given is sample output. Other numbers/input could be entered.

7. If your program does not compile, you will not receive more than 20% of the maximum points.

8. If your program compiles but does not execute, you will not receive more than 35% of the maximum points.

9. If your program compiles and executes yet does not give the required output, you will not receive more than 50% of the maximum points.

10. The programs will be in one file named hw3.py. The module will be in one file named number_functions.py. Zip hw3.py and number_functions.py into file hw3.zip and upload to Canvas. Only .zip files will be accepted. If the file is not named correctly, 10 points will be deducted.

11. Each program will be separated by a comment with the problem number. If this format is not followed, 10 points will be deducted.

12. Your name will be a comment at the top of the file. If your name is not in the file as a comment, 10 points will be deducted.

13. If you use Python constructs on assignments that we have not yet discussed in class, 20 points will be deducted.

14. If you do not adhere to our coding standards, 20 points will be deducted.

#Problem 2

Write function write_stock that asks the user to input a company name, its associated ticker symbol (eg. Exxon, XOM), and the price per share of the stock. These are then written to file stock.txt one item per line. The user will type in ‘quit’ to stop.

Write function get_share_value that accepts a company name and the number of shares. The function will search file stock.txt and return a list of two values; the ticker symbol and the total value of the shares. This function must use an exception handler to insure the file is valid, that the price can be converted to a number, and catch any other exception that might be raised.

Write a program that calls write_stock and get_share_value. The program will ask the user for the company name and number of shares for read_stock and print the answer.

Sample output might look as follows.

Enter company name; enter quit to stop: Amazon

Enter ticker symbol: amzn

Enter price: 1000

Enter company name; enter quit to stop: Apple

Enter ticker symbol: aapl

Enter price: 125

Enter company name; enter quit to stop: Microsoft

Enter ticker symbol: msft

Enter price: 250

Enter company name; enter quit to stop: quit

What stock did you buy?: Apple

How many shares?: 10

Your total value for aapl is $1250.00

#Problem 3

Write function determine_ sums that accepts a list of values. The function will return a list of two numbers; the first is the sum of the positive numbers and the second is the sum of the negative numbers.

Write a program that defines a list as [1, 5, 7, -2, 6, -8, 10, -4, -20] and calls determine_sums. The program will print the output. Assume the company name will start with a capital letter and the ticker symbol will be all lowercase. This will give the following output.

[29, -34]

There is no user input on this problem.

#Problem 4

Write function write_students that asks the user for student records and writes them to file students.txt. A record of a student includes name, major and GPA. The user can enter as many records as they want until they type in quit.

Write function read_students that accepts a major. The function returns the highest GPA for that major.

Write a program that calls write_students and read_students and prints the major and highest GPA. The program will ask the user for the major for which to search. Assume all names and majors will be lower case.

Sample input/output might look as follows:

Enter student name; enter quit to stop: jones

Enter major: insy

Enter gpa: 2.0

Enter student name; enter quit to stop: smith

Enter major: insy

Enter gpa: 3.25

Enter student name; enter quit to stop: willis

Enter major: mana

Enter gpa: 3.25

Enter student name; enter quit to stop: quit

Enter major: insy

The highest GPA for insy majors is 3.25

#Problem 5

Write module number_functions that includes:

Function write_numbers that writes 50 random numbers between 1 and 15 to file numbers.txt.

Function read_numbers that reads the file numbers.txt and returns a list of the numbers.

Write function count_numbers that accepts the list of numbers and returns how many numbers are in the list.

Function find_even_odd that accepts the list of numbers and returns a list of two numbers; how many odd numbers are in the list and how many even numbers are in the list.

Write a program that calls these functions in the order above and prints the returned data.

Sample output might be the following. But yours may vary as we are generating random numbers. The count will always be 50, but you need to code the function as if you do not know that.

['12', '8', '3', '18', '1', '5', '3', '18', '6', '10', '20', '8', '7', '4', '17', '16', '8', '11', '14', '3', '13', '13', '5', '17', '11', '9', '16', '19', '13', '18', '6', '1', '9', '19', '5', '14', '13', '15', '10', '12', '20', '16', '14', '5', '10', '20', '17', '11', '18', '3']

50

[26, 24]

In: Computer Science

Mechanical engineers have investigated the performance of the males in assembling   aircraft hydraulic systems compared to...

  1. Mechanical engineers have investigated the performance of the males in assembling   aircraft hydraulic systems compared to females technicians. Random samples of 7 males and 7 females technicians were chosen to assemble similar hydraulic systems. The following table shows the data in minutes.

Males

7

21

27

18

20

24

16

Females

8

18

24

19

16

19

16

  1. At the 5% significance level, can you conclude that males’ performance is higher than that of the females?
  2. Construct a 95% confidence interval for the difference of the two means.

In: Statistics and Probability

1a. What is the largest negative number that you could represent with 7 bits using signed...

1a. What is the largest negative number that you could represent with 7 bits using signed magnitude? Show your work.

1b. What is the largest positive number that you could represent with 7 bits using 2’s complement? Show your work.

1c. Add the following two binary numbers 10110111 + 1011 = :Show your work.

1d. Solve the following decimal notation equation using 8-bit binary numbers and 2’s complement notation: 69 - 7 = :Show your work

In: Computer Science

You are a wealth management analyst, and your first job is to make investment recommendations to...

You are a wealth management analyst, and your first job is to make investment recommendations to a client.

After extensive research, you have narrowed down to the following two companies: XiG, pronounced as “eleven groceries”, is a grocery store chain operated in the U.S, with major competitor such as convenience store Seven-Eleven. XiG has very stable consumer base and its business is not very sensitive to the business cycle of the general economy.

TanW, acronym for Tan-my- way, is a beauty salon chain with a focus on tanning services. Its business is quite affected by the business cycle since people tend not to splurge on expensive non-necessities such as tanning spas.

Your client’s current portfolio has an expected return of 6% per year. Based on some economic models, you are confident to simplify the analysis as follows: Suppose there are five possible states of the economy each with equal probability. Here is a table of the returns (unit: %) corresponding to each state. This table facilitates your recommendation decisions:

States of Economy

XiG

TanW

Current

1

6

9

8

2

3

2

2

3

3

6

7

4

4

3

3

5

5

1

1

Which firm has a higher expected return and Which firm is riskier?

In: Finance

In Lima one worker can produce either 20 bushels of corn of 5 pounds of tomatoes...

In Lima one worker can produce either 20 bushels of corn of 5 pounds of tomatoes in one day. In Puma one worker can produce either 53 bushels of corn or 7 pounds of tomatoes in one day. The country that specializes in tomato production is willing to sell one pound of tomatoes for at least how many bushels of corn? Round to two decimal places.

In: Economics

A large supermarket carries four qualities of ground beef. Customers are believed to purchase these four...

A large supermarket carries four qualities of ground beef. Customers are believed to purchase these four varieties with probabilities of 0.13, 0.27, 0.14, and 0.46, respectively, from the least to most expensive variety. A sample of 480 purchases resulted in sales of 48, 148, 74, and 210 of the respective qualities. Does this sample contradict the expected proportions? Use α = 0.05.

(a) Find the test statistic. (Round your answer to two decimal places.)


(ii) Find the p-value. (Round your answer to four decimal places.)

A program for generating random numbers on a computer is to be tested. The program is instructed to generate 100 single-digit integers between 0 and 9. The frequencies of the observed integers were as follows. At the 0.05 level of significance, is there sufficient reason to believe that the integers are not being generated uniformly?

Integer 0 1 2 3 4 5 6 7 8 9
Frequency 10 8 6 8 13 10 7 11 14 13

(a) Find the test statistic. (Round your answer to two decimal places.)


(ii) Find the p-value. (Round your answer to four decimal places.)

In: Statistics and Probability

Journalize debt investment transactions, accrue interest, and record sale. Frunt Company purchased 130 Pine Company 7%,...

Journalize debt investment transactions, accrue interest, and record sale.
Frunt Company purchased 130 Pine Company 7%, 10-year, $1,000 bonds on January 1, 2017, for $136,000. The bonds pay interest annually on January 1. On January 1, 2018, after receipt of interest, Frunt Company sold 95 of the bonds for $92,000.

Prepare the journal entries to record the transactions described above.

I don't understand the question..what method?

In: Accounting

8) Our company did a stock dividend. Dave says there is no effect on our comprehensive...

8) Our company did a stock dividend. Dave says there is no effect on our comprehensive stockholders' equity at all. Barbara disagrees and says it does have an effect on equity but isn't sure exactly what. She just knows there is an impact. Verna has absolutely no clue on this one. So she just cannot decide who's right and is completely lost.

  • Exactly what effect(s) would there be on the comprehensive stockholders' equity? Make sure you explain why.

In: Accounting

Scenario: Prior to Opening, Part I: You plan to open a pet-services business that will offer...

Scenario: Prior to Opening, Part I: You plan to open a pet-services business that will offer dog grooming, day care, and boarding. You can be creative in deciding the name of your business (e.g., “Inspiring Dog Care”), its geographical location (e.g., Chicago), and its mission and vision for adding value to the community. You will be asked to make choices for a few other details to customize your case; otherwise, you should use the information below.

There are 12 kennels (single dog only) and the day care area can house 10 large dogs and 12 small dogs each day. The grooming facility is 200 square feet, the boarding facility is 2,500 square feet, and the day care is 1,500 square feet. Your groomer can groom five dogs a day for five days a week; each groom consists of 1.5 labor hours. You also offer dog day care six days a week, and kenneling every day. You have taken out a loan for start-up costs and the monthly payment is $420; it goes into effect immediately and should be accounted for in your costs. With limited cash contribution and loan funding, you located two angel investors. You will collect a modest draw for the first year of $600 a month; remember to divide evenly among the services.

Note: For simplicity, base all calculations using 30 days in each month. You have hired the following people:

A groomer, Allison, who will be paid $12/hour and work 40 hours a week

A day care attendant, Beverly, who will be paid $9/hour and will work based on need

A receptionist, Cathie, who will be paid $8.50/hour and work 30 hours a week

A kennel attendant, Ben, who will be paid $11.50/hour and will work based on need

A complete list of additional costs is provided below:

Food and water bowls: $3.59/unit
o Daycare: Two bowls last for every 75 dogs that attend daycare.
o Boarding: Two bowls last for every 100 dogs that are boarded; you need two bowls per kennel. o Grooming: Each bowl lasts for 20 grooms and you need four bowls at all times.

Fencing for daycare area: $1,249; installation of fencing: $1,000

Dog grooming arm: $300

12 kennels: $9,500; depreciation is $80/month

Rent: $650/month; allocate based on square footage

Utilities/insurance: $600/month; allocate based on square footage

Grooming table: $900

Grooming tub: $2800

Heating system: $10,000; depreciation is $83/month; allocate based on square footage

Clippers: $136.99; can be used for 100 grooms

Shampoo: $103.96 per five-gallon pail, which can be used for 100 grooms

Cage bank: $2200 per set of 5

Salon Tuff Capri mobile carry cart: $90

Towels: $34.99 per 12 pack

o Day care: You need to have 12 towels for every 25 dogs.
o Boarding: You need to have 12 towels for every 40 dogs.
o Grooming: You need to have two towels for every groom per day.

Scissors: (1) 7-inch straight is $194.99, and (1) ear-and-nose is $7.49; each can be used for 200 grooms.

Toys: $3.29 per 6-pack; one toy will last for two dogs in day care, per day.

Cleaning products:

o Odoban: $14.55/gallon: Each area will dilute 1 oz to 1 gallon of water; allocate based on square footage.

o Simple Green: $15.66/gallon: each area will dilute 1 oz to 1 gallon of water; allocate based on square footage.

Dryer: $1250

Rubberized flooring for day care: $3800

Problem:

Determine your per-unit cost per dog in the “Variable_Fixed”

In: Accounting

The following data give the ages (in years) of all six members of a family 8...

The following data give the ages (in years) of all six members of a family 8 10 12 50 55 69

a. List all the possible sample of size two (without replacement) that can be selected from this population. Calculate the mean for each of these samples. Write the sampling distribution of sample mean.

b. Compare the mean of a population probability distribution with that of a sampling distribution.

c. Compare the dispersion in the population with that of the sample means.

In: Math