Programming Assignment 5
Your work on the last project, the inventory ordering system, was so well received that your boss has asked you to write a new program for the firm. She mentions that she’s heard a lot about “Object Oriented Programming” and wants you to create a database of part’s suppliers that the company will use to source new inventory from. She mentions that there have been a lot of new entrants into the market and its important that you source the new widgets and sprockets at the best cost possible! From speaking with her you realize that you’ll need three new class definitions – a class that models a supplier, a class that represents a part, and class that will contain information about all these suppliers.
The parts class will need to contain the following information:
1. Part name
2. Part cost
The parts class will need to contain the following methods:
1. An init method that lets the user set the name and cost of the part
The supplier class will need to contain the following information:
1. The company name
2. A list of the parts the company supplies
The supplier class will need the following methods:
1. An init method to set the company name
2. A method that lets the user add a part to the list of parts a company supplies
3. A method that takes a part argument and returns the cost of that part.
4. A method that takes a part argument and returns a Boolean if the part is supplied by the company (True if it does, False if it does not).
The database class will need the following data:
1. A list of suppliers
The database class will need the following methods:
1. An init method to initialize the database
2. A method to add a supplier
3. A method to find the lowest cost for a part. The input will be a part name, and the output will be two values: the name of the supplier, and the cost. If the part is not sold by any suppliers, return False, False. Unlike in other programs – you do not need to write the code for user input, input validation, or output – you need only to write the classes! The company has supplied the program to load in the data and get the data from the classes, you need only to define the classes (and test with the supplied program of course)!
Sample Input/Output
Enter supplier name, or quit to exit: World Parts, Inc
Part info should be entered in the following format: name, price
Enter part info, or quit to exit: gizmo, 1.99
Enter part info, or quit to exit: sprocket, 3.12
Enter part info, or quit to exit: quit
Enter supplier name, or quit to exit: ABC Manufacturing
Part info should be entered in the following format: name, price
Enter part info, or quit to exit: sprocket, 3.09
Enter part info, or quit to exit: gizmo, 2.34
Enter part info, or quit to exit: dodad, 13.99
Enter part info, or quit to exit: quit
Enter supplier name, or quit to exit: quit
Supplier database complete!
Please enter in a part name or quit to exit: gizmo
Part gizmo is available for the best price at World Parts, Inc. Price: $1.99
Please enter in a part name or quit to exit: sprocket
Part sprocket is available for the best price at ABC Manufacturing. Price: $3.09
Please enter in a part name or quit to exit: dodad
Part dodad is available for the best price at ABC Manufacturing. Price: $13.99
Please enter in a part name or quit to exit: quit T
hank you for using the price database!
Additional requirements
1. You MUST use modules, you need to write your 3 classes in 3 separate Python files named database.py, part.py and supplier.py
2. Do NOT modify the supplied Python code – I will test your files with my own Python code – if you have to change the provided Python code to get your classes to work, you’ll lose points.
3. Submit only the 3 python files – part.py, supplier.py and database.py
4. Each Python file must have a program header!
Tips
1. The provided code does all the input/output for this program. You only need to write the code for the 3 classes.
2. Some of the methods for the 3 classes need to be of a specific format or the supplied program will not work – these are the init methods for Suppler and Database, and add_part, add_supplier, and find_part. Make sure you have those methods defined in your program and that their signature matches what the provided code expects.
3. Write the classes from simple to more complex – start with Part, then Supplier, then Database.
The following is a sample code
import database
import supplier
import part
supplier_database = database.Database()
while True:
data = input("Enter supplier name, or quit to exit: ")
if data == "quit":
break
s = supplier.Supplier(data)
print("Part info should be entered in the following format: name, price")
while True:
part_info = input("Enter part info, or quit to exit: ")
if part_info == "quit":
print()
break
try:
name, price = part_info.split(",")
price = float(price)
except:
print("Error input - Part info should be entered in the following format: name, price - please try again")
continue
s.add_part(name, price)
supplier_database.add_supplier(s)
print("\n\nSupplier database complete!\n")
while True:
data = input("Please enter in a part name or quit to exit: ")
if data == "quit":
break
supplier, price = supplier_database.find_part(data)
if supplier == False:
print("Error part does not exist in database")
else:
print(f"Part {data} is available for the best price at {supplier}. Price: ${price:.2f}")
print("\nThank you for using the price database!")
In: Computer Science
CASE STUDY Solve the case based on the following information: The comparative statements of financial position for Cactus Ltd, which is a merchandising business selling indoor plants, follows.
Cactus Ltd Comparative Statement of Financial Position As at 31 December 2019 and 2018
|
2019 |
2018 |
||
|
Assets |
€ |
€ |
|
|
Current assets: |
|||
|
Cash |
195 800 |
15 000 |
|
|
Trade receivables |
58 400 |
72 000 |
|
|
Inventory |
59 800 |
53 000 |
|
|
Prepayments |
2 300 |
5 000 |
|
|
Total current assets: |
316 300 |
145 000 |
|
|
Non-current assets: |
|||
|
Land |
65 500 |
90 000 |
|
|
Buildings and equipment |
156 000 |
90 000 |
|
|
Less Accum. depreciation |
(54 100) 101 900 |
(40 000) 50 000 |
|
|
Total property, plant and equipment |
167 400 |
140 000 |
|
|
Long-term investments |
0 |
36 400 |
|
|
Total non-current assets |
167 400 |
176 400 |
|
|
Total assets |
483 700 |
321 400 |
|
Liabilities and equity |
2019 |
2018 |
|
Current liabilities: |
||
|
Trade payables |
49 400 |
28 000 |
|
Salary payable |
20 000 |
18 500 |
|
Accruals |
18 700 |
22 200 |
|
Total current liabilities |
88 100 |
68 700 |
|
Non-current liabilities |
||
|
Long-term notes payable |
85 000 |
65 000 |
|
Bank loan payable |
22 600 |
0 |
|
Total non-current liabilities |
107 600 |
65 000 |
|
Total liabilities |
195 700 |
133 700 |
|
Equity: |
||
|
Ordinary share capital |
150 000 |
100 000 |
|
Share premium |
75 000 |
0 |
|
Retained profits |
63 000 |
87 700 |
|
Total equity |
288 000 |
187 700 |
|
Total liabilities and equity |
483 700 |
321 400 |
The following data is also available for Cactus Ltd for the year ended 31 December 2019
€
Cost of sales 56,500
Depreciation expense 14,100
Other operating expenses 17,700
Loss on sale of investments 1,400
Gain on sale of land 7,200
Sales revenue 97,300
Interest revenue 4,100
Dividend revenue 3,600
Salary expense 24,000
Interest expense 5,900
Insurance expense 2,300
It is known in addition that:
• A building was purchased for €46,000 and paid for immediately.
• Equipment was purchased by signing a note payable for €20,000.
• A plot of land was sold, no new plots of land were purchased.
• Ordinary shares have the nominal value of €1 per share
Required:
1. Prepare the classified statement of profit or loss (i.e. show also gross profit and operating profit) for Cactus Ltd for the year ended 31 December 2019.
2. Find answers to the following questions: a) Did Cactus Ltd issue any new shares during 2019? If yes, how many shares were issued and how much did the share issue raise? b) Did Cactus Ltd take out any loans in 2019 (in addition to the note payable for the purchase of equipment)? c) Were any dividends paid? If yes, how much? d) How much cash was received from the sale of land? e) How much cash was received from the sale of investments?
3. Prepare the statement of cash flows for Cactus Ltd for the year ended 31 December 2019 in the indirect method.
4. Write your comments on the following aspects for Cactus Ltd. based on its performance in the year ended 31 December 2019: a) Bring out the main factors that have affected the profit or loss differently from the cash flows. b) Is the cash generated from operations sufficient to cover interest and dividends that have been paid? c) How were the investments in non-current assets financed? d) Calculate the level of gearing as at 31 December 2019 and as at 31 December 2018. Comment on how risky you consider the capital structure of Cactus Ltd. e) What recommendations would you like to give the company manager(s) for the following period(s)?
i Loss on sale of non-current assets (including financial assets, e.g. investments) will lower the profit for the year – this effect will have to be eliminated in the section of operating activities in the statement of cash flows as the full amount of cash received will have to be shown under investing activities.
ii Gain on sale of non-current assets (including financial assets, e.g. investments) will increase the profit for the year – this effect will have to be eliminated in the section of operating activities in the statement of cash flows as the full amount of cash received will have to be shown under investing activities.
Please provide your answer in several comments if the answers are going to be too wide. Thank you! And note: I have posted this question before but I could not understand his hand writing and I also noticed that he didnt provide me the answers what was asked so that is why I needed to post this again. Thank you in advance!
In: Accounting
CASE STUDY Solve the case based on the following information: The comparative statements of financial position for Cactus Ltd, which is a merchandising business selling indoor plants, follows.
Cactus Ltd Comparative Statement of Financial Position As at 31 December 2019 and 2018
| 2019 | 2018 | ||
|---|---|---|---|
| Assets | € | € | |
| Current assets: | |||
| Cash | 195 800 | 15 000 | |
| Trade receivables | 58 400 | 72 000 | |
| Inventory | 59 800 | 53 000 | |
| Prepayments | 2 300 | 5 000 | |
| Total current assets: | 316 300 | 145 000 | |
| Non-current assets: | |||
| Land | 65 500 | 90 000 | |
| Buildings and equipment | 156 000 | 90 000 | |
| Less Accum. depreciation | (54 100) 101 900 | (40 000) 50 000 | |
| Total property, plant and equipment | 167 400 | 140 000 | |
| Long-term investments | 0 | 36 400 | |
| Total non-current assets | 167 400 | 176 400 | |
| Total assets | 483 700 | 321 400 |
| Liabilities and equity | 2019 | 2018 |
| Current liabilities: | ||
| Trade payables | 49 400 | 28 000 |
| Salary payable | 20 000 | 18 500 |
| Accruals | 18 700 | 22 200 |
| Total current liabilities | 88 100 | 68 700 |
| Non-current liabilities | ||
| Long-term notes payable | 85 000 | 65 000 |
| Bank loan payable | 22 600 | 0 |
| Total non-current liabilities | 107 600 | 65 000 |
| Total liabilities | 195 700 | 133 700 |
| Equity: | ||
| Ordinary share capital | 150 000 | 100 000 |
| Share premium | 75 000 | 0 |
| Retained profits | 63 000 | 87 700 |
| Total equity | 288 000 | 187 700 |
| Total liabilities and equity | 483 700 | 321 400 |
The following data is also available for Cactus Ltd for the year ended 31 December 2019
€
Cost of sales 56,500
Depreciation expense 14,100
Other operating expenses 17,700
Loss on sale of investments 1,400
Gain on sale of land 7,200
Sales revenue 97,300
Interest revenue 4,100
Dividend revenue 3,600
Salary expense 24,000
Interest expense 5,900
Insurance expense 2,300
It is known in addition that:
• A building was purchased for €46,000 and paid for immediately.
• Equipment was purchased by signing a note payable for €20,000.
• A plot of land was sold, no new plots of land were purchased.
• Ordinary shares have the nominal value of €1 per share
Required:
1. Prepare the classified statement of profit or loss (i.e. show also gross profit and operating profit) for Cactus Ltd for the year ended 31 December 2019.
2. Find answers to the following questions: a) Did Cactus Ltd issue any new shares during 2019? If yes, how many shares were issued and how much did the share issue raise? b) Did Cactus Ltd take out any loans in 2019 (in addition to the note payable for the purchase of equipment)? c) Were any dividends paid? If yes, how much? d) How much cash was received from the sale of land? e) How much cash was received from the sale of investments?
3. Prepare the statement of cash flows for Cactus Ltd for the year ended 31 December 2019 in the indirect method.
4. Write your comments on the following aspects for Cactus Ltd. based on its performance in the year ended 31 December 2019: a) Bring out the main factors that have affected the profit or loss differently from the cash flows. b) Is the cash generated from operations sufficient to cover interest and dividends that have been paid? c) How were the investments in non-current assets financed? d) Calculate the level of gearing as at 31 December 2019 and as at 31 December 2018. Comment on how risky you consider the capital structure of Cactus Ltd. e) What recommendations would you like to give the company manager(s) for the following period(s)?
i Loss on sale of non-current assets (including financial assets, e.g. investments) will lower the profit for the year – this effect will have to be eliminated in the section of operating activities in the statement of cash flows as the full amount of cash received will have to be shown under investing activities.
ii Gain on sale of non-current assets (including financial assets, e.g. investments) will increase the profit for the year – this effect will have to be eliminated in the section of operating activities in the statement of cash flows as the full amount of cash received will have to be shown under investing activities.
Please provide your answer in several comments if the answers are going to be too wide. Thank you!
In: Accounting
Question One
Barrett Corporation manufactures leather products. The corporation uses a non-contributory, defined benefit pension plan for its 230 employees.
The footnote to the financial statements relating to the pension plan, in part, stated: Note J. The company has a defined benefit pension plan covering substantially all of its employees. The benefits are based on years of service and the employee’s compensation during the last four years of employment. The company’s funding policy is to contribute annually the maximum amount allowed under the tax law. Contributions are intended to provide for benefits expected to be earned in the future as well as those earned to date.
The net periodic pension expense on Barrett Corporation’s comparative income statement showed an increase between 2016 and 2017.
The corporation provided the following information related to its defined benefit pension plan at December 31, 2018:
Defined benefit obligation $2,737,000
Fair value of plan assets 2,278,329
Accumulated OCI – Net loss (1/1/18 balance: –0–) 34,220
Other pension data
Service cost for 2018 94,000
Actual return on plan assets in 2018 130,000
Interest on January 1, 2018, defined benefit obligation 164,220
Contributions to plan in 2018 93,329
Benefits paid 140,000
Discount (interest) rate 6%
The new CEO, Patricia Wright, while reviewing the previous three year’s financial statements with the Controller, Helen Stewart, had some concerns. Given that Barrett Corporation’s work force has been stable for the last 6 years, Patricia could not understand the increase in the net periodic pension expense between 2016 and 2017. Helen explained that the net periodic pension expense consists of several elements, some of which may increase or decrease the net expense.
Instructions
a. The determination of the net periodic pension expense is a function of two elements. List and briefly describe each of the elements.
b. Describe the major difference and the major similarity between the vested benefit obligation and the defined benefit obligation.
c. Explain what are pension gains and losses and why they are not recognized in net income in the period in which they arise.
d. Briefly describe how pension gains and losses are recognized.
e. Prepare the note disclosing the components of pension expense for the year 2018.
f. Net income for 2018 is $35,000. Determine the amounts of other comprehensive income and comprehensive income for 2018.
g. Compute accumulated other comprehensive income reported at December 31, 2018.
In: Accounting
The September 30, 2018 balance sheet of ABC Corporation disclosed the following information relating to its receivables:
| Accounts Receivable (net of $18,000 allowance) | $342,000 |
ABC prepares quarterly financial statements. The following occurred during the fourth quarter of 2018:
1. During the 4th quarter, ABC had credit sales of $2,600,000 and collections on accounts receivable (general) of $2,300,000. Uncollectible accounts totaling $19,000 were written off, and a $2,600 accounts receivable previously written off was collected (not included in the $2,300,000 of cash collections reported above.)
2. On November 1, ABC assigned $300,000 of accounts receivable to Quicken Finance on a non-notification basis. Quicken advanced ABC cash proceeds for 85% of the accounts assigned, less a finance fee of $5,000, in exchange for an interest-bearing note. The note incurs interest at 1% per month on the outstanding loan balance. Cash collections from these assigned accounts are to be remitted monthly to Quicken Finance and include accrued interest (i.e. the cash collected each month must be used to repay both principal and interest on the note.)
|
*During November, ABC collected $150,000 on assigned accounts. ABC also accepted sales returns of $2,000. The November collections were remitted to Quicken on November 30th and included accrued interest for the month. |
|
*During December, ABC wrote off $3,000 of assigned accounts as uncollectible. By December 31st, assigned accounts of $80,000 were collected in cash. These cash collections were remitted to Quicken Finance on December 31, 2018, and included accrued interest for December. |
3. On December 31, 2018, ABC estimates 5% of total accounts receivable and accounts receivable assigned to be uncollectible.
a) Determine how much Interest Expense ABC would report on their quarterly income statement for the period 10/1 - 12/31/18 from the assigning transaction:
b) To record the December journal entry to write off the uncollectible account that had been assigned, you would debit and credit?
c) Determine Bad Debt Expense for the fourth quarter as of December 31, 2018:
d) Determine the ending balance of Accounts Receivable - General as of December 31, 2018:
e) Determine the ending balance of the Accounts Receivable - Assigned as of December 31, 2018:
f) Determine the ending balance of the Allowance for Doubtful Accounts (after adjustment) as of December 31, 2018:
g) Determine the ending balance of the Note Payable as of December 31, 2018:
In: Accounting
i. Document translation initially relies on a source document. The source document is a text provided in the originally recorded, valid language (see below, and assume only one language for the original document), and has an associated author and publication date. Source document authors are not related to translators in any manner.
ii. Translation of a document also relies on a translator, who is capable of translating documents from one language to another. A translator may be uniquely identified by a numeric international translation association (ITA) number (ITAN). A translator must also be fluent in one or more languages*, and may serve on an ITA committee for up to one (but no more than one) particular language.
iii. The document translation database also requires potential languages to be specified. In addition to the ITA committee outlined in ii., each language is associated with a single ITA committee chair.
iv. A translation is associated with a source document, a language (the one to which it has been translated), and a translator. In addition, it is associated with a translation date, and a certification status (Y or N). Multiple translators can create translations of any given document into a given language, and a single translator can create translations of a given document into multiple languages. Assume, however, that any given translator can only translate a given document into a single language once and only once.
In: Computer Science
The Education for All (EFA) was launched in 1990 but in 2000 there was a reaffirmation of governments commitments to it through the Dakar framework. There were six EFA goals and associated targets to be met by 2015. In not less than 2000 words, assess two goals of the 15years old initiative.
In: Economics
In: Finance
|
A. |
ClassCo sells Convertible Bond with warrant to convert into stock |
|||||||||
|
Bond with face |
$1,000 |
|||||||||
|
Face Rate |
8.00% |
|||||||||
|
Term |
3 |
Yrs. |
||||||||
|
Market rate @ sale |
8.50% |
|||||||||
|
issued: |
6/30/2018 |
|||||||||
|
maturity |
6/30/2021 |
|||||||||
|
Interest paid annually |
||||||||||
|
Bond sold for |
996.00 |
|||||||||
|
Part 1) determine value received from sale, Discount or Premium? |
||||||||||
|
Part 2) Prepare JE to record sale, use incremental |
||||||||||
|
assume value of Bond in the known |
||||||||||
|
and value of warrant is incremental |
||||||||||
|
B. |
ClassCo: |
PE 12/31/2018 |
Fiscal = calendar Yr. |
|||||||
|
Net income: after tax |
2000 |
shares: |
||||||||
|
Beginning: |
505 |
|||||||||
|
3/1 issue |
50 |
|||||||||
|
9/1 issue |
60 |
|||||||||
|
Treasury Purchase 10/30 |
(24) |
|||||||||
|
on 11/22, 3 for 1 split |
||||||||||
|
Preferred dividends this year = |
250 |
|||||||||
|
Part 1) Calculate EPS |
||||||||||
|
Part 2) using "as if" compute EPS & dilutive effect of Convertible Bonds |
||||||||||
|
issued 10 bonds , $1000 bonds issued prior yr., 6%, each bond was convertible into 30 shares |
||||||||||
|
40% tax rate for bonds |
||||||||||
|
C. |
NET Income: |
4500 |
No preferred stock |
|||||||
|
Average # of Shares |
2200 |
EPS = |
2.045 |
|||||||
|
Stock Options: |
all full Yr. |
|||||||||
|
# option shares |
500 |
|||||||||
|
0ption price per share |
$18 |
|||||||||
|
Market at PE being measured |
$32 |
|||||||||
|
Part 1 |
Compute dilutive effect per share |
|||||||||
In: Finance
When discussing the empirical tests of the EMH, there are three topical areas that suggest that the debate probably will never be settled: the magnitude issue, the selection bias issue, and the lucky event issue. Specifically with the lucky event issue, the laws of probability are oftentimes ignored or forgotten.
True
False
In: Finance