Questions
Part A - Palindromic Bitlists Write a function palindrome binary(n) which returns a list of bitlists...

Part A - Palindromic Bitlists Write a function palindrome binary(n) which returns a list of bitlists of length n, where every bitlist is a palindrome. The returned list of bitlists must be in lexicographical order (think about the order of your options). You must use backtracking to solve this problem (i.e. do not use brute force).

Part B - All Paths Write a function all paths(M, u, v) which takes as input an adjacency matrix of a graph, M, and two vertices u, v and returns a list of all paths from u to v in M. A path is a list of vertices. Note that a path cannot use the same vertex twice, but two different paths can use some of the same vertices. The returned list of paths must be in lexicographical order. You must use backtracking to solve this problem (i.e. do not use brute force).

PYTHON CODE

In: Computer Science

1. Star with Newton's third law: dp/dt = ΣF where p is the momentum. In space,...

1. Star with Newton's third law: dp/dt = ΣF where p is the momentum. In space, the sum of the external forces ΣF = 0. For a rocket in space, the mass and velocity change with time as the rocket expends its fuel. Show from Newton's third law that ΔV = v ln(m/M) where m is the initial mass of the rocket, M is the final mass of the rocket after the fuel is expended, v is the rocket's exhaust velocity and ΔV is the change in the velocity for the rocket

2. Now, the rocket needs to get to escape velocity to get to the moon. Use conservation of energy to derive an expression for the escape velocity. If we start at 200km above the surface of earth, calculate the ΔV we need to escape from Earth and get to the moon.

3. Finally, use the earlier Rocket Equation calculate the fraction of the initial rocket's mass that is dedicated to fuel to make the journey from the Earth to the Moon. In this case, v is 4500 m/s.

In: Physics

Create four classes named: Planet, solarSystem, Earth and Moon, 1. Think how to use inheritance in...

Create four classes named: Planet, solarSystem, Earth and Moon,
1. Think how to use inheritance in three classes
2. solarSystem has
Name, color, Diameter_Miles, dist_From_Sun and perimeter =(float) 3.14*Diameter_Miles;
3. Moon has the following attributes:
Name, color, Diameter_Miles, dist_From_Sun, surface_area = 4*3.14*Radius*Radius;
And volume = (4/3)*(3.14)*(Radius_Miles)*(Radius_Miles)*(Radius_Miles);
4. Planet has the following attributes:
Name, color, Diameter_Miles, dist_From_Sun and volume = (4/3)*(3.14)*(Radius_Miles)*(Radius_Miles)*(Radius_Miles);
5. Earth has the following attributes:
Name, color, Diameter_Miles, dist_From_Sun and volume = (4/3)*(3.14)*(Radius_Miles)*(Radius_Miles)*(Radius_Miles);
Every class has constructor to initialize the input variables and measurements Method that prints the following:
From the solarSystem Class consider the following inputs: name ="solar System", color="multi", Diameter_Miles=7500000000L, dist_From_Sun =3666000000L
The output should be:
Name Of The solarSystem : solar System
Colour Of The solarSystem : multi
Distance From the Sun : 3666000000 miles
Perimeter of the solarSystem : 2.35500012E10 miles
--------------------------------------
From the Planet Class consider the following inputs: name =" Earth ", color=" blue", Diameter_Miles=3959L, dist_From_Sun =93000000L
The output should be:
Name Of The Planet : Earth
Colour Of The Planet : blue
Distance From the Sun is : 93000000 miles
Volume Of The Planet : 1.9484360366806003E11 cubic units
From the Earth Class consider the following inputs: name =" Earth ", color=" blue", Diameter_Miles=3959L, dist_From_Sun =93000000L
The output should be:
Name Of The Planet : Earth
Colour Of The Planet : blue
Distance From the Sun is : 93000000 miles
Volume Of The Planet : 1.9484360366806003E11 cubic units
-----------------
From the Moon Class consider the following inputs: name =" Luna", color=" silvery ", Diameter_Miles=1740L, dist_From_Sun =238900L
The output should be:
Name Of The Moon : Luna
Colour Of The Moon : silvery
Distance From the Mother Planet : 238900 miles
Surface area Of The Moon : 3.8026656E7 km^2
---------------

java

In: Computer Science

Note: This problem is for the 2018 tax year. Lance H. and Wanda B. Dean are...

Note: This problem is for the 2018 tax year.

