Questions
Given is a Python program that connects to a sqlite database and has one table called...

Given is a Python program that connects to a sqlite database and has one table called writers with two columnns:

  • name - the name of a writer
  • num - the number of works the writer has written

The writers table originally has the following data:

name, num

Jane Austen,6

Charles Dickens,20

Ernest Hemingway,9

Jack Kerouac,22

F. Scott Fitzgerald,8

Mary Shelley,7

Charlotte Bronte,5

Mark Twain,11

Agatha Christie,73

Ian Flemming,14

J.K. Rowling,14

Stephen King,54 Oscar Wilde,1

Update the Python program to ask the user if they want to update entries or add new entries. If the name entered already exists in the writers table then the database record is updated, overwriting the original contents. If the name does not exist in the writers table, then add a new record with the writer's name and number of works. The following TODO sections must be completed.

  • Check if a writer exists in the writers table
  • If the writer exists in the table, locate an entry to be updated by writer's name and update the writer's value for num
  • If the writer does not exist in the table, add a new entry in the writers table and provide the value for name and num

Ex: If the input is:

y

J.K. Rowling 30

y

Elton John

y

62

n

What is output. Getting nothing but errors with existing help. Again, this is for Python3

In: Computer Science

Please provide step by step detailing on how i should do this assignment. In Angel, you...

Please provide step by step detailing on how i should do this assignment. In Angel, you will find a class called Employee. This class should include a constructor which sets name to blanks and salary to $0.00 and a constructor which sets name to a starting name and salary to a set amount. Additionally, the class should include methods to set the name and salary and return the name and salary. Create another method to return the name and salary nicely formatted as a string (hint – research the toString method). You will create a new class called Manager that inherits from the class Employee. Add a field named department of type String. Supply a method toString that prints the manager's name, department, and salary. Remember, you may not change anything in the Employee class. You will then create a test class that uses the Manager class. The test class should prompt the user to enter name, department and salary. This information should be stored in an array. Upon entry of 3 employee records, the program should output the information you entered. Your program should be able to handle a maximum of 3 entries. You may write the program as a console application or using dialog boxes. Also, please provide explanation on how to create each class on java eclipse so that the code can run successfully. Please provide description for everything, I’m a beginner trying to do this assignment.

In: Computer Science

Consider the following relational database schema:             employee(employee-name, employee-id, street, e-city)             works(employee-

Consider the following relational database schema:

            employee(employee-name, employee-id, street, e-city)

            works(employee-id, company-id, salary)

            company(company-name, company-id, c-city)

            manages(employee-id, manager-id)

Specify the following queries on this database schema using the relational operators we discussed in class. Write your answers on a separate sheet of paper in the order that they are specified below.

  1. Retrieve the name and address of employees who work for First Bank Corporation.
  1. Retrieve the name, street address, and city of residence of all employees who work for Thrifty Industries and earn more than $10,000 per year.

  1. Retrieve the name of all employees who live in the same city as the company for which they work.

  1. Retrieve the name of all employees who live on the same street and in the same city as do their managers.

  1. Retrieve the name of all employees who do not work for First Bank Corporation.

  1. Retrieve the name of all employees who earn more than every employee of Small Bank Corporation.

  1. (Assume that companies may be located in several cities) Retrieve all companies located in every city in which Thrifty Industries is located.

  1. For each company, find the average salary of employees working for that company.

  1. For each city, find the number of employees who work for at least one company in that city.

In: Computer Science

1)  Write a python program that opens a file, reads all of the lines into a list...

1)  Write a python program that opens a file, reads all of the lines into a list of strings, and closes the file. Use the Readlines() method. Test your programing using the names.txt file provided.
2) Convert the program into a function called loadFile, that receives the file name as a parameter and returns a list of strings.
3) Write a main routine that calls loadFIle three times to load the three data files given into three lists. Then choose a random element from the title list, two from the name list, and one from the descriptor list to generate a name. Print the name be in the form shown (you have to add the "the"):
title name name the descriptor
For example:
King Ludovicus Botolf the Bowman
Print the name to the screen.   
Submit your python file (.py) to Sakai

