Questions
You would like to build a classifier for an Autism early detection application. Each data point...

You would like to build a classifier for an Autism early detection application. Each data point in the dataset represents a patient. Each patient is described by a set of attributes such as age, sex, ethnicity, communication and development figures, etc. You know from domain knowledge that autism is more prevalent in males than females.

If the dataset you are using to build the classifier is noisy, contains redundant attributes and missing values. If you are considering a decision tree classifier and a k-nearest neighbor classifier, explain how each of these can handle the three mentioned problems:

1. Noise

2. Missing Values

3. Redundant Attributes

In: Computer Science

Please explain all answers 1) Phenol was the first antiseptic. It has the chemical composition 76.57%...

Please explain all answers

1) Phenol was the first antiseptic. It has the chemical composition 76.57% C, 6.43% H, 17.00% O. The molecular weight of phenol was determined by mass spectroscopy to be 94.114 g/mol. What is the molecular formula for phenol?

2) A 3.5514 g of a chromium oxide was found to contain 2.4299 g of chromium and 1.1215 g oxygen. What is the empirical formula for this chromium oxide?

3) Phosphoric acid is produced by the reaction of calcium phosphate, Ca3(PO4)2, with sulfuric acid. How much phosphoric acid can one make from exactly one US ton (2000 lbs) of calcium phosphate?

In: Chemistry

Suppose there are three users: DBA, user1, user2, user3. Please specify whether user1, user2, user3 have...

Suppose there are three users: DBA, user1, user2, user3. Please specify whether user1, user2, user3 have update privilege on checking and saving table after execution of the following SQL statements.


DBA:
Grant update on checking to user1 with grant option;
Grant update on checking to user2 with grant option;
Grant update on saving to public;
Grant update on saving to user2 with grant option;
User1:
Grant update on checking to user3;
User 2:
Grant update on checking to user3;
Grant update on saving to user3;
DBA:
Revoke update on checking from user1;
Revoke update on saving from public;

In: Computer Science

Based on the following information from Finco’s Financial statements, confirm that the Cash Flow Identity holds....

Based on the following information from Finco’s Financial statements, confirm that the Cash Flow Identity holds.

Balance Sheet

Current Accounts

◦        2018: CA = 1500; CL = 1300

◦        2019: CA = 2000; CL = 1700

Fixed Assets

◦        2018: NFA = 3000; 2019: NFA = 4000

LT Liabilities and Equity

◦        2018: LTD = 2200; Common Equity = 500; RE = 500

◦        2019: LTD = 2800; Common Equity = 750; RE = 750

Income Statement

◦        EBIT = 2700; Interest Expense = 200; Taxes = 1000; Dividends = 1250

◦        Depreciation = 300

In: Accounting

TITLE Updating Accounts Using Doubly Linked List TOPICS Doubly Linked List DESCRIPTION General Write a program...

TITLE

Updating Accounts Using Doubly Linked List

TOPICS

Doubly Linked List

DESCRIPTION

General

Write a program that will update bank accounts stored in a master file using updates from a transaction file. The program will maintain accounts using a doubly linked list.

The input data will consist of two text files: a master file and a transaction file. See data in Test section below.  The master file will contain only the current account data. For each account, it will contain account id, first name, last name and the current balance. The transaction file will contain updates. Each update will consist of an account id, first name, last name and a plus or minus balance update. A plus update value will indicates a deposit and minus a withdrawal.

Building List

At the beginning, the program will input account data from the master file and build a doubly linked list. Each node in the list will contain data relating to one account and the whole list will be kept sorted by account id.

For building the list, the program will input account information from the master file one account at a time.  It will create a node containing the account data and add it to the list at the appropriate position in the list so that the list will remain sorted in ascending order by account id.

Updating List

After the list is built as described above, the program will read updates from the Update file and update the list accordingly. It will input one account update at a time and update the list using this update before inputting the next update.

For moving from account to account during updates, it will use a global cursor. For each update, it will determine  whether the target account is in the forward or backward direction from the current position. It will then move the cursor in the appropriate direction using either the forward or backward links of the doubly linked list. It will move the cursor till it reaches the target account or an account past the target account (in the case that the target account does not exist).