Lance H. and Wanda B. Dean are married and live at 431 Yucca Drive, Santa Fe, NM 87501. Lance works for the convention bureau of the local Chamber of Commerce, while Wanda is employed part-time as a paralegal for a law firm.

During 2018, the Deans had the following receipts:

Salaries ($60,000 for Lance, $41,000 for Wanda) $101,000
Interest income—
   City of Albuquerque general purpose bonds $1,000
   Ford Motor company bonds 1,100
   Ally Bank certificate of deposit 400 2,500
Child support payments from John Allen 7,200
Annual gifts from parents 26,000
Settlement from Roadrunner Touring Company 90,000
Lottery winnings 600
Federal income tax refund (for tax year 2017) 400

Wanda was previously married to John Allen. When they divorced several years ago, Wanda was awarded custody of their two children, Penny and Kyle. (Note: Wanda has never issued a Form 8332 waiver.) Under the divorce decree, John was obligated to pay alimony and child support—the alimony payments were to terminate if Wanda remarried.

In July, while going to lunch in downtown Santa Fe, Wanda was injured by a tour bus. As the driver was clearly at fault, the owner of the bus, Roadrunner Touring Company, paid her medical expenses (including a one-week stay in a hospital). To avoid a lawsuit, Roadrunner also transferred $90,000 to her in settlement of the personal injuries she sustained.

The Deans had the following expenditures for 2018:

Medical expenses (not covered by insurance) $7,200
Taxes—
   Property taxes on personal residence $3,600
   State of New Mexico income tax (includes amount withheld
       from wages during 2018) 4,200 7,800