Part 2: Writing Files (Optional Extra Credit 20 pts)
Modify the program to generate 10 names and store them in a list.
Write a function, dumpFile that writes the list to a file called "CharacterNames.txt" There should be one Character Name on each line in the file.
Test the program to be sure it works

Im stumped at number 2

here is what i have for number 1



f = open('names.txt', 'r')
lines = f.readlines()
for line in range(len(lines)):
lines[line] = lines[line].rstrip()
print(lines)
f.close()

In: Computer Science

Create a for which will have the following controls. 1. Label for First Name and TextBox...

Create a for which will have the following controls.

1. Label for First Name and TextBox for the First Name

2. Label for Last Name and TextBox for the Last Name

3. Label for bank account balance and TextBox for the bank account balance (assume $1000 in the bank account)

4. Create a button Name. The user will click the button and the first name and last name will be displayed on the label. You will create a label called lblFirstLastName to display the First and last Name.

5. Create a button bankbalance. The user will click the button and the balance will be displayed on the label. You will create a label called lblBankbalance to display the bank balance.

6. Create a Cancel button to cancel the form

------------------------------------------------------------------------------------------------

package swing;
import javax.swing.*;
public class SwingInheritance extends JFrame
{
   private static final long serialVersionUID = 1L;
   SwingInheritance()
   {
       JTextField userName = new JTextField();
       //userName.setBounds(x, y, width, height);
       userName.setBounds(80,100,100, 40);
       userName.setText("Hello");
       JLabel lblText = new JLabel();
       lblText.setBounds(80,150,300, 40);
       lblText.setText("You Entered: " + userName.getText());
       JButton button=new JButton("click");
       //create button
       button.setBounds(80,200,100, 40);
       JButton close = new JButton("Close");
       close.setBounds(80,250,100, 40);
       close.addActionListener(e ->
       {
           dispose();
       });
       //add to JFrame
       add(button);
       add(close);
       add(userName);
       add(lblText);
       //set frame properties
       setSize(400,500);
       setLayout(null);
       setVisible(true);
       }
   public static void main(String[] args)
   {
       new SwingInheritance();
   }
}

In: Computer Science

JAVA Program Create a class called SoccerPlayer Create 4 private attributes: First Name, Last Name, Games,...

JAVA Program

Create a class called SoccerPlayer

Create 4 private attributes: First Name, Last Name, Games, and Goals

Have two constructors

Constructor 1 – default constructor; all values to "NONE" or zero

Constructor 2 – accepts input of first name, last name, games and goals.

Create get and set methods for each of the four attributes

Create a method the returns a double that calculates the average goals per game

This method checks for zero games played:

If there are zero played, display an error and set average to 0;

If greater than zero, do the math and set average to result of calculation

Create a test program that allows you to set the first name, last name, number of games and number of goals. Call it SoccerPlayerTest.

Create two instances of players.

The first should use the default constructor and the set methods to fill the attributes

The second should use the other constructor to set the attributes

Display the info about the players including the average goals per game.

Use the same SoccerPlayer class you created in CE-SoccerPlayer

Create a test program that allows you to enter in the first name, last name, number of games and number of goals. Call it SoccerPlayerTest.

Create an array of players. There should be three players.

Create a loop and ask for the information about each player.

Create a loop and display the info about the players including the average goals per game

In: Computer Science

