So currently I am working on some SQL with python which is linked to my database and I am stuck on a split problem. So in the program it connects to the database and then next you input either list, add, update, remove or allocate. So lets say I want to add a new data into the database you just need to write: update -name='Ava - #2' -class=2.
After you type this there is a variable called val which does the strip and split.
So as of right now what I have done is:
val = input('> ').strip().lower()
parts = val.split(' ')
print(parts)
So if I input the following: update -name="Nile Adam" -class=2
I expect the following output: ['update', '-name="Nile Adam"', '-class=2']
However the output I get is: ['update', '-name="Nile', 'Adam"', '-class=2']
In: Computer Science
There will be three grades for each student in "grades.txt" (see example file bellow). In "student.txt" there are two students first and last names. In "grades.txt" the grades for each student will be on the same line number as the students name was on in "students.txt".
So if line 1 of "students.txt" contains:
Joe Blow
then line 1 of "grades.txt" would contain Joe Blow's grades:
85 54.3 56
Into an output file called "report.txt" output the student's last name then a comma the their first name. Following this, calculate their average and assign a letter grade using the following scale:
'A': grade >= 90
'B': 90 > grade >= 80
'C': 80 > grade >= 70
'D': 70 > grade >= 60
'F': grade < 60
If the final grade of a student is greater than 100 instead of printing their letter grade output the statement "Teacher was far too easy". The "report.txt" should have a heading on each of the columns the first saying "Student's Name" and the second saying "Student's Grade".
In: Computer Science
i'm working on this assignment where we must simulate a bank account. I am having a few issues. The first issue is that for menu option 1 i am struggling to make the program so that I can add the name and balance of the account all at once. For example I would type "mike 350" and it would update the dictionary with a new account and balance, right now i have to open the account then deposit a balance separately using two different menu functions. The second issue i am having is that every account name in the dictionary has the same balance, I need to have each person have a separate balance. The third and last issue I am having is with menu option #6, i am not sure how to list the account names and balances with a number of each account to the left, the professor wants the output to look like this for option 6
No Customer Name Balance
== ============= =======
1 joe 10
2 jim 20
3 eric 30
I have made it this far.
def main():
print("1. Open an account")
print("2. Close an Account")
print("3. Deposit money")
print("4. Withdrawal money")
print("5. Enquire about balance")
print("6. Print a list of customers and balances")
print("7. Quit")
accounts = {}
balance = 0
main()
while True:
menu_choice = int(input("Type in a menu choice: "))
#menu choice 1
if menu_choice == 1:
number = input("Enter name of the new customer and \nthe amount of
money to be deposited \n into the new account (Ex. 'Mike
350'):")
if number in accounts:
print('This customer already exists!')
else:
accounts[number]=balance
print ("Account name", number, "opened.")
#menu choice 2
elif menu_choice == 2:
number = input("Account name:")
if number not in accounts:
print('Enter the customer/account name to be deleted: ')
if number in accounts:
if balance>0:
print('Can not close an account with balance greater than
zero')
else:
del accounts[number]
print ("Account number", number, "is closed.")
#menu choice 3
elif menu_choice == 3:
print ("Enter the customer name for deposit: ")
number = input("Account name: ")
if number in accounts:
deposit = float(input("Enter the amount to be deposited: "))
balance += deposit
print ("your balance is:", balance-deposit, "before deposit")
print ("Your balance is:", balance, "after deposit")
else:
print ("This customer doesn't exist!")
#menu choice 4
elif menu_choice == 4:
number = input("Enter the customer name for withdrawl: ")
if number not in accounts:
print('This customer doesnt exist!')
if number in accounts:
withdraw = float(input("Enter the amount to be withdrawn: "))
if withdraw <=balance:
balance -=withdraw
print ('your balance is:', balance+withdraw, 'before
withdrawal')
print ("Your balance is:", balance, 'after withdrawal')
if withdraw >balance:
print ('your balance is:', balance, 'before withdrawal')
print ('You dont have enough balance to cover the withdrawal')
#menu choice 5
elif menu_choice == 5:
number = input('Enter the customer name for balance enquiry:
')
if number not in accounts:
print('This customer doesnt exist!')
if number in accounts:
print('your balance is:', balance)
#menu choice 6
elif menu_choice == 6:
print ("Accounts")
for x in accounts.keys():
print ('No Customer Name Balance')
print ('============================')
print (x , balance\n)
#menu choice 7
elif menu_choice == 7:
print ("Quit.")
break
else:
print ("Please enter a menu choice between 1 and 6.")
main()
In: Computer Science
|
The controller of the Red Wing Corporation is in the process of preparing the company’s 2016 financial statements. She is trying to determine the correct balance of cash and cash equivalents to be reported as a current asset in the balance sheet. The following items are being considered: |
| a. | Balances in the company’s accounts at the First National Bank; checking $15,300, savings $23,900. |
| b. | Undeposited customer checks of $7,000. |
| c. | Currency and coins on hand of $760. |
| d. |
Savings account at the East Bay Bank with a balance of $580,000. This account is being used to accumulate cash for future plant expansion (in 2018). |
| e. |
$56,000 in a checking account at the East Bay Bank. The balance in the account represents a 20% compensating balance for a $280,000 loan with the bank. Red Wing may not withdraw the funds until the loan is due in 2019. |
| f. | U.S. Treasury bills; 2-month maturity bills totaling $33,000, and 7-month bills totaling $38,000. |
| Required: |
| 1. |
Determine the correct balance of cash and cash equivalents to be reported in the current asset section of the 2016 balance sheet. |
|
Cash and cash equivalents includes: |
||
|
a |
Balance in checking account |
|
|
Balance in savings account |
||
|
b |
Undeposited customer checks |
|
|
c |
Currency and coins on hand |
|
|
d |
Balance in savings account |
|
|
e |
Balance in checking account |
|
|
f |
U.S. treasury bills |
|
|
Total |
||
In: Accounting
The following is a summary of the May 2016 operations of Reagan Company that makes and sells airplane models. Suppose that the company uses the FIFO method.
|
Physical Units |
Direct Materials |
Conversion Costs |
|
|
WIP, beginning inventory |
28,000 |
$39,200 |
$30,800 |
|
Degree of completion for BI |
100% |
25% |
|
|
Started in May |
60,000 |
||
|
Completed and transferred out in May |
66,000 |
||
|
WIP, ending inventory |
22,000 |
||
|
Degree of completion for EI |
100% |
50% |
|
|
Costs added in May |
$90,000 |
$280,000 |
1.What is the amount of direct materials cost assigned to ending WIP at the end of May?
Group of answer choices
$44,000
$39,200
$33,000
$22,000
2.What is the cost of goods transferred out during May?
Group of answer choices
$293,000
$517,000
$363,000
$447,000
In: Accounting
23-2. December 31
2017 2016
33,500 13,000 Cash
12,250 10,000 Accounts Receivable
12,000 9,000 Inventory
0 3,000 Long-Investments
0 29,750 Building
0 (6,000) Accumalted depreciation on building
45,000 20,000 Equipment
(2,000) (4,500) Accumlated depreciation on equipment
5,000 9,250 Patents
105,750 83,500 Total Assets
5,000 3,000 Accounts Payable
1,000 5,000 Dividends Payable
4,000 8,500 Short-term Notes Payables
32,000 25,000 Long term notes payable
39,000 30,000 Common stock
6,000 3,000 Pain-in capital excess of par
18,750 9,000 Retained Earnings
105,750 83,500 Total
Additional data related to 2017 are as follows:
1. A long term note for $16,000 was issued for the acquisition of equipment.
2. On January 1, 2017 the building was completely destroyed by a flood. Insurance proceeds on the building were $30,000.
3. Equipment that had cost 11,000 and was 40% depreciated was sold for 2,500.
4. Common stock with a par value of 5,000 and a market value of 6,000 was issued to pay off part of the long-term note.
5. A new long-term note was issued for the acquisition of equipment.
6. Equipment was purchased for cash.
7. Dividends were of 7,000 were declared during 2017.
Prepare the statement of cash flows, including any significant non-cash transactions after the reconciliation. (SHOW ALL OF YOUR WORK PLEASE)
In: Accounting
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
In: Accounting
1.
The inventory on hand at the end of 2016 for Reddall Company is valued at a cost of $94,000. The following items were not included in this inventory:
Required:
Determine the cost of the ending inventory that Reddall should report on its December 31, 2016, balance sheet, assuming that its selling price is 140% of the cost of the inventory.
$_________
2.
|
Why are the cost of goods sold and ending inventory amounts different for each of the three methods? a. FIFO assumes different physical units are sold than does LIFO which results in different amounts being reported as cost of goods sold. b. FIFO assumes different unit costs are allocated to the cost of goods sold and ending inventory than does LIFO. c. Under FIFO, the cost of inventory includes freight-in, storage and insurance, whereas under LIFO these costs are expensed as incurred. d. Under LIFO, purchase discounts are recorded as part of the cost of inventory when the discount is not taken, resulting in a higher cost of goods sold |
In: Accounting
Valuation of Inventory
The inventory on hand at the end of 2016 for Reddall Company is valued at a cost of $94,000. The following items were not included in this inventory:
1. Purchased goods in transit, under terms FOB shipping point, invoice price $4,000, freight costs $200.
2. Goods out on consignment to Marlman Company, sales price $5,600, shipping costs of $200.
3. Goods sold to Grina Co. under terms FOB destination, invoiced for $1,900 which included $178 freight charges to deliver the goods. Goods are in transit.
4. Goods held on consignment by Reddall at a sales price of $2,700 which included sales commission of 20% of sales price.
5. Purchased goods in transit, shipped FOB destination, invoice price $2,100 which included freight charges of $190.
Determine the cost of the ending inventory that Reddall should report on its December 31, 2016, balance sheet, assuming that its selling price is 140% of the cost of the inventory.
In: Accounting
In the 2016 Summer Olympics in Rio, there were eight runners in the final of the men's 100 meter dash. How many possible outcomes could we have seen on the podium?
(The podium honors the first three finishers in an ORDERED fashion. The first-place finishers gets the gold medal, second-place finisher gets the silver medal, and the third-place finisher gets the bronze medal.)
How many possible outcomes could we have seen on the podium that didn't include either of the two Americans? Remember the podium represents an ORDERED finish.
What is the probability that both of the American runners medalled? (To medal means to finish in the top three)
**Calculate under the assumption that order doesn't matter for this calculation.
How many possible outcomes could we have seen on the podium if we know that a runner from Jamaica finished first, a runner from America finished second, and a runner from neither Jamaica nor America finished third?
In: Statistics and Probability