Questions
Summarize 3 examples of how empirical evidence and relevant criminological theory are guiding problem solving during...

Summarize 3 examples of how empirical evidence and relevant criminological theory are guiding problem solving during the Corona virus event. Cite sources in your discussion

In: Psychology

A certain mineral used as a food preservative contains 8.242 % potassium, 5.687% aluminum, 5.099% hydrogen,...

A certain mineral used as a food preservative contains 8.242 % potassium, 5.687% aluminum, 5.099% hydrogen, 67.45 % oxygen and 13.52 % sulfur. What is the empirical formula for this compound?

In: Chemistry

What are the assumptions and predictions of the pecking order theory? Why do empirical studies generally...

What are the assumptions and predictions of the pecking order theory? Why do empirical studies generally find in a negative abnormal stock return upon the announcement of an equity issue?

In: Finance

Using Marx’s theory of competition do you think that the U.S. is competitive or is there...

Using Marx’s theory of competition do you think that the U.S. is competitive or is there a new stage of monopoly capitalism? Start by explaining Marx’s view and then review the empirical evidence.

In: Economics

It has been argued in the finance literature that great majority of mergers lead to value...

It has been argued in the finance literature that great majority of mergers lead to value destruction. Citing empirical evidence, discuss whether you agree or disagree with this statement.

In: Finance

Proponents of fixed exchange rates would find the most support for their position in which one...

Proponents of fixed exchange rates would find the most support for their position in which one of the following empirical results regarding the relationship between exchange rate variations and the volume of international trade? (Assume that the empirical tests adequately account for other factors that influence the volume of trade.)

Select one:

a. no discernible relationship between exchange rate variations and the volume of trade

b. a negative relationship between exchange rate variations and the volume of trade

c. a mildly positive relationship between exchange rate variations and the volume of trade

d. a strongly positive relationship between exchange rate variations and the volume of trade

In: Economics

The Clausius-Clapeyron equation and the Antoine equation. The vapor pressure of a liquid can be written...

The Clausius-Clapeyron equation and the Antoine equation. The vapor pressure of a liquid can be written in the empirical form known as the Antoine equation, ln (p / p ◦ ) = A1 − (A2 /(T + A3)) where A1, A2, and A3 are empirical constants determined from measurements, and T is the temperature in Kelvin.

(a) Starting with this equation, derive an equation for the enthalpy of vaporization as a function of temperature.

(b) For ethanol (l), A1 = 23.58, A2 = 3.67 × 103 , A3 = −46.702, and p ◦ = 1 Pa. Given that the standard pressure is 1 bar = 1.01325 × 105 Pa, what is the standard boiling temperature?

(c) Calculate ∆h at 298 K and at the standard boiling temperature.

In: Chemistry

Python using sqllite3 package In this exercise, your task is to inspect the given database, which...

Python using sqllite3 package

In this exercise, your task is to inspect the given database, which is called 'chinook.db', as you can see from the testing code below in the example. We first would like to know how the logical schema of the database looks like, in order to work with it later in terms of reading from and writing to the database. Please also note that a software tool like "DB Browser for SQLite" can be used to inspect and modify an SQLite database file like 'chinook.db'.

To solve this exercise you have to write a function get_table_information_from_database(database_filename), which returns a dictionary that has all the available table names as its keys, and a list of the column names for the respective table as its values. The column names are the second entries in the record returned from the "PRAGMA table_info" SQL statement given below.

Regarding the structure of this code, you have to make sure that the Python sqlite3 package is first imported. Using the connect method from this package, a database connection can be opened. This connection uses the concept of a cursor object to send SQL statements to the database in the form of strings. In case the SQL string represents a query, the cursor.execute method returns a result containing the result of this query. This result is a list and can be inspected here in this question for the logical schema information.

The necessary SQL statements you need are:

  • "SELECT name FROM sqlite_master WHERE type='table'"
  • and for each table, identified by a string 'table_name': "PRAGMA table_info('table_name')"

Attention: Please ignore table names that start with the substring "sqlite" from the query result, since these are internal tables, which in general should not be used by an application!

Don't forget to close the database connection after you are finished accessing the database!

Please have a look at the examples in the lecture slides for lecture 15 to see examples of SQLite being used. Additionally, you may want to look up more information on the web page for Python's SQLite API here. SQL statements are simply strings, which can be concatenated using string literals and string variables.

Note: As always, it is a good idea to work on this example using your favourite IDE first (download the database file), before you enter it into coderunner. This way you can more easily debug your code!

For example:

Test Result
database_filename = 'chinook.db'
metadata_dictionary = get_table_information_from_database(database_filename)

for table in sorted(metadata_dictionary.keys()):
   print("{}: {}".format(table, metadata_dictionary[table]))