Depending upon the account id provided in the update, the program will do one of the following:

·       If the account specified in the update is not found in the list, it will create a new account, initialize its fields with the values in the update and insert it in the list at appropriate position so that the list will remain sorted in ascending order by account id.

·       If the account specified in the update is found in the list, it will update its current balance according to the plus or minus value specified in the update (i.e. it will add a plus value and subtract a minus value).

·       On completing the update, if an account balance becomes 0 or negative, the program will delete that account.

Logging Update

Before starting any updates, the program will log the following to the log file:

·       It will log the contents of the whole doubly linked list.

Then for each update, it will log the following information to the log file:

·       Before the update, it will log a line containing the contents of the update to be performed.

·       After the update, it will log the contents of the whole doubly linked list.

For logging the contents of an update, it will output one line of text containing account id, account name and the update value.

For logging the contents of the whole doubly linked list, it will output one line for each account containing account id, account name and account balance.

For the contents of a sample log file, see the Sample Log File section. It contains the partial contents of a sample log file.

New Master File

When all updates are completed, the program will save the contents of the updated linked list to a new master file. (Do not save the link values).

IMPLEMENTATION

Implement the account list using a Circular Doubly Linked List with a Dummy Node.

Account Id

Use a long for account id.

Circular Doubly Linked List With A Dummy Node

Implement the list for keeping the account as a Circular Doubly Linked List with a Dummy Node.

In a Circular Dummy Node implementation of a doubly linked list, the head points to a dummy node. The dummy node looks like any other node but its data fields do not contain any useful values. It’s forward link points to the first node in the list and back link points to the last node in the list. Initially, in an empty list, both its forward and back links points to itself (i.e. to the dummy node).

For doing a sorted insertion in such a list, do the following. Point the insertion pointer to the first real node. Move the insertion pointer forward as needed, till you reach the Point Of Insertion Node. (The Point Of Insertion Node is that node before which you intend to insert the new node) After the insertion pointer is at the Point of Insertion Node, insert the new node just before it. In performing the insertion, only the links in the Point Of Insertion node and the links in the node that is one before the Point Of Insertion node will change. Links in other nodes will not change.

Because of the presence of a dummy node and the circular nature of the list, in all insert cases, there will always exist a node (either a real or dummy node ) before the Point of Insertion node. It will be the links of this node and that of the Point of Insertion node that will change. Therefore, the code for inserting a new node will be the same in all cases including: empty list, head insertion, mid insertion and end insertion. For each of these cases, the point of insertion node and the node prior to the Point of Insertion Node are listed below:

·       For an empty list, both point of insertion node and the node prior to the point Of insertion node are the same namely the dummy node.

·       For a head insertion, the point of insertion node is the first node and the node prior to the point of insertion node is the dummy node.

·       For a mid insertion, the point of insertion node is a real node before which the new node is being inserted and the node prior to the point of insertion node is another real node after which the new node is being inserted.

·       For end insertion, the point of insertion node is the dummy node and the node prior to the point of insertion node is a real node after which the new node is being inserted.

In all of the above case, both the point of insertion node and the node prior to the point of insertion node are identical in format and have the same format as all other nodes. Therefore, the code for inserting a node in all of the above cases is the same.

Doubly Linked List Class

Create a class to encapsulate circular doubly linked list with a dummy node and to provide the following.

Global Cursor

Provide a global cursor (pointer) that points to a working account. This cursor will be used during updates.

Building Initial List

Provide a method for building a linked list while reading from the master file. The algorithm for this method is provided later below.

Updating List

Provide a method for performing updates while reading from the transaction file. For doing an update, move the global cursor forwards or backwards as needed from account to account till you either reach the target node or a node past that node. Then carry out the required update (update, insert or delete). The algorithm for this method is provided later below

TESTING

Test Run 1

Use the following file contents for a test run.

Master File Contents (master.txt)

27183 Teresa Wong 1234.56

12345 Jeff Lee 211.22

31456 Jack Smith 1200.00

14142 James Bond 1500.00

31623 Norris Hunt 1500.00

10203 Mindy Ho 2000.00

20103 Ed Sullivan 3000.00

30102 Ray Baldwin 3824.36

30201 Susan Woo 9646.75