Interest on home mortgage (First National Bank) 6,000
Charitable contributions 3,600
Life insurance premiums (policy on Lance's life) 1,200
Contribution to traditional IRA (on Wanda's behalf) 5,000
Traffic fines 300
Contribution to the reelection campaign fund of the mayor of Santa Fe 500
Funeral expenses for Wayne Boyle 6,300

The life insurance policy was taken out by Lance several years ago and designates Wanda as the beneficiary. As a part-time employee, Wanda is excluded from coverage under her employer's pension plan. Consequently, she provides for her own retirement with a traditional IRA obtained at a local trust company. Because the mayor is a member of the local Chamber of Commerce, Lance felt compelled to make the political contribution.

The Deans' household includes the following, for whom they provide more than half of the support:

Social Security Number Birth Date
Lance Dean (age 42) 123-45-6786 12/16/1976
Wanda Dean (age 40) 123-45-6787 08/08/1978
Penny Allen (age 19) 123-45-6788 10/09/1999
Kyle Allen (age 16) 123-45-6789 05/03/2002
Wayne Boyle (age 75) 123-45-6785 06/15/1943

Penny graduated from high school on May 9, 2018, and is undecided about college. During 2018, she earned $8,500 (placed in a savings account) playing a harp in the lobby of a local hotel. Wayne is Wanda's widower father who died on January 20, 2018. For the past few years, Wayne qualified as a dependent of the Deans.

Federal income tax withheld is $5,200 (Lance) and $2,100 (Wanda). The proper amount of Social Security and Medicare tax was withheld.

Required:

Determine the Federal income tax for 2018 for the Deans on a joint return by providing the following information that would appear on Form 1040 and Schedule A. They do not want to contribute to the Presidential Election Campaign Fund. All members of the family had health care coverage for all of 2018. If an overpayment results, it is to be refunded to them.

In: Accounting

In C++ Modify the program #1 to allow the user to enter name-score pairs. For each...

In C++

Modify the program #1 to allow the user to enter name-score pairs. For each student taking a test, the user types a string representing the name of the student, followed by an integer representing the student's score. (use a structure) Modify the average-calculating function so they take arrays of structures, with each structure containing the name and score of a single student. In traversing the arrays, use pointers notation rather than array indices. (myArray->name or *(myArray).name) Make it a class.  You will need a destructor because you are using dynamic arrays.

I need your help! This is fundamental II. Thank you

In: Computer Science

Sun Corporation received a charter that authorized the issuance of 89,000 shares of $6 par common stock and 20,000 shares of $100 par, 8 percent cumulative preferred stock


Sun Corporation received a charter that authorized the issuance of 89,000 shares of $6 par common stock and 20,000 shares of $100 par, 8 percent cumulative preferred stock. Sun Corporation completed the following transactions during its first two years of operation:

2016

  Jan.

5

Sold 13,350 shares of the $6 par common stock for $8 per share.

 

12

Sold 2,000 shares of the 8 percent preferred stock for $110 per share.

  Apr.

5

Sold 17,800 shares of the $6 par common stock for $10 per share.

  Dec.

31

During the year, earned $312,400 in cash revenue and paid $241,500 for cash operating expenses.

 

31

Declared the cash dividend on the outstanding shares of preferred stock for 2016. The
dividend will be paid on February 15 to stockholders of record on January 10, 2017.

 

31

Closed the revenue, expense, and dividend accounts to the retained earnings account.

2017

  Feb.

15

Paid the cash dividend declared on December 31, 2016.

  Mar.

3

Sold 3,000 shares of the $100 par preferred stock for $120 per share.

  May

5

Purchased 550 shares of the common stock as treasury stock at $12 per share.

  Dec.

31

During the year, earned $251,000 in cash revenues and paid $174,000 for cash operating expenses.

 

31

Declared the annual dividend on the preferred stock and a $0.75 per share dividend on the common stock.

 

31

Closed revenue, expense, and dividend accounts to the retained earnings account.

b.

Prepare the balance sheets at December 31, 2016 and 2017. (Amounts to be deducted should be indicated with minus sign.)

   
   
   
 

SUN CORPORATION

Balance Sheet

As of December 31, 2016

Assets

   
     
     

Total assets

 

$0

Liabilities

   
     
     

Total liabilities

 

0

Stockholders’ equity

   
     
     
     
     
     
     

Total paid-in capital

0

 
     
     

Total stockholders’ equity

 

0

Total liabilities and stockholders’ equity

 

0

 
           
   
 

SUN CORPORATION

Balance Sheet

As of December 31, 2017

Assets

   
     
     

Total assets

 

$0

Liabilities

   
     
     

Total liabilities

 

0

Stockholders’ equity

   
     
     
     
     
     
     

Total paid-in capital

0

 
     
     

Total stockholders’ equity

 

0

Total liabilities and stockholders’ equity

 

0

c-1.

What is the number of common shares outstanding at the end of 2016? At the end of 2017? How many common shares had been issued at the end of 2016? At the end of 2017? (Amounts to be deducted should be indicated with minus sign.)

   
 

Schedule of Number of Shares of Common Stock

 

Shares Issued

Shares Outstanding

2016

   
     
     
     

Totals

0

0

2017

   
     
     

Totals

0

0

 
       

c-2.

Is any differences between issued and outstanding common shares for 2016 and for 2017.

   

          

   
 
   

Issued common shares

 

Outstanding common shares

 

In: Accounting

Required information Problem 17-2A Ratios, common-size statements, and trend percents LO P1, P2, P3 [The following...

Required information

Problem 17-2A Ratios, common-size statements, and trend percents LO P1, P2, P3

[The following information applies to the questions displayed below.]

Selected comparative financial statements of Korbin Company follow:

KORBIN COMPANY
Comparative Income Statements
For Years Ended December 31, 2017, 2016, and 2015
2017 2016 2015
Sales $ 480,784 $ 368,320 $ 255,600
Cost of goods sold 289,432 230,568 163,584
Gross profit 191,352 137,752 92,016
Selling expenses 68,271 50,828 33,739
Administrative expenses 43,271 32,412 21,215
Total expenses 111,542 83,240 54,954
Income before taxes 79,810 54,512 37,062
Income taxes 14,845 11,175 7,524
Net income $ 64,965 $ 43,337 $ 29,538


KORBIN COMPANY
Comparative Balance Sheets
December 31, 2017, 2016, and 2015
2017 2016 2015
Assets
Current assets $ 52,332 $ 40,943 $ 54,731
Long-term investments 0 800 3,770
Plant assets, net 97,187 103,446 61,788
Total assets $ 149,519 $ 145,189 $ 120,289
Liabilities and Equity
Current liabilities $ 21,830 $ 21,633 $ 21,051
Common stock 66,000 66,000 48,000
Other paid-in capital 8,250 8,250 5,333
Retained earnings 53,439 49,306 45,905
Total liabilities and equity $ 149,519 $ 145,189 $ 120,289

Problem 17-2A Part 1

Required:
1. Complete the below table to calculate each year's current ratio.

Current Ratio
Choose Numerator: / Choose Denominator: = Current ratio
/ = Current ratio
2017 / = to 1
2016 / = to 1
2015 / = to 1

2. Complete the below table to calculate income statement data in common-size percents. (Round your percentage answers to 2 decimal places.)

KORBIN COMPANY
Common-Size Comparative Income Statements
For Years Ended December 31, 2017, 2016, and 2015
2017 2016 2015
Sales % % %
Cost of goods sold -1 -1 -1
Gross profit
Selling expenses -1 -1 -1
Administrative expenses -1 -1 -1
Total expenses
Income before taxes -1 -1 -1
Income taxes -1 -1 -1
Net income % % %

3. Complete the below table to calculate the balance sheet data in trend percents with 2015 as the base year. (Round your percentage answers to 2 decimal places.)

KORBIN COMPANY
Balance Sheet Data in Trend Percents
December 31, 2017, 2016 and 2015
2017 2016 2015
Assets
Current assets % % 100.00 %
Long-term investments 100.00
Plant assets, net 100.00
Total assets % % 100.00 %
Liabilities and Equity
Current liabilities % % 100.00 %
Common stock 100.00
Other paid-in capital 100.00
Retained earnings 100.00
Total liabilities and equity % % 100.00 %

In: Accounting

Required information Problem 17-2A Ratios, common-size statements, and trend percents LO P1, P2, P3 [The following...

Required information

Problem 17-2A Ratios, common-size statements, and trend percents LO P1, P2, P3

[The following information applies to the questions displayed below.]

Selected comparative financial statements of Korbin Company follow:

KORBIN COMPANY
Comparative Income Statements
For Years Ended December 31, 2017, 2016, and 2015
2017 2016 2015
Sales $ 528,561 $ 404,921 $ 281,000
Cost of goods sold 318,194 253,481 179,840
Gross profit 210,367 151,440 101,160
Selling expenses 75,056 55,879 37,092
Administrative expenses 47,570 35,633 23,323
Total expenses 122,626 91,512 60,415
Income before taxes 87,741 59,928 40,745
Income taxes 16,320 12,285 8,271
Net income $ 71,421 $ 47,643 $ 32,474


KORBIN COMPANY
Comparative Balance Sheets
December 31, 2017, 2016, and 2015
2017 2016 2015
Assets
Current assets $ 49,834 $ 38,989 $ 52,119
Long-term investments 0 700 3,220
Plant assets, net 92,549 98,570 59,209
Total assets $ 142,383 $ 138,259 $ 114,548
Liabilities and Equity
Current liabilities $ 20,788 $ 20,601 $ 20,046
Common stock 71,000 71,000 53,000
Other paid-in capital 8,875 8,875 5,889
Retained earnings 41,720 37,783 35,613
Total liabilities and equity $ 142,383 $ 138,259 $ 114,548

1. Complete the below table to calculate each year's current ratio.

2. Complete the below table to calculate income statement data in common-size percents. (Round your percentage answers to 2 decimal places.)

3. Complete the below table to calculate the balance sheet data in trend percents with 2015 as the base year. (Round your percentage answers to 2 decimal places.)

Current Ratio
Choose Numerator: / Choose Denominator: = Current ratio
/ = Current ratio
2017 / = 0 to 1
2016 / = 0 to 1
2015 / = 0 to 1
KORBIN COMPANY
Common-Size Comparative Income Statements
For Years Ended December 31, 2017, 2016, and 2015
2017 2016 2015
Sales % % %
Cost of goods sold -1 -1 -1
Gross profit
Selling expenses -1 -1 -1
Administrative expenses -1 -1 -1
Total expenses
Income before taxes -1 -1 -1
Income taxes -1 -1 -1
Net income % % %
KORBIN COMPANY
Balance Sheet Data in Trend Percents
December 31, 2017, 2016 and 2015
2017 2016 2015
Assets
Current assets % % 100.00 %
Long-term investments 100.00
Plant assets, net 100.00
Total assets % % 100.00 %
Liabilities and Equity
Current liabilities % % 100.00 %
Common stock 100.00
Other paid-in capital 100.00
Retained earnings 100.00
Total liabilities and equity % % 100.00 %

In: Accounting

Recording Transactions (Including Adjusting and Closing Entries), Preparing Financial Statements, and Performing Ratio Analysis Ben and...

Recording Transactions (Including Adjusting and Closing Entries), Preparing Financial Statements, and Performing Ratio Analysis Ben and Kelly Perry began operations of their Roof repair company (Perry Roofing, Inc.) on January 1, 2015. The annual reporting period ends December 31. The trial balance on January 1, 2016, was as follows:

Debit Cash
Cash 12,000
Accounts receivable 4,000
Supplies 8,000
Equipment
Accumulated Depreciation (on equipement)
Other assets (not detailed to simplify) 9,000
Accounts Payable 14,000
Notes Payable
Wages Payable
Interest Payable
Income Taxes Payable
Unearned Revenue
Common Stock (60,000 shares, 0.10 par value) 6,000
Additional Paid-in Capital 9,000
Retained Earnings 4,000
Service Revenue
Depreciation Expense
Supplier Expense
Wage Expense
Interest Expense
Income Tax Expense
Remaining Expense (not detailed to simplify)
Totals 33,000 33,000

Transactions during 2016 follow:

a. Borrowed $28,000 cash on July 1, 2016, signing a one-year, 10 percent note payable.

b. Purchased equipment for $18,000 cash on July 1, 2016.

c. Sold 10,000 additional shares of capital stock for cash at $0.50 market value per share at the beginning of the year.

d. Earned $75,000 in revenues for 2016, including $16,000 on credit and the rest in cash.

e. Incurred remaining expenses of $35,000 for 2016, including $7,000 on credit and the rest paid with cash.

f. Purchased $3,000 of supplies on cash.

g. Collected accounts receivable, $8,000.

h. Paid accounts payable, $11,000.

i. Purchased $10,000 of supplies on account.

j. Received a $3,000 deposit on work to start January 15, 2017.

k. Declared and paid a cash dividend, $10,000.

Data for adjusting entries:

l. Supplies of $9,000 were counted on December 31, 2016.

m. Depreciation for 2016, $2,000.

n. Interest accrued on notes payable (to be computed).

o. Wages earned since the December 24 payroll but not yet paid, $3,000.

p. Income tax expense was $4,000, payable in 2017.

QUESTIONS TO ANSWER:

1. Set up T-accounts for the accounts on the trial balance and enter beginning balances.

2. Prepare journal entries for transactions (a) through (k) and post them to the T-accounts.

3. Journalize and post the adjusting entries (l) through (p).

4. Prepare an income statement (including earnings per share), statement of stockholders' equity, and balance sheet.

5. Identify the type of transaction for (a) through (k) for the statement of cash flows (O for operating, I for investing, F for financing), and the direction and amount of the effect.

6. Journalize and post the closing entry.

7. Compute the following ratios for 2016 and explain what the results suggest about the company:

a. Current ratio

b. Total asset turnover

c. Net profit margin

In: Accounting

c# only please Objectives Use the more advanced data structures introduced to accomplish a difficult problem....

c# only please

Objectives

  • Use the more advanced data structures introduced to accomplish a difficult problem.

Tasks

This assignment has two parts:

  1. Read from a file.
  2. Write to a file.

Task 1 – File Input

The first piece of information we need is a text file’s name and location. Ask the user through the console what the file’s name and location are. After that, please ensure that the file does exist and at the given location. If the file does not exist or cannot be read, please return a message to the user stating that and ask them to enter another name and location.

Finally, if the file can be read then simply copy/read every line from the file. The contents of this file will be used in the next task.

Task 2 – File Output

Ask the user, through the console, what the name of the copy of the previous file should be called and where it should be saved. Check to see if a file with the same name already exists at the location given and if one does ask the user if they want to overwrite the file that already exists or if they would like to change the name and location of the new file. If they wish to change the name and location, go through the process of getting their input again through the console and checking if the newly given name and location are taken already too.

If they want to overwrite or no file already exists in the given location with the given name, then place the copied contents of the file that was read in the first task into this new file.

After successfully copying the contents of the first file into the second file, print to the console the name and location of both of those files.

A sample text file named “textfile.txt” has been supplied in case you need a file to test the above code on. The contents of that file is the declaration of independence.

∃ Some Sample Output:

Please enter a text file name and location:

C:\Users\source\repos\1322L_Assignment6\bin\Debug\textfiladsfe.txt22

This file does not exist!

Please enter a text file name and location:

C:\Users\source\repos\1322L_Assignment6\bin\Debug\textfile.txt

Please enter a new file name and location:

C:\Users\source\repos\1322L_Assignment6\bin\Debug\DeclarationOfIndependence.txt

A file already exists with that name!

Would you like to overwrite it or enter a different name? (0 or 1) 0

The file will be overwritten.

The file “C:\Users\source\repos\1322L_Assignment6\bin\Debug\textfile.txt” has been copied to “C:\Users\source\repos\1322L_Assignment6\bin\Debug\DeclarationOfIndependence.txt”.

In: Physics