albums: ['AlbumId', 'Title', 'ArtistId']
artists: ['ArtistId', 'Name']
customers: ['CustomerId', 'FirstName', 'LastName', 'Company', 'Address', 'City', 'State', 'Country', 'PostalCode', 'Phone', 'Fax', 'Email', 'SupportRepId']
employees: ['EmployeeId', 'LastName', 'FirstName', 'Title', 'ReportsTo', 'BirthDate', 'HireDate', 'Address', 'City', 'State', 'Country', 'PostalCode', 'Phone', 'Fax', 'Email']
genres: ['GenreId', 'Name']
invoice_items: ['InvoiceLineId', 'InvoiceId', 'TrackId', 'UnitPrice', 'Quantity']
invoices: ['InvoiceId', 'CustomerId', 'InvoiceDate', 'BillingAddress', 'BillingCity', 'BillingState', 'BillingCountry', 'BillingPostalCode', 'Total']
media_types: ['MediaTypeId', 'Name']
playlist_track: ['PlaylistId', 'TrackId']
playlists: ['PlaylistId', 'Name']
tracks: ['TrackId', 'Name', 'AlbumId', 'MediaTypeId', 'GenreId', 'Composer', 'Milliseconds', 'Bytes', 'UnitPrice']

given start code

import sqlite3

def get_table_information_from_database(database_filename):
pass

In: Computer Science

The following are the information for Chun Equipment Co. for 2018. (Hint: Some of the items...

The following are the information for Chun Equipment Co. for 2018. (Hint: Some of the items will not appear on either statement, and ending retained earnings must be calculated.)

Salaries expense $ 122,420 Interest receivable (short term) $ 640
Common stock 52,000 Beginning retained earnings 51,193
Notes receivable (short term) 16,150 Operating expenses 94,060
Allowance for doubtful accounts 6,980 Cash flow from investing activities (103,210 )
Accumulated depreciation 34,800 Prepaid rent 13,900
Notes payable (long term) 123,360 Land 47,400
Salvage value of equipment 6,670 Cash 24,050
Interest payable (short term) 2,530 Inventory 161,560
Uncollectible accounts expense 13,920 Accounts payable 57,290
Supplies 3,130 Interest expense 32,450
Office equipment 78,930 Salaries payable 11,190
Interest revenue 5,600 Unearned revenue 59,760
Sales revenue 519,590 Cost of goods sold 186,013
Dividends 12,000 Accounts receivable 112,530
Rent expense 5,140

Required

Prepare a multistep income statement and balance sheet for Chun Equipment Co. for 2018.

Prepare a multistep income statement for Chun Equipment Co. for 2018.

CHUN EQUIPMENT CO.
Income Statement
For the Year Ended December 31, 2018
Sales revenue
Cost of goods sold
Gross margin
Operating expenses
Operating expenses
Rent expense
Salaries expense
Total operating expenses 0
Operating income
Non-operating Items
Interest expense
Interest revenue
Total non-operating items 0
Net income

Prepare the balance sheet for Chun Equipment Co. for 2018. (Be sure to list the assets in the order of their liquidity.)

CHUN EQUIPMENT CO.
Balance Sheet
As of December 31, 2018
Assets
Current assets
Cash
Less: Allowance for doubtful accounts 0
Interest receivable
Inventory
Prepaid rent
Supplies
Notes receivable
Total current assets $0
Property, plant and equipment
Office equipment
Less: Accumulated depreciation 0
Land
Total property, plant and equipment 0
Total assets $0
Liabilities and stockholders’ equity
Current liabilities
Accounts payable
Interest payable
Salaries payable
Unearned revenue
Total current liabilities $0
Long-term liabilities
Notes payable
Total long-term liabilities 0
Total liabilities 0
Stockholders’ equity
Common stock
Retained earnings
Total stockholders’ equity 0
Total liabilities and stockholders’ equity $0

In: Accounting

Consider the following code: import java.util.Scanner; public class Main {    public static void main(String[] args)...

Consider the following code:

import java.util.Scanner;

public class Main {

   public static void main(String[] args) {

   Scanner in = new Scanner(System.in);

String input = "";

System.out.println("Enter the first number: ");
  
input = in.nextLine();
int a = 0;
int b = 0;
  
a = Integer.parseInt(input);
  
System.out.println("Enter the second number: ");
input = in.nextLine();
  
b = Integer.parseInt(input);
  
int result = 0;

result = a/b;
  
System.out.println("a/b : " + result);

   }


Copy the code to your Main.java file and run it with the following inputs:
34 and 0;
‘Thirty-four’ as the first input.

What prevented the program from running successfully?

Update the code, so that it can handle cases a) and b).

Please note the following:
You have to use try-catch to handle exceptions.
To determine exception classes, that you need to catch, use error message from the respective case (a) and b)). Hint: to handle String-to-integer conversion, use NumberFormatException;
Exceptions should be caught so that:
Code never crashes due to non-numeric input (both for first and second values);
Code never crashes due to division by zero;
If non-numeric value is entered for a or b, program should output "Error: entered value is not an integer number. Exiting..." and exit (use System.exit(0); to exit);
If zero value is entered for b, program should output " Error: cannot divide by zero. Exiting..." and exit (use System.exit(0); to exit);
Hints: Use 3 try-catch blocks in total. Try block should only contain the command, that can throw an exception.

In: Computer Science