Questions
Coding in Java Assignment Write the following static methods. Assume they are all in the same...

Coding in Java Assignment

  1. Write the following static methods. Assume they are all in the same class. Assume the reference variable input for the Scanner class and any class-level variables mentioned are already declared. All other variables will have to be declared as local unless they are parameter variables. Use printf.
  1. A method that prompts for the customer’s name and returns it from the keyboard.
  1. A method called shippingInvoice() that prompts for an invoice number and stores it in a class variable (field) called invoiceNo. Assume the invoice number is a combination of numbers and text.
  1. Overload the method coded in 1b above so that it accepts a customer’s name through its parameter list, concatenates the name and invoice number in a header and returns the header. This method will not prompt for the name or invoice number. The content of the header will look like this where the Xs represent the actual customer name and invoice number:

Customer Name: Xxxxxxxxxxxx

Invoice No: XXXXXXXX

  1. A method that prompts for the subtotal and returns it from the keyboar
  1. A method that prompts for the number of items purchased and returns it from the keyboard.
  1. A method that accepts the noItemsPurchased and the subtotal through its parameter list and returns an average dollar amount of the items purchased. No prompts are needed.
  1. A method that accepts what is returned by the methods coded in 1c and 1f to print the following:

Customer Name: Xxxxxxxxxxxx

Invoice No: XXXXXXXX

Average of Items Purchased: $ZZZ,ZZ9.99

2. Write statements that will call each of the methods you coded above. Be conscious of the value-returning methods. Assume the method calls are done in the main() and the main() is in the same class.

a.

b.

c.

d.

e.

f.

g.

In: Computer Science

Return the full names (first and last) of actors with “SON” in their last name, ordered...

  1. Return the full names (first and last) of actors with “SON” in their last name, ordered by their first name.
  2. Find all the addresses where the second address (i.e. address2) is not empty (i.e., contains some text), and return these second addresses sorted.
  3. Your Professor wants you to find all the information from rental table associated with those staff (or staff ID) whose address ID is 4 (in staff table). Professor wants you to use Sub-query function.
  4. Your Professor wants you to find out the first name and district of all the customers whose district ends on “ia” – such as California.
  5. Your Professor wants you to find all the payment-related information of customers other than the customer whose ID is 1.
  6. Your Professor wants you to find out the full name (i.e. combine the first and last name) and the district of all the customers that live in a district called California.
  7. Your Professor wants you to find the title, film id and category name (such as action) of those movies that are of the action genre (i.e. category name is Action).
  8. Return the first and last names of actors who played in a film involving a “Crocodile” and a “Shark”, along with the release year of the movie, sorted by the actors’ last names.
  9. Find all the film categories in which there are between 55 and 65 films. Return the names of these categories and the number of films per category, sorted by the number of films.
  10. In how many film categories is the average difference between the film replacement cost and the rental rate larger than 17?

In: Computer Science

Lesson is on Inheritance and overriding the ToString ( ) method in Java: The program should...

Lesson is on Inheritance and overriding the ToString ( ) method in Java:

The program should consist of 3 classes and will calculate an hourly paycheck.

   - The superclass will contain fields for common user data for an employee (first name and last name) and a toString method that returns the formatted output of the names to the calling method.

   - The subclass will calculate a paycheck for an hourly employee and will inherit from the superclass.

   - The testclass will interface with the user.

   - The superclass will be used to set the first and last name of the employee.

   - The subclass should have additional instance variables for the hours worked, the hourly rate of pay and the weekly pay that they calculate.

   - The subclass should have a toString method that prints the calculated weekly paycheck from the class plus calls the toString method of the superclass to obtain the formatted first and last name.

   - Create a basic driver class to supply input from the user into the program and print the results. (The results must be correct.)

Here is the grading rubric:

Create a superclass that sets the first name and last name as private instance variables and has a toString method that returns a formatted string of the employee’s first and last name

Create a subclass that inherits the superclass, calculates a weekly paycheck for an hourly employee and contains a toString method that calls the superclass toString method plus adds the weekly paycheck amount to the formatted output supplied by the superclass

The subclass contains a constructor that calls the super class constructor

The subclass overrides the toString method in the superclass and adds the weekly paycheck amount to the string it returns

The test class code should create object, call methods to calculate the weekly paycheck and print the results

In: Computer Science

Python - Rewriting a Program Rewrite Program 1 using functions. The required functions are in the...

Python - Rewriting a Program

Rewrite Program 1 using functions. The required functions are in the table below.

Create a Python program that will calculate the user’s net pay based on the tax bracket he/she is in. Your program will prompt the user for their first name, last name, their monthly gross pay, and the number of dependents.