2. Write python code for the below instructions (don’t forget to use the keyword “self” where...

2. Write python code for the below instructions (don’t forget to use the keyword “self” where appropriate in your code):

A. Define a Parent Class called Person

a. Inside your Person class, define new member variables called name, age, and gender.   Initialize these variables accordingly.

b. Define the constructor to take the following inputs: name, age, and gender.   Assign these inputs to member variables of the same name.

B. Define Child Class called Employee that inherits from the Person Class

a. Inside your Child class, define new member variables called title and salary.   Initialize these variables accordingly.

b. Define the constructor to take the following inputs: name, age, gender, title, and salary.   Assign these inputs to Class member variables of the same name. Note, you will need to specifically call the Parent constructor method inside the Child constructor, passing the appropriate inputs to the Parent constructor.

C. Instantiate an Employee object called George with the following inputs: name = “George”, age = 30, gender = “Male”, title = “Manager”, and salary = 50000.

D. Print out the object’s name, age, gender, title, and salary in one print statement to the console window. Your output should look like:

“George's info is: Name is George, Age is 30, Gender is Male, Title is Manager, and Salary is 50000”

In: Computer Science

Solve the following questions in excel using the skills from class. Lindner is considering an investment...

  1. Solve the following questions in excel using the skills from class.
  1. Lindner is considering an investment with an initial cost of $122,400 and salvage value of 63,600 with the following cash flows over the next 6 years:

Year

Cash flow

1

$28,750

2

$19,500

3

$44,100

4

$27,900

5

$15,850

6

$13,050

The discount rate is 14.8%. Find the NPV and IRR, what is the decision and what was the criteria for each rule?

  1. You want to analyze the impact of a new project that will cause its cash flows to increase 12,000 over last year’s, and continue to grow at a constant rate of 7% per year for the foreseeable future. The discount rate is 13.5%. Analyze the project in three ways:
    1. Calculate the NPV and IRR of this project based on an initial investment cost of $97,000 and the change in cash flows each year, assuming the growth continues forever.
    2. Find the NPV and IRR of this project if the project only generates cash flows for 17 years.
    3. Use an embedded function in Excel to calculate the NPV of the project if the cash flows had zero growth, and the project only generates cash flows for 35 years.

UC Inc. has predicted unlevered free cash flows (FCF) of $19,800, $21,540, $25,300, and $28,900 for the next 4 years. Find the average growth rate using the predicted values. Then, assuming the growth rate persists forever at this rate, find the present value of the terminal value. Finally, find the total enterprise value. The discount rate is 18%.

In: Finance

Using the information below, complete the tax form 1040 above. Brian and Sheila Williams were married...

Using the information below, complete the tax form 1040 above.

Brian and Sheila Williams were married in October of 2008. They live at 1000 Main Street, Atlanta, GA 33127. Brian is a postal service worker. Sheila is a teacher at Grady High School. Brian’s social security number is 555-11-1111 and Sheila’s social security number is 555-22-2222. They have a dependent daughter Jayla who is 10 years old (Born on May 12th). Jayla’s social security number is 555-33-3333. In 2016, Brian's wages was $45,860 while Sheila's was $43,590.

Included or Excluded Items
Two years ago, the taxpayer loaned a friend $2000. The friend has filed for bankruptcy this year and will not be able to repay
Earned $100 interest on county municipal bonds
Found a diamond worth $1000 on the ground
Received $500 in death benefits fron Brian's father
Received $4,000 court settlement. $1,000 was punitive damanges.
Brian paid $400/month in child support
Received a $1000 gift from his brother
Sheila won $100 playing bingo
Brian paid $200/month in alimony to his ex-wife
Sheila received a $1000 gift from her mother
Sheila spent $300 on supplies for her classroom
Portfolio Investments
Stock Acquired Sold Sales Price Cost (Basis) Qualified Dividends
Red Stock 2/1/2016 10/5/2016 $6,000 $2,500 $0
White Stock 6/11/2009 10/15/2016 $5,000 $4,000 $100
Blue Stock 10/1/2005 8/3/2016 $2,000 $10,000 $0
Black Stock 3/6/2016 12/15/2016 $3,000 $5,000 $0
Yellow Stock 4/5/2006 N/A N/A $5,000 $300
Interest Income Source Amount
Money Market Account $200
Savings Account $25
State Municipal Bonds $35
Rental Property
They own and rent two pieces of residential real estate in Miami, FL. These properties were acquired with cash (so there are no mortgages on the homes). They both have real estate broker licenses in Georgia and Florida. They dedicate enough hours (through their business) to qualify as a “real estate professional” with regard to these properties.
Property 1
The first property is located at 17750 NW 17th Ave, Miami, FL. They collect $1,000 monthly in rent. The property was purchased June 30, 2016 for $150,000. The tax records show that the value of the land is $30,000 and the value of the home was $90,000 when purchased. They actively participate in the management of the real property.
The property has the following expenditures:
Property tax $7,000/yr
Repairs $   900/yr
Insurance $1,200/yr
Washing Machine $300 (purchased 6/2/2015)
Refrigerator $700 (purchased 7/1/2016)
Furniture $2,000 (purchased 4/1/2014)
Property 2
The second property is located at 5610 NW 11th Ave, Miami, FL. They collect $1,500 monthly in rent. The property was purchased on June 12, 2016 for $100,000. The tax records show that the value of the land is $20,000 and the value of the home was $80,000 when purchased. They actively participate in the management of the real property.
The property has the following expenditures:
Property tax $6,200/yr
Repairs $3,000/yr
Insurance $1,200/yr
Legal fees $   500/yr
Advertising Expense $   500/yr

In: Advanced Math

Tru Developers, Inc., sells plots of land for industrial development. Tru recognizes income for financial reporting...

Tru Developers, Inc., sells plots of land for industrial development. Tru recognizes income for financial reporting purposes in the year it sells the plots. For some of the plots sold this year, Tru took the position that it could recognize the income for tax purposes when the installments are collected. Income that Tru recognized for financial reporting purposes in 2016 for plots in this category was $60 million. The company expected to collect 60% of each sale in 2017 and 40% in 2018. This amount over the next two years is as follows:

  
  2017 $ 36 million   
  2018 24 million  
  
$ 60 million  
  

Tru’s pretax accounting income for 2016 was $105 million. In its income statement, Tru reported interest income of $10 million, unrelated to the land sales, for which the company’s position is that the interest is not taxable. Accordingly, the interest was not reported on the tax return. There are no differences between accounting income and taxable income other than those described above. The enacted tax rate is 40 percent.

     Management believes the tax position taken on the land sales has a greater than 50% chance of being upheld based on its technical merits, but the position taken on the interest has a less than 50% chance of being upheld. It is further believed that the following likelihood percentages apply to the tax treatment of the land sales ($ in millions):

Amount Qualifying for
Installment Sales Treatment
Percentage Likelihood of
Tax Treatment Being Sustained
$ 60 20 %
50 20 %
40 20 %
30 20 %
20 20 %
Required:
  1.

What portion of the tax benefit of tax-free interest will Tru recognize on its 2016 tax return? (Enter your answers in millions (i.e., 10,000,000 should be entered as 10).)

           

  2.

What portion of the tax benefit of tax-free interest will Tru recognize on its 2016 financial statements?(Enter your answers in millions (i.e., 10,000,000 should be entered as 10).)

           

3-1.

What portion of the tax on the $60 million income from the plots sold on an installment basis will Tru defer on its 2016 tax return? (Enter your answers in millions (i.e., 10,000,000 should be entered as 10).)

           

3-2.

What portion of the tax on the $60 million income from the plots sold on an installment basis will Tru defer in its 2016 financial statements? (Enter your answers in millions (i.e., 10,000,000 should be entered as 10).)

           

  4.

Prepare the journal entry to record income taxes in 2016 assuming full recognition of the tax benefits in the financial statements of both differences between pretax accounting income and taxable income. (If no entry is required for a transaction/event, select "No journal entry required" in the first account field. Enter your answers in millions (i.e., 10,000,000 should be entered as 10).)


Record 2016 income taxes.

Note: Enter debits before credits.

Event General Journal Debit Credit
1
5.

Prepare the journal entry to record income taxes in 2016 assuming the recognition of the tax benefits in the financial statements you indicated in requirements 1-3. (If no entry is required for a transaction/event, select "No journal entry required" in the first account field. Enter your answers in millions (i.e., 10,000,000 should be entered as 10).)

Record 2016 income taxes.

Note: Enter debits before credits.

Event General Journal Debit Credit
1

  

In: Accounting