Create a project for this assignment. You can name it assignment02 if you wish. Download the database file pizza-190807A.sqlite into the top level of the project.
Create the pizza_services.py module first and put in the code given in the assignment. Using this code ensures that you can use the services in a similar way to the example.
The assignment suggests adding a method customer to the class. This will return a list of rows from the customer table in the database. Go ahead and write this method. It will look very much like the method customer_list from the example.
Now create a Python script part1.py, no need to be subtle here. Set up a with statement similar to the example script, but for pizza. Call the customer method and print out what it returns. This is not exactly what you want, but you should see all the customer data. You will also see what order columns are provided in each row.
Now, write a loop that steps through the rows of data and prints one line for each row. Use formatting with column widths to get the different columns to line up properly.
Ive got this far essentially i need to print data from the database in such that it is the last name fallowed by the first name and then the email address for every row. im not sure if im going in the right direction with my code and just need to know how to read and print the names and info from the table
pizza service.py
import sqlite3
class PizzaServices:
def __init__(self):
self.connection = sqlite3.connect("pizza-190807A.sqlite")
def __enter__(self):
return self
def __exit__(self, exe_type, exc_val, exl_tb):
crs = self.connection.cursor()
def do_query(self, query, parameters=None):
crs = self.connection.cursor()
if parameters:
crs.execute(query, parameters)
else:
crs.execute(query)
return crs.fetchall()
def customer(self):
return self.do_query("select * from customer")
part1.py
from pizza_services import PizzaServices
with PizzaServices() as cs:
cust = cs.customer()
cmd1 = "select FirstName, LastName, Email from customer"
cs.do_query(cmd1)
templateH = "{:15} {:15} {:15}"
line = templateH.format("Last Name", "First Name", "email")
print(line)
for customer_row in cs: //customer_row gives me errors for being not iterable
//not sure what goes in here
In: Computer Science
The TOPCAR taxi company is developing a new computer system to be used to support taxi booking and corporate client credit accounts. This computer system aims to automate some manual processes and cut down on labour costs as TOPCAR has many customers from large corporate companies, e.g. CEO, and managers often need taxi trips to the airport. The following describes the activities that must be processed by the computer system:
A client company must first register and open a credit account with TOPCAR at TOPCAR’s website, in which case certain credit checks are made such as checking credit history of client company’s debt level. If the client company has no bad debt history, a credit account for the client company is set up.
At least 24 hours after successful account registration, authorized persons from such client company can request a taxi booking form TOPCAR’s website. When this happens, the availability of a taxi at the requested date and time is checked, as is the credit status of the client company checked. (Note that credit status in finance means a measure of a lender’s willingness to lend money to a particular person or organization, depending on their ability to repay).
If these two checks are successful, a booking is made, and a written confirmation is sent via SMS and emailed to client company. After the customer from the client company has used the taxi, the driver sends in a record of the work, including the cost, and this is added to client company’s account. (Note that driver is an outsourced worker from TOPCAR’s point of view.) At the end of each month, taxi bills are sent via SMS and emailed to client companies for settlement.
From the above description, draw a data flow diagram showing the flow of input information (and/or data) and output information (and/or data) to and from processes and database stores within this computer system and any external environmental elements that interact with this computer system. In this diagram, you must identify the following:
in (a) (5.5 marks)
(Hint: there are two environmental elements that interact with this computer system, and six main processes in this computer system)
In: Computer Science
As part of a course project, a statistics student surveyed random samples of 50 student athletes and 50 student non-athletes at his university, with the goal of comparing the heights of the two groups. His summary statistics are displayed in the provided table.
|
n |
s |
||
|
Athletes |
50 |
68.96 |
4.25 |
|
Non-athletes |
50 |
67.28 |
3.46 |
a). Which data analysis method is more appropriate in this situation: paired data difference in means or difference in means with two separate groups? Explain briefly.
b). Construct a 99% confidence interval for the difference in
mean heights between student athletes and non-athletes at this
university. Use two decimal places in your margin of
error.
c). Test, at the 5% level, if student athletes at this university are significantly taller, on average, than student non-athletes. Include all of the details.
In: Statistics and Probability
How do financial accounting and management accounting differ?
A. Financial accounting focuses on providing financial information to users inside and outside the business whereas management accounting focuses on providing financial and non financial information to users inside the business
B. Financial accounting focuses on providing non financial information to users outside the business whereas management accounting focuses on providing financial information to users inside the business
C. Financial accounting focuses on providing non financial information to users inside the business whereas management accounting focuses on providing nonfinancial information to users inside and outside of the business
D. Financial accounting focuses on providing financial and non financial information to users inside the business whereas management accounting focuses on providing financial information to users outside the business
In: Accounting
An internal study by the Technology Services department at Lahey Electronics revealed company employees receive an average of 3.5 non-work-related e-mails per hour. Assume the arrival of these e-mails is approximated by the Poisson distribution.
A. What is the probability Linda Lahey, company president, received exactly 4 non-work-related e-mails between 4 P.M. and 5 P.M. yesterday? (Round your probability to 4 decimal places.)
B. What is the probability she received 6 or more non-work-related e-mails during the same period? (Round your probability to 4 decimal places.)
C. What is the probability she received four or less non-work-related e-mails during the period? (Round your probability to 4 decimal places.)
In: Statistics and Probability
I'm a resident in Australia and after singing an agreement with my company In Australia, to work for a company in France, and my company provided me with a house to stay for the two years im working there as a employment package.
Will I be considered an Australian resident or a non-resident, for tax purposes while working in France?
Would the leased house that has been provided by my company as an employment package make me a non Australian resident for tax purposes or would I still be considered an Australian resident for tax purposes.
Also note that I have no intention to live in the overseas country.
I know that if I leased a house oversea I would be considered a non resident in Australia but What if my company provided me with a house? Would I be deemed as a non resident In Australia?
In: Accounting
Super Man is a trading company with financial year ending every 31 December. The company is preparing their financial statements for the year ending 31 December 2018 and the following is Super Man’s Trial Balance as at that date.
Super Man Trial Balance as at 31 December 2018 ('000)
Property, plant and equipment 65,520 (DEBIT)
Accumulated depreciation 7,520 (CREDIT)
Intangible asset 3,780 (DEBIT)
Inventories – 1 January 2018 81,970 (DEBIT)
Other Short-term Investments 2,760 (DEBIT)
Trade Receivables 66,320 (DEBIT)
Cash and cash equivalents 34,650 (DEBIT)
Share capital 40,050 (CREDIT)
Retained earnings – 1 January 2018 82,332 (CREDIT)
Long-term loans 33,090 (CREDIT)
Short-term borrowings 46,090 (CREDIT)
Trade payables 51,310 (CREDIT)
Revenue 331,080 (CREDIT)
Allowance for doubtful debt 50 (CREDIT)
Purchase 229,472 (DEBIT)
Administrative expenses 34,360 (DEBIT)
Distribution expenses 64,350 (DEBIT)
Finance cost 3,630 (DEBIT)
Taxation expense 1,540 (DEBIT)
Rental income 3,170 (DEBIT)
TOTAL DEBIT: 591,522
TOTAL CREDIT: 591,522
Additional information:
a. Depreciation for the financial year ending 31 December 2018 for property, plant and equipment have been charged and included in the accumulated depreciation account in the trial balance.
b. The company received a grant worth RM6,000 on 15 December 2018. It was an incentive by the government for retraining a group of its employees. The three-month training started in December 2018 has a cost of RM10,000 a month. None of the transactions related to the above has been recorded.
c. Included in the long-term loans is a loan worth RM4,000,000 at 5% annual interest, granted by a local bank on 1 August 2018, for five-year period. Installment for the month of December 2018 has not been paid yet and the related interest for the installment was RM15,200. None of the transactions related to the above has been recorded.
d. The intangible asset was capitalized from the cost of research and development made by the company between 2016 and 2017, recognized in December 2017. The asset that resulted from the research and development process will last for 60 years and it is the company’s policy to amortize the intangible assets over 10 years. No record has been made in relation to the amortization for the financial year 2018.
e. The company is in the middle of a court case with Kinoyu Berhad. The company refused to accept a batch of goods delivered to it in January 2018 due to its misspecification. Consequently, Kinoyu Berhad is suing the company in August 2018 and asking for a compensation of RM3,000,000 for breaking their trade contract. At the end of December 2018, the lawyers that represent Super Man gives a 50-50 percent chance to win.
f. Stocktake as at 31 December 2018 revealed inventory cost amount of RM80,600,000. However, one batch of the inventory was damaged and need to be repackaged. The cost of repackaging was RM5,000 to enable it to be sold at RM110,000. The cost for the batch was RM100,000.
Question:
Show the necessary adjusting journal entries for the additional information above.
In: Accounting
P3-1. Calculating Ratios Below are the financial statements for Mowing and Maintenance, Inc.
Paul’s Plowing, Inc. Balance Sheet as of December 31, 2018 and 2017 (in millions of dollars)
Assets 2018 2017
Cash and marketable
securities $ 140 $ 120
Accounts receivable $240 $230
Inventory $ 500 $425
Total Current Assets $ 880 $ 775
Total assets $2,200 $1,850
Liabilities & Equity 2018 2017
Current liabilities:
Accrued wages and taxes $ 80 $ 90
Accounts payable $ 130 $ 120
Notes payable $240 $210
Total Current Liabilities $ 450 $ 420
Long-term debt: $ 900 $ 750
Fixed assets:
Gross plant and equipment $1,180 $1,005
Less: Depreciation $160 $ 150
Net plant and equipment $1,020 $ 855
Other long-term assets $ 300 $ 220
Total Fixed Assets $1,320 $1,075
Stockholders’ equity:
Preferred stock (5 million shares) $ 10 $ 10
Common stock and paid-in surplus (10 million shares) $200 $ 200
Retained earnings $640 $470
Total Equity $ 850 $ 680
Total liabilities and equity $2,200 $ 1,850
Paul’s Plowing, Inc.
Income Statement for Years Ending December 31, 2018 and 2017
(in millions of dollars)
2018 2017
Net sales (all credit) $ 920 $762
Less: Cost of goods sold $410 $325
Gross profits $510 $437
Less: Depreciation $14 $10
Other operating expenses $30 $25
Earnings before interest and taxes (EBIT) $466 $402
Less: Interest $96 $82
Earnings before taxes (EBT) $370 $320
Less: Taxes $148 $128
Per (common) share data:
|
Earnings per share (EPS) |
$22.00 |
$19.00 |
|
Dividends per share (DPS) |
$2.00 |
$2.00 |
|
Book value per share (BVPS) |
$ 220.00 |
$185.00 |
|
Market value (price) per share (MVPS) |
$275.00 |
$237.50 |
e. Fixed asset turnover 2018: 1.25 times
2017: 1.25 times
|
Net income
|
$ 222 |
$ 192 |
|
|
Less: Preferred stock dividends |
$ 2 |
$ 2 |
|
|
Net income available to common stockholders |
$ 220 |
$ 190 |
|
|
Less: Common stock dividends |
20 |
20 |
|
|
Addition to retained earnings |
$ 200 |
$ 170 |
|
f. Total asset turnover 2018: 0.85 times
2017: 0.85 times
g. Debt ratio 2018: 62.5%
2017: 62.5%
h. Times interest earned 2018: 8.50 times
2017: 8.50 times
i. Profit margin 2018: 28.75%
2017: 28.75%
j. ROA 2018: 19.75%
2017: 19.75%
k. ROE 2018: 36.88%
2017: 36.88%
l. Market-to-book ratio 2018: 2.55 times
2017: 2.55 times
m. PE ratio 2018: 15.60 times
2017: 15.60 times
In: Finance
Question 1 BANK RECONCILIATION
The information given below was extracted from the accounting records of Mika Stores.
Required
1.1 Complete the Cash Receipts Journal and Cash payments Journal of Mika Stores for March 2018 after taking the information provided into account. Use only the columns illustrated below. In the details column write down the name of the contra account e.g Rent income. (11)
Cash Receipts Journal
|
Details |
Bank |
|
|
Total |
b/f |
|
Cash Payments Journal
|
Debit |
Credit |
|
|
Total |
b/f |
|
1.2 Post to the Bank account in the General ledger of Mika stores. Balance the account. (3)
Mika Stores
1.3 Prepare the Bank Reconciliation Statement as at 31 March 2018. Use the following format:
INFORMATION
|
1 |
The bank colum of each of the cash journals showed the following totals before the March 2018 bank statement was received |
|
|
Cash Receipts Journal |
300 000 |
|
|
Cash Payments Journal |
350 000 |
|
|
2 |
A comparison of the cash journals of Mika Stores for March 2018 and the Bank Reconciliation Statement for February 2018 with the bank statement form Key Bank for March 2018 revealed the following differences: |
|
|
2.1 |
Entries that appeared on the bank statement but not in the cash journals: |
R |
|
2.1.1 |
A cheque previously received from the lessee for rent was dishonoured because of insufficient funds. |
6800 |
|
2.1.2 |
A debit order in favour of Telkom for the personal telephone account of the proprietor. |
3800 |
|
2.1.3 |
Charges levied by Key Bank: |
|
|
Service fees |
1500 |
|
|
Cash deposit fee |
1000 |
|
|
Interest on overdraft |
100 |
|
|
2.1.4 |
A deposit by a debtor to settle his account of R6200 |
6000 |
|
2.1.5 |
A deposit by Key Bank for a successful loan application |
50 000 |
|
2.2 |
Entries in the cash journals that did not appear in the bank statement: |
R |
|
2.2.1 |
A deposit made on 31 March 2018 |
102 400 |
|
2.2.2 |
The following cheque issues during March 2018: |
|
|
Cheque no. 520 |
8700 |
|
3 |
Additional information |
R |
|
3.1 |
Cheque no. 490 (dated 23 February 2018) which appeared in the Bank Reconciliation Statement for February 2018 did not appear in the bank statement for March 2018 |
16140 |
|
3.2 |
Cheque no.460 issues to Rix Soccer Club during January 2018 as a donation must be cancelled as the cliub no longer exists. |
4800 |
|
3.3 |
A deposit made by Rika Stores as erroneously reflected on the bank statement of Mika Stores. |
4000 |
|
3.4 |
An entry was made in the Cash Payments Journal for a cheque to a creditor MS Suppliers for R10 000. The bank statement reflected the correct amount of the cheque, R11 000. |
|
|
3.5 |
The bank account in the ledger of Mika Stores reflected a debit balance on 01 March 2018. |
38800 |
|
3.6 |
The bank statement showed an unfavorable balance on 31 March 2018. |
In: Accounting
The following data was collected from 1 bag of Hershey Kisses®. Each Kiss® was weighed (in grams) and recorded in the table below. Hershey claims that there is 368 grams of chocolate in one bag.
| 4.76 | 4.72 | 4.74 | 4.55 | 4.91 | 4.74 | 4.78 | 4.71 | 4.8 |
| 4.78 | 4.78 | 4.75 | 4.79 | 4.82 | 4.91 | 4.83 | 4.68 | 4.74 |
| 4.7 | 4.8 | 4.7 | 4.76 | 4.7 | 4.83 | 4.93 | 4.74 | 4.84 |
| 4.82 | 4.78 | 4.77 | 4.72 | 4.78 | 4.83 | 4.75 | 4.74 | 4.68 |
| 4.84 | 4.71 | 4.71 | 4.76 | 4.66 | 4.78 | 4.73 | 4.74 | 4.92 |
| 4.77 | 4.8 | 4.79 | 4.86 | 4.64 | 4.78 | 4.7 | 4.75 | 4.78 |
| 4.76 | 4.83 | 4.66 | 4.77 | 4.83 | 4.78 | 4.69 | 4.81 | 4.68 |
| 4.78 | 4.88 | 4.72 | 4.85 | 4.85 | 4.81 | 4.74 | 4.8 | 4.82 |
| 4.84 | 4.7 | 4.85 | 4.7 | 4.81 | 4.72 | 4.79 | 4.63 |
To help you answer the questions below use your scientific calculator. Your scientific calculator is capable of doing calculations on entire data sets by first entering the data and then pressing combinations of keys to find the average and standard deviation etc... You should check with your calculator manual to see how this special data handling feature works. Let the instructor know if you have any questions. You will need to learn how to do this for testing purposes. Note: Instructions for several brands of calculators in included in the folder Course Overview/Excel & Calculator Instructions.
1. What is the Mean and Median? (you may want to use your calculator!)
2. In general, each Kiss® is approximately how many grams? Explain what measure you used and why.
3. What is the Range? Are you surprised at this? Why or why not?
4. What could be some reasons for variation in the weights of the Kisses®? NOTE: Take time answering this one. There are lots of thingsto consider here and I'll be looking for a well thought out answer with several given reasons contributing to the variation. Of course, the wrappers and tags could vary but what about the drops of chocolate themselves? Why aren't they all the same?
5. Would you say that there are any two Kisses that could have exactly the same weight? (I mean exactly the same weight!)
6. How many Kisses® were there in the bag?
7. Based on Hersheys® claim for 368 total net grams of chocolate in the bag, approximately how many Kisses® too many or too few are there? Give some possible explanations for this difference.
8. EXCEL: Click on and print out one of the following: Excel Descriptive Statistics 2016/2013 to see how to enter the Kiss data into a worksheet and obtain a list of descriptive statistics and a histogram with no more than 12 classes. Also, make sure to sort your data using the Sort command under Data on the menu bar. Submit your Excel file to the Lab1 Part 1 Dropbox.
9. Standard Deviation & Empirical Rule:
Variation is a big factor in the analysis of most any data set and
it will be very important to have a way of measuring it.
Standard Deviation is one such measure that you
will study and learn to calculate in an upcoming section. For now,
find the Standard Deviation number on your
Descriptive Statistics read-out from Excel. There is a rule for
"mound-shaped" distributions that can help you have some feeling
for what this standard deviation number is telling you. It's called
the Empirical Rule and is stated below:
For any data set having a bell-shaped (or mound-shaped)
distribution the following are true:
- Approximately 68% of the data values will be within one
standard deviation of the mean.
- Approximately 95% of the data values will be within two standard
deviation of the mean.
- Almost all of the data values will be within three standard
deviation of the mean.
Use the standard deviation value given in Excel and the Empirical
Rule (stated above) to find answers to the following:
a) Find the percentage of all the Kisses in the
bag that fell within 1 standard deviation of the mean? ... within
2?, … within 3?
(Show how you calculated these percentages!)
b) How close is the Empirical Rule in predicting
the percentages that you calculated above?
c) If your calculated percentages did not line up
with the percentages claimed by the Empirical Rule, speculate on
some possible reasons for this.
10. How might standard deviation and the shape of the distribution indicate how consistent Hershey® is in the manufacturing of their Kisses®?
In: Statistics and Probability