The number of dependents will determine which tax bracket the user ends up in. The tax bracket is as follows:

  • 0 – 1    Dependents:    Tax = 20%
  • 2 – 3    Dependents:    Tax = 15%
  • 4+        Dependents:    Tax = 10%

After calculating the net pay, print the name of the user, the monthly gross pay, the number of dependents, the gross pay, the tax rate, and the net pay.

The formula to compute the net pay is: monthly gross pay – (monthly pay * tax rate)


function

Description

read_name()

Reads the name entered, and returns the name.

read_gross_pay()

Reads the gross pay amount, and returns the amount.

read_dependents()

Reads the number of dependents, and returns the number.

compute_tax_rate(dependents)

Computes and returns the tax rate, based on the number of dependents.

compute_net_pay(gross_pay, rate)

Computes and returns the net pay, based on the gross pay and the tax rate.

main()

Main function of the program.

Sample run:

Enter your name: Ron Swanson
Enter your gross pay: $3500
Enter number of dependents: 0

Name:      Ron Swanson
Gross pay: $3500.00
Dependents: 0
Tax rate: 20%
Net Pay: $2800.00

In: Computer Science

(c++)You will be given a data file containing data for 10 students. The format is as...

(c++)You will be given a data file containing data for 10 students. The format is as follows - grades are double precision numbers:

Line 1: Header Information

Line 2: Student Full name

Line 3: Student ID

Line 4: testgrade_1 testgrade_2 testgrade_3 testgrade_4 testgrade_5

Line 5: Student Full name

Line 6: Student ID

Line 7: testgrade_1 testgrade_2 testgrade_3 testgrade_4 testgrade_5

Line 8: Student Full name

Line 9: Student ID

Line 10: testgrade_1 testgrade_2 testgrade_3 testgrade_4 testgrade_5

Etc.

  1. Read the data into appropriate arrays. You do not need to create a dynamic array.

  2. Determine the average of all the grades for each test, and print the test number then the name, student id, and grade for all students who fall below that average.

  3. Determine the average of all the grades for each student.

  4. Determine which student has the highest average grades - print their name and their average

  5. Determine which student has the lowest average grades - print their name and their average

Student Learning Outcomes:

  • Creating and using functions

  • Creating and using non-dynamically allocated arrays - 1-Dimensional and/or 2-Dimensional

  • File input

  • Style

    • Variable Naming

      • Proper variable and function naming (not uppercase to start, descriptive of purpose)

      • Proper constant naming (all capital letters)

    • Comments

      • Programmer name, date, purpose

      • Useful, descriptive comments about program procedures

      • Useful, descriptive comments about function purpose, inputs, and outputs

In: Computer Science

Problem 11-10 Martinez Corporation, a manufacturer of steel products, began operations on October 1, 2016. The...

Problem 11-10

Martinez Corporation, a manufacturer of steel products, began operations on October 1, 2016. The accounting department of Martinez has started the fixed-asset and depreciation schedule presented below. You have been asked to assist in completing this schedule. In addition to ascertaining that the data already on the schedule are correct, you have obtained the following information from the company’s records and personnel.

1. Depreciation is computed from the first of the month of acquisition to the first of the month of disposition.
2. Land A and Building A were acquired from a predecessor corporation. Martinez paid $844,000 for the land and building together. At the time of acquisition, the land had an appraised value of $86,100, and the building had an appraised value of $774,900.
3. Land B was acquired on October 2, 2016, in exchange for 2,600 newly issued shares of Martinez’s common stock. At the date of acquisition, the stock had a par value of $5 per share and a fair value of $28 per share. During October 2016, Martinez paid $15,300 to demolish an existing building on this land so it could construct a new building.
4. Construction of Building B on the newly acquired land began on October 1, 2017. By September 30, 2018, Martinez had paid $307,000 of the estimated total construction costs of $428,900. It is estimated that the building will be completed and occupied by July 2019.
5. Certain equipment was donated to the corporation by a local university. An independent appraisal of the equipment when donated placed the fair value at $38,900 and the salvage value at $2,700.
6. Machinery A’s total cost of $181,800 includes installation expense of $540 and normal repairs and maintenance of $14,400. Salvage value is estimated at $6,500. Machinery A was sold on February 1, 2018.
7. On October 1, 2017, Machinery B was acquired with a down payment of $5,280 and the remaining payments to be made in 11 annual installments of $5,540 each beginning October 1, 2017. The prevailing interest rate was 8%. The following data were abstracted from present value tables (rounded).

Present value
of $1.00 at 8%

Present value
of an ordinary annuity
of $1.00 at 8%

10 years 0.463 10 years 6.710
11 years 0.429 11 years 7.139
15 years 0.315 15 years 8.559


Complete the schedule below. (Round answers to 0 decimal places, e.g. 45,892.)

Assets

Acquisition Date

Cost Salvage

Depreciation Method

Estimated Life in Years

2017 2018
Land A
October 1, 2016
(1)
$___
N/A
N/A
N/A
N/A
N/A
Building A
October 1, 2016
(2)
___
$43,400
Straight-line
(3) ___
$14,616
(4) ___
Land B
October 2, 2016
(5)
___
N/A
N/A
N/A
N/A
N/A
Building B
Under Construction
$307,000 to date
Straight-line
30 __ (6) ___
Donated Equipment
October 2, 2016
(7)
___
2,700
150% declining-balance
10 (8) ___ (9) ___
Machinery A
October 2, 2016
(10)
___
6,500
Sum-of-the-years'-digits
8 (11) ___

(12) ___

Machinery B
October 1, 2017
(13)
___
Straight-line
20 __ (14) ___

In: Accounting

Krogh Lumber: Balance Sheet as of December 31, 2016 (Thousands of Dollars) Cash $1,800 Accounts payable...

Krogh Lumber: Balance Sheet as of December 31, 2016 (Thousands of Dollars)
Cash $1,800 Accounts payable $7,200
Receivables 10,800 Notes payable 3,472
Inventories 12,600 Accrued liabilities 2,520
Total current assets $25,200 Total current liabilities $13,192
Mortgage bonds 5,000
Net fixed assets 21,600 Common stock 2,000
Retained earnings 26,608
Total assets $46,800 Total liabilities and equity $46,800


Krogh Lumber: Income Statement for December 31, 2016 (Thousands of Dollars)
Sales $36,000
Operating costs including depreciation 30,783
Earnings before interest and taxes $5,217
Interest 1,017
Earnings before taxes $4,200
Taxes (40%) 1,680
Net income $2,520
Dividends (60%) $1,512
Addition to retained earnings $1,008
  1. Assume that the company was operating at full capacity in 2016 with regard to all items except fixed assets; fixed assets in 2016 were being utilized to only 64% of capacity. By what percentage could 2017 sales increase over 2016 sales without the need for an increase in fixed assets? Round your answer to two decimal places.
    %

  2. Now suppose 2017 sales increase by 25% over 2016 sales. Assume that Krogh cannot sell any fixed assets. All assets other than fixed assets will grow at the same rate as sales; however, after reviewing industry averages, the firm would like to reduce its operating costs/sales ratio to 80% and increase its total liabilities-to-assets ratio to 42%. The firm will maintain its 60% dividend payout ratio, and it currently has 1 million shares outstanding. The firm plans to raise 35% of its 2017 forecasted interest-bearing debt as notes payable, and it will issue bonds for the remainder. The firm forecasts that its before-tax cost of debt (which includes both short- and long-term debt) is 10.5%. Any stock issuances or repurchases will be made at the firm's current stock price of $40. Develop Krogh's projected financial statements. What are the balances of notes payable, bonds, common stock, and retained earnings? Round your answers to the nearest hundredth of thousand of dollars.
    Krogh Lumber Pro Forma Income Statement December 31, 2017 (Thousands of Dollars)
    2016 2017
    Sales $36,000 $
    Operating costs (includes depreciation) 30,783
    EBIT $5,217 $
    Interest expense 1,017
    EBT $4,200 $
    Taxes (40%) 1,680
    Net Income $2,520 $
    Dividends $1,512 $
    Addition to RE $1,008 $
    Krogh Lumber Pro Forma Balance Statement December 31, 2017 (Thousands of Dollars)
    2016 2017
    Assets
    Cash $1,800 $
    Accounts receivable 10,800
    Inventories 12,600
    Fixed assets 21,600
    Total assets $46,800 $
    Liabilities and Equity
    Payables + accruals $9,720 $
    Short-term bank loans 3,472
      Total current liabilities $13,192 $
    Long-term bonds 5,000
      Total liabilities $18,192 $
    Common stock 2,000
    Retained earnings 26,608
      Total common equity $28,608 $
    Total liab. and equity $46,800 $

In: Accounting

Krogh Lumber: Balance Sheet as of December 31, 2016 (Thousands of Dollars) Cash $1,800 Accounts payable...

Krogh Lumber: Balance Sheet as of December 31, 2016 (Thousands of Dollars)
Cash $1,800 Accounts payable $7,200
Receivables 10,800 Notes payable 3,472
Inventories 12,600 Accrued liabilities 2,520
Total current assets $25,200 Total current liabilities $13,192
Mortgage bonds 5,000
Net fixed assets 21,600 Common stock 2,000
Retained earnings 26,608
Total assets $46,800 Total liabilities and equity $46,800