22345 Norma Patel 2496.24

Transaction File Contents (tran.txt)

31623 Norris Hunt -1500.00

20301 Joe Hammil +500.00

31416 Becky Wu +100.00

10203 Mindy Ho -2000.00

14142 James Bond +1500.00

27183 Teresa Wong -1234.56

10101 Judy Malik +1000.00

31416 Becky Wu  +100.00

32123 John Doe +900.00

10101 Judy Malik -200.00

22222 Joanne Doe +2750.02

SAMPLE LOG FILE

For a sample, the contents of the log file at the end of completing the first and the second update are presented below:

List At Start:

10203 Mindy Ho 2000

12345 Jeff Lee 211.22

14142 James Bond 1500

20103 Ed Sullivan 3000

22345 Norma Patel 2496.24

27183 Teresa Wong 1234.56

30102 Ray Baldwin 3824.36

30201 Susan Woo 9646.75

31456 Jack Smith 1200

31623 Norris Hunt 1500

Update #1

31623 Norris Hunt -1500

List After Update #1:

10203 Mindy Ho 2000

12345 Jeff Lee 211.22

14142 James Bond 1500

20103 Ed Sullivan 3000

22345 Norma Patel 2496.24

27183 Teresa Wong 1234.56

30102 Ray Baldwin 3824.36

30201 Susan Woo 9646.75

31456 Jack Smith 1200

Update #2

20301 Joe Hammil +500.00

List After Update #2:

10203 Mindy Ho 2000

12345 Jeff Lee 211.22

14142 James Bond 1500

20103 Ed Sullivan 3000

20301 Joe Hammil +500.00

22345 Norma Patel 2496.24

27183 Teresa Wong 1234.56

30102 Ray Baldwin 3824.36

30201 Susan Woo 9646.75

31456 Jack Smith 1200

SUBMIT

Submit the following:

·       Source code

·       Contents of file log.txt

·       Contents of the updated new master file.

Below is the hint

#include <iostream>
#include <string>
using namespace std;

struct NodeType;
typedef NodeType * NodePtr;
struct RecType
{
        long id;
        string fname;
        string lname;
        double amount;
};

struct NodeType
{
        long id;
        string fname;
        string lname;
        double amount;
        NodePtr flink;
        NodePtr blink;

};
class AccountList
{
private:
        NodePtr head;
        NodePtr cursor;
public:
        AccountList ( );
        void addAccountSorted (RecType rec);
        void updateAccount (RecType rec);
        void display(ofstream &lfstream);
};

AccountList::AccountList ( )
{
        head = new NodeType;
        head->id = -1;
        head->fname = "";
        head->lname = "";
        head->amount= -999.999;
        head->flink=head;
        head->blink=head;
        cursor = head;

}
void AccountList::addAccountSorted(RecType rec)
{
        //Creat the new node and fill it in.
        NodePtr newPtr = new NodeType;
        newPtr->id = rec.id;
        newPtr->fname = rec.fname;
        newPtr->lname = rec.lname;
        newPtr->amount = rec.amount;
        newPtr->flink = NULL;
        newPtr->blink = NULL;
        //find the Node of point of insertion
        NodePtr cur, prev;
        for (cur=head->flink; cur!=head; cur=cur->flink)
        {
                if (rec.id < cur->id)
                        break;
        }
        //set prev
        prev = cur->blink;
        
        //update the two forward links
        newPtr->flink=prev->flink;
        prev->flink = newPtr;
        //update the two backward links
        newPtr->blink = cur->blink;
        cur->blink = newPtr;

}
void AccountList::updateAccount(RecType rec)
{
        //move the cursor forward if at dummy node
        if (cursor == head)
                cursor = cursor->flink;
        //cursor is at the target node. do not move it
        if (cursor->id == rec.id)
        {
                //update the account

                //if the account became zero or negative
                //delete the node and move the cursor forward
        }
        else if (cursor->id < rec.id)
        {
                while (cursor != head)
                {
                        if (cursor->id >= rec.id)
                                break;
                        cursor = cursor->flink;
                }
                if (cursor->id == rec.id)
                {
                        //update the account

                        //if the account became zero or negative
                        //delete the node and move the cursor forward.
                }
                else
                {
                        //insert the node prior to where cursor is.
                }
        }
        else
        {
                while (cursor != head )
                {
                        if (cursor->id <= rec.id)
                                break;
                        cursor = cursor->blink;
                }
                                
                if (cursor->id == rec.id)
                {
                        //update the account

                        //if the account became zero or negative
                        //delete the node and move the cursor forward.
                }
                else
                {
                        //first move the cursor forward by one 
                        //This will make it point to the point of insertion node.
                        //Then insert the node prior to where cursor is.
                }
        }
}

//This method receives an ofstream opened for the log file 
//as a reference parameter and uses it to write the contents
//of the doubly linked list to the log file.
//This method can be used while performing updates.
void AccountList::display(ofstream & lfout)
{
        for(NodePtr cur = head->flink; cur!=head; cur=cur->flink)
                lfout << cur->id << " " << cur->fname << " " << " " << cur->lname << " " 
                      << cur->amount << endl;

}
void main ( )
{

                ofstream lfout ("C:\\log.txt");
}

In: Computer Science

Part C Question 2 Accounting for Non-current Assets                                  

Part C Question 2 Accounting for Non-current Assets                                            

On 1 July 2018 Fraser Ltd acquired an item of equipment with an acquisition cost of $400,000. The equipment can be used for 8 years.

On 30 June 2019, the end of financial year, the fair value of the equipment was $357,000.

The equipment was sold for $330,000 on 1 January 2020.

Non-current asset is depreciated evenly over the useful life and has no residual value. The company uses the revaluation model to record non-current asset. The income tax rate is 30%. Ignore GST.

Required:

Prepare relevant journal entries to record non-current asset in 2018/2019 and 2019/2020 financial years in accordance with AASB 116 and AASB 136. (Narrations are required, tax effect entries are required.)    

   

In: Finance

Please Answer the questions listed in the comment section, 1 and 2! -- ==================================================================== -- SQL...

Please Answer the questions listed in the comment section, 1 and 2!