Krogh Lumber: Income Statement for December 31, 2016 (Thousands of Dollars)
Sales $36,000
Operating costs including depreciation 30,783
Earnings before interest and taxes $5,217
Interest 1,017
Earnings before taxes $4,200
Taxes (40%) 1,680
Net income $2,520
Dividends (60%) $1,512
Addition to retained earnings $1,008

Assume that the company was operating at full capacity in 2016 with regard to all items except fixed assets; fixed assets in 2016 were being utilized to only 65% of capacity. By what percentage could 2017 sales increase over 2016 sales without the need for an increase in fixed assets? Round your answer to two decimal places.
%

Now suppose 2017 sales increase by 25% over 2016 sales. Assume that Krogh cannot sell any fixed assets. All assets other than fixed assets will grow at the same rate as sales; however, after reviewing industry averages, the firm would like to reduce its operating costs/sales ratio to 84% and increase its total liabilities-to-assets ratio to 42%. The firm will maintain its 60% dividend payout ratio, and it currently has 1 million shares outstanding. The firm plans to raise 35% of its 2017 forecasted interest-bearing debt as notes payable, and it will issue bonds for the remainder. The firm forecasts that its before-tax cost of debt (which includes both short- and long-term debt) is 10.5%. Any stock issuances or repurchases will be made at the firm's current stock price of $40. Develop Krogh's projected financial statements. What are the balances of notes payable, bonds, common stock, and retained earnings? Round your answers to the nearest hundredth of thousand of dollars.

Krogh Lumber Pro Forma Income Statement December 31, 2017 (Thousands of Dollars)
2016 2017
Sales $36,000 $?
Operating costs (includes depreciation) 30,783
EBIT $5,217 $?
Interest expense 1,017
EBT $4,200 $
Taxes (40%) 1,680
Net Income $2,520 $?
Dividends $1,512 $?
Addition to RE $1,008 $?


Krogh Lumber Pro Forma Balance Statement December 31, 2017 (Thousands of Dollars)
2016 2017
Assets
Cash $1,800   $?
Accounts receivable 10,800
Inventories 12,600
Fixed assets 21,600
Total assets $46,800 $?
Liabilities and Equity
Payables + accruals $9,720 $?
Short-term bank loans 3,472
Total current liabilities $13,192 $?
Long-term bonds 5,000
Total liabilities $18,192   $?
Common stock 2,000
Retained earnings 26,608
Total common equity $28,608 $?
Total liab. and equity $46,800 $?

In: Accounting

Happy, Inc. is negotiating a loan for expansion purposes and the bank requires audited financial statements....

Happy, Inc. is negotiating a loan for expansion purposes and the bank requires audited financial statements. Before closing the accounting records for the year ended December 31, 2017, Happy's controller prepared the following comparative financial statements for 2017 and 2016:

Happy, Inc.

Balance Sheets

December 31, 2017 and 2016

2017

2016

Cash ......................................

$  550,000

$ 300,000

Investment securities (reported at market;

  cost, $142,000) .........................

  156,000

        0

Accounts receivable .......................

  974,000

  784,000

Allowance for doubtful accounts ...........

  (100,000)

   (64,000)

Inventories ...............................

  850,000

  770,000

Property and equipment ....................

  620,000

  434,000

Accumulated depreciation ..................

  (300,000)

  (242,000)

  Total assets ............................

$2,750,000

$1,982,000

Accounts payable ..........................

$  180,000

$  154,000

Accrued expenses ..........................

  160,000

   40,000

Note payable, 5-year ......................

  600,000

  600,000

Estimated contingent liability ............

  200,000

        0

Common stock, $10 par .....................

  420,000

  420,000

Additional paid-in capital ................

  260,000

  260,000

Retained earnings .........................

   930,000

   508,000

  Total liabilities & owners' equity ......

$2,750,000

$1,982,000

Happy, Inc.

Income Statements

For the Years Ended December 31, 2017 and 2016

2017

2016

Net sales .................................

$3,160,000

$2,500,000

Operating expenses:

Cost of sales .............................

$1,510,000

$1,380,000

Selling & administrative ..................

   984,000

   730,000

Depreciation ..............................

    58,000

    36,000

Estimated loss from lawsuit ...............

   200,000

         0

$2,752,000

$2,146,000

Operating income ..........................

$  408,000

$  354,000

Unrealized gain on investment securities ..

    14,000

         0

Net income ................................

$  422,000

$  354,000

During the audit, the following additional information was obtained:

(a)

The investment portfolio consists of investments in trading securities with a total market value of $156,000 at December 31, 2017. The securities were purchased February 3, 2017, at a cost of $142,000.

(b)

As a result of errors in physical count, inventories were overstated by $30,000 at December 31, 2017.

(c)

On January 2, 2017, the cost of equipment purchased for $80,000 was mistakenly charged to repairs and maintenance. Happy depreciates this type of equipment over a 5-year life using the straight-line method, with no residual or salvage value.

(d)

Happy was named as a defendant in a lawsuit in October 2017. Happy's counsel is of the opinion that Happy has a good defense and does not anticipate any impairment of Happy's assets or that any significant liability will be incurred. However, Happy's counsel admits that loss of the suit is "possible." Happy's management wished to be conservative and established a loss contingency of $200,000 at December 31, 2017.

(e)

On January 24, 2016, before the 2017 financial statements were issued, Happy was notified that one of its largest customers had filed for bankruptcy as the result of a flood that destroyed a substantial portion of the company's assets on January 16, 2016. The customer's accounts receivable balance at December 31, 2017, was $144,000.

(f)

$100,000 of 5-year notes payable will mature September 30, 2016. In view of Happy's plans for expansion, management is seriously considering refinancing the notes when they become due.

*

Prepare a properly classified balance sheet for Happy, Inc., as of December 31, 2017. (Income tax considerations should be ignored.)

*

Identify the events and other information that should be disclosed in the notes to Happy’s financial statements. (Do not prepare the notes.)

In: Accounting

P12-3A Journalize transactions and adjusting entry for stock investments. On December 31, 2015, Turnball Associates owned...

P12-3A Journalize transactions and adjusting entry for stock investments.
On December 31, 2015, Turnball Associates owned the following securities, held as a long-term
investment. The securities are not held for influence or control of the investee.
Common Stock Shares Cost
Gehring Co. 2,000 $60,000
Wooderson Co. 5,000 45,000
Kitselton Co. 1,500 30,000
On December 31, 2015, the total fair value of the securities was equal to its cost. In 2016,
the following transactions occurred.
July 1 Received $1 per share semiannual cash dividend on Wooderson Co. common stock.
Aug. 1 Received $0.50 per share cash dividend on Gehring Co. common stock.
Sept. 1 Sold 1,500 shares of Wooderson Co, common stock for cash at $8 per share.
Oct. 1 Sold 800 shares of Gehring Co. common stock for cash at $33 per share.
Nov. 1 Received $1 per share cash dividend on Kitselton Co. common stock.
Dec. 15 Received $0.50 per share cash dividend on Gehring Co. common stock.
Dec 31 Received $1 per share semiannual cash dividend on Wooderson Co. common stock.
At December 31, the fair values per share of the common stocks were Gehring Co. $32,
Wooderson Co. $8, and Kitselton Co. $18.
Instructions
(a) Journalize the 2016 transactions and post to the account Stock Investments. (Post in
       T-account form.)
(b) Prepare the adjusting entry at December 31, 2016, to show the securities at fair value.
        The stock should be classified as available-for-sale securities.
(c ) Show the balance sheet presentation of the investment-related accounts at December 31,
        2016. At this date, Turnball Associates has common stock $1,500,000 and retained
        earnings $1,000,000.
NOTE: Enter a number in cells requesting a value; enter either a number or a formula in cells with a "?" .
(a) 2016
July 1 Account Value
Account Value
Aug 1 Account Value
Account Value
Sept. 1 Account Value
Account Value
Account Value
Oct.1 Account Value
Account Value
Account Value
Nov. 1 Account Value
Account Value
Dec. 15 Account Value
Account Value
Dec. 31 Account Value
Account Value
Stock Investments
2016 2016
Jan. 1 Balance Value Sept. 1   Value
Oct. 1 Value
2016
Dec. 31 Balance Value
(b) Dec.31 Account Value
Account Value
Security Cost Fair Value
Gehring Co. Value Value
Wooderson Co. Value Value
Kitselton Co. Value Value
? ?
(c) Investments
        Investments in stock of less than 20%
     owned companies, at fair value Value
Stockholders' equity
    Common stock Value
     Retained earnings Value
          Total paid-in capital and retained earnings ?
     Less: Unrealized loss on available-for-sale securities Value
           Total stockholders' equity ?
After you have completed P12-3A, consider the additional question.
1. Assume that number of shares of Wooderson Co. sold changed to 2,000 shares.
Show impact on the journal entries and presentation in balance sheet.

Please make it typed.

In: Accounting