-- ====================================================================
-- SQL Script for Bookstore Database Records
--    This script demonstrates the use of transactions for Unit 13 Exercise
--
--      Created by: Jennifer Rosato
--      Created on: 12/2013
--      Modified by: David Vosen
--      Modified on: 11/2016
--      Modified on: 11/2018 Add DBCC LOG(CIS_3107_##, 1) to view 
--      transactions.
-- ==================================================================== 

--SELECT * FROM customer;
--SELECT * FROM invoice;
--SELECT * FROM line;
--SELECT * FROM product;
-- cus_code for the invoice order: 1000006
-- inv_number for the new invoice: 4000006
-- p_code for the product ordered: 3000007


-- example that rolls back the transaction
BEGIN TRANSACTION;                      -- the DBMS starts keeping a transaction log here

        -- verify that the new records in invoice and line are NOT there
        SELECT * FROM invoice WHERE cus_code = '1000006';
        SELECT * FROM line WHERE inv_number = '4000006';
        SELECT * FROM product WHERE p_code = '3000007';
        
        -- add an invoice using the current date
        INSERT INTO invoice
        VALUES ('4000006', '1000006', GETDATE());

        -- add a line item to the invoice
        INSERT INTO line
        VALUES ('5000011', '4000006', '3000007', 1, 29.99);

        -- update the product table to remove the amount of the product 
        -- that was sold
        UPDATE product
        SET p_qoh = p_qoh - 1
        WHERE p_code = 3000007;
        
        -- verify that the new records in invoice and line are there
        SELECT * FROM invoice WHERE cus_code = '1000006';
        SELECT * FROM line WHERE inv_number = '4000006';
        SELECT * FROM product WHERE p_code = '3000007';

ROLLBACK;

-- verify that the new records in invoice and line are no longer there and that 
-- the original amount of the product on hand is the same
SELECT * FROM invoice WHERE cus_code = '1000006';
SELECT * FROM line WHERE inv_number = '4000006';
SELECT * FROM product WHERE p_code = '3000007';

-- example that commits the transaction
BEGIN TRANSACTION;                      -- the DBMS starts keeping a transaction log here
        
        -- add an invoice using the current date
        INSERT INTO invoice
        VALUES (4000006, 1000006, GETDATE());

        -- add a line item to the invoice
        INSERT INTO line
        VALUES (5000011, 4000006, 3000007, 1, 29.99);

        -- update the product table to remove the amount of the product 
        -- that was sold
        UPDATE product
        SET p_qoh = p_qoh - 1
        WHERE p_code = 3000007;
        
        -- verify that the new records in invoice and line are there
        SELECT * FROM invoice WHERE cus_code = '1000006';
        SELECT * FROM line WHERE inv_number = '4000006';
        SELECT * FROM product WHERE p_code = '3000007';

COMMIT; 


-- DBCC LOG(CIS_3107_00, 1)

/*
DBCC LOG(yourdatabasename, typeofoutput) where typeofoutput:
0: Return only the minimum of information for each operation -- the operation, its context and the transaction ID. (Default)
1: As 0, but also retrieve any flags and the log record length.
2: As 1, but also retrieve the object name, index name, page ID and slot ID.
3: Full informational dump of each operation.
4: As 3 but includes a hex dump of the current transaction log row.
*/



-- 1. create YOUR OWN example that rolls back the transaction 
BEGIN TRANSACTION;                      -- the DBMS starts keeping a transaction log here

        -- verify that your new records in invoice and line are NOT there 
        SELECT * FROM  WHERE 
        SELECT * FROM  WHERE 
        SELECT * FROM  WHERE    
        
        -- add an invoice using the current date
        INSERT INTO  
        VALUES 

        -- add a different line item to the invoice
        INSERT INTO  
        VALUES 

        -- update the product table to remove the amount of the product 
        -- that was sold for that line item
        UPDATE  
        SET 
        WHERE 
        
        -- verify that your new records in invoice and line are there 
        SELECT * FROM  WHERE 
        SELECT * FROM  WHERE 
        SELECT * FROM  WHERE 

ROLLBACK;
 
-- 2. Now use your example to commit your transaction now that you have tested it
BEGIN TRANSACTION;                      -- the DBMS starts keeping a transaction log here
        
        -- add the invoice using the current date 

        -- add your line item to the invoice
 

        -- update the product table to remove the amount of the product 
        -- that was sold
 
    -- verify that the changes have been made to the tables

COMMIT; 

In: Computer Science

New life form discovered bottom of the ocean. This life form uses 8 new amino acids...

New life form discovered bottom of the ocean. This life form uses 8 new amino acids to build proteins, with also the 20 that are already use. Also, size of their codons appears the same as ours. Which statements could be expected to be true for this life form?

Select one:

a. Protein structure will be less diverse

b. Genetic code will be more redundant so more of the codons code for the same amino acids

c. Must have less nucleotides than we do

d. the genetic code will be less redundant so less codons code for the same amino acid

e. No statements can be expected from this life form

In: Biology

Use the St. Louis Federal Reserve (FRED) database to find the following: 1. Find U.S. Real...

Use the St. Louis Federal Reserve (FRED) database to find the following:

1. Find U.S. Real Gross Domestic Product per capita. Submit URL

2. Using a time frame for the year (Q4 2018), select the same time frame a year earlier (Q4 2017), FY 18.

3. Compute the change in real GDP per capita for the year in question. That is equal to: (real GDP per capita in 2018 - real GDP per capita in 2017)/(real GDP per capita in 2017).

4. Repeat the same computations for 2015 to 2016, FY 16; and 2016 to 2017, FY 17.

In: Economics

ABC Company issued the following when opening business on Jan 1, 2017: 1000 Shares of 4%...

ABC Company issued the following when opening business on Jan 1, 2017:

1000 Shares of 4% $50 par value preferred stock for $100000

40000 Shares of 4% $5 par value common stock for $800000 2

017 Reported income: $350000 ---- no dividends paid in 2017

2018 Reported income: $400000 ---- $70000 dividends paid in 2018

How is the dividend divided between common and preferred stockholders if the preferred stock in non-cumulative non-participating? EPS for 2017? EPS for 2017?

How is the dividend divided between common and preferred stockholders if the preferred stock in cumulative non-participating? EPS for 2017? EPS for 2017?

In: Accounting