Questions
We know that Spin is described with SU(2) and that SU(2) is a double cover of...

We know that Spin is described with SU(2) and that SU(2) is a double cover of the rotation group SO(3). This suggests a simple thought experiment, to be described below. The question then is in three parts:

  1. Is this thought experiment theoretically sound?

  2. Can it be conducted experimentally?

  3. If so what has been the result?

The experiment is to take a slab of material in which there are spin objects e.g. electrons all (or most) with spin ?. Then rotate that object 360 degrees (around an axis perpendicular to the spin direction), so that macroscopically we are back to where we started. Measure the electron spins. Do they point ??

In: Physics

In the (Bomb Calorimetry) experiment, 1.10 g of anthracene (C14H10) was burned in a constant volume...

In the (Bomb Calorimetry) experiment, 1.10 g of anthracene (C14H10) was burned in a constant volume bomb calorimeter. The temperature of water rose from 20.28 °C to 24.05 °C. If the heat capacity of the bomb plus water was 10.17 kJ/°C: In the (Bomb Calorimetry) experiment, 1.10 g of anthracene (C14H10) was burned in a constant volume bomb calorimeter. The temperature of water rose from 20.28 °C to 24.05 °C. If the heat capacity of the bomb plus water was 10.17 kJ/°C:

-Calculate Δc.mH at 25°C

-Why excess oxygen was used in this experiment? Why not using ambient air?

In: Chemistry

extra.cpp. It defines the function extra which will be used in the main program. extra.h. This...

extra.cpp. It defines the function extra which will be used in the main program.

extra.h. This is the header file. Notice that is only really provides the declaration of the function.

o In the declaration, the names of the parameters are not required, only their types.

o Note that the function declaration ends in a ; (semicolon). Don't forget!!!

o There are some weird # statements, we'll get to that.

• main.cpp. This is the main program. Notice that it has the following statement in it:

  #include "extra.h"

This means that the main program is "including" the declaration of the function so that the compiler may check the type use of extra by main. Notice the quotes. When the include uses quotes, it is assumed that the .h file is in the same directory as the other files. include with <> means get includes from the "standard include place". Since it is our include file, we need to use quotes for it.

Weird # in headers
Anything beginning with # is part of the pre-processor. This controls aspects of how the

compilation goes. In this case, we are trying to prevent a multiple definition error. What if we wanted to use extra in a more than one file? Your expectation is that every file

that wants to use extra should include the extra.h file for compilation to work, and you would be correct. Sort of. Remember that you cannot declare a variable more than once, and the same goes for a function. You should only declare it once. In making one executable from many files, it is possible that, by including extra.h in multiple files, we would declare the extra function multiple times for this single executable. C++ would complain. However, it would be weird to have to do this in some kind of order where only one file included extra.h and assume the rest would have to assume it is available.

The way around this involves the pre-processor. Basically there are three statements we care about:

#ifndef some_variable_we_make_up
#define some_variable_we_make_up

... all the declarations in this .h file

#endif

This means. "If the pre-processor variable we indicate (some_variable_we_make_up) is not defined (#ifndef), go ahead and define it (#define) for this compilation and do everything else up to the #endif, meaning include the declarations in the compilation. If the variable is already defined, skip everything up to the #endif, meaning skip the declarations"

Thus whichever file pulls in the header file first, defines the pre-processor variable and declares the function for the entire compilation. If some other file also includes the header file later in the compilation, the pre-processor variable is already defined so the declarations are not included.

Make a new project called 'splitter'. We want to add three new files to the project: main.cpp functions.cpp functions.h

Make a new file (weird icon next to open) then save as main.cpp

Now make the functions.cpp and the functions.h file.

You should have three file tabs at the top now.

Function split

The split function should take in a string and return a vector<string> of the individual elements in the string that are separated by the separator character (default ' ',

space). Thus

"hello mom and dad" à {"hello", "mom", "and", "dad}

• Open functions.h and store the function declaration of split there. The

declaration should be:

vector<string> split (const string &s,
                      char separator=' ');

As discussed in class, default parameter values go in the header file only. The default does not occur in the definition if it occurred in the declaration.

This header file should wrap all declarations using the #ifndef, #define, #endif as discussed above. Make up your own variable.

Open functions.cpp and write the definition of the function split. Make sure it follows the declaration in functions.h. The parameter names do not matter but the types do. Make sure the function signature (as discussed in class) match for the declaration and definition.

You can compile functions.cpp (not build, at least not yet) to see if functions.cpp is well-formed for C++. It will not build an executable, but instead a .o file. The .o file is the result of compilation but before building an executable, an in-between stage.

Function print_vector

This function prints all the elements of vector<string> v to the ostream out provided as a reference parameter (it must be a reference). Note out and v are passed by reference.

• print_vector : Store the function print-vector in functions.cpp, put its declaration in functions.h It should look a lot like the below:

void print_vector (ostream &out, const vector<string> &v);

• compile the function (not build, compile) to make sure it follows the rules. Function main

The main function goes in main.cpp.

In main.cpp make sure you #include "functions.h" (note the quotes),

making those functions available to main. Write a main function that:

The operation of main is as follows:

o prompts for a string to be split
o prompts for the single character to split the string with
o splits the string using the split function which returns a vector o prints the vector using the print_vector function

• compile (not build) main to see that it follows the rules

Build the executable

Select the main.cpp tab of geany and now build the project. An executable called main should now be created which you can run.

Assignment Notes

1. Couple ways to do the split function 1. getline

i. getline takes a delimiter character as a third argument. In combination with an input string stream you can use getline to split up the string and push_back each element onto the vector.

ii. example getline(stream, line, delim) gets the string from the stream (istream, ifstream, istringstream, etc.) up to the end of the line or the delim character.

b. string methods find and substr. You can use the find method to find the delim character, extract the split element using substr, and push_back the element onto the vector.

2. Default parameter value. The default parameter value needs to be set at declaration time, which means that the default value for a function parameter should be in the header file (the declaration). If it is in the declaration, it is not required to be in the definition, and by convention should not be.

main.cpp:

/* 
 * File:   main.cpp
 * Author: bill
 *
 * Created on October 10, 2013, 2:13 PM
 */

#include <iostream>
#include<string>
#include<vector>

using std::cout;using std::endl;using std::cin;
using std::vector;
using std::string;

#include"extra.h"

/*
 * 
 */
int main() {
    string result;
    vector<string> v{"this", "is", "a", "test"};
    result = my_fun(v);
    cout << "Result:"<<result<<endl;
    
    
}

extra.cpp:

#include<vector>
#include<string>
using std::vector;
using std::string;

string my_fun(const vector<string>& v){
    string result="";
    for(auto element : v)
        result += element[0];
    return result;
}

extra.h:

/* 
 * File:   extra.h
 * Author: bill
 *
 * Created on October 10, 2013, 2:14 PM
 */
#ifndef EXTRA_H
#define EXTRA_H
#include<string>
using std::string;
#include<vector>
using std::vector;

string my_fun(const vector<string>&);

#endif  /* EXTRA_H */

And finally, save your 'functions.cpp', it will be used next time.

In: Computer Science

You hypothesize that place cells that fire in sequence are recurrently connected with higher probability than...

You hypothesize that place cells that fire in sequence are recurrently connected with higher probability than would be expected randomly. Design an experiment to test this. Include all aspects of the experiment, including behavioral paradigm, physiological recording method, and method to determine connectivity between recorded neurons, in your answer.

In: Biology

Passive Equity Investment Portfolio Practice Problem Martin Company has a portfolio of passive equity investments with...

Passive Equity Investment Portfolio Practice Problem

Martin Company has a portfolio of passive equity investments with a cost basis of $34,600 and a fair value of $41,650 on December 31, 2015. Martin Company sells $5,300 (cost) of equity investments on April 1, 2016 for $6,200. Martin Company purchases additional equity investments for $7,125 on August 10, 2016. On November 30, 2016 Martin Company receives $1,350 in dividends from its equity investments. The fair value of Martin’s equity investments is $40,575 on December 31, 2016.

Provide all journal entries for 2016 for Martin Company. Also describe how each equity investment will affect the firm’s 2016 financial statements.

In: Accounting

Calculating and Reporting Income Tax Expense Lynch Company began operations in 2016. The company reported $22,000...

Calculating and Reporting Income Tax Expense

Lynch Company began operations in 2016. The company reported $22,000 of depreciation expense on its income statement in 2016 and $24,000 in 2017. On its tax returns, Lynch deducted $34,000 for depreciation in 2016 and $39,000 in 2017. The 2017 tax return shows a tax obligation (liability) of $18,200 based on a 40% tax rate.

Required
a. Determine the temporary difference between the book value of depreciable assets and the tax basis of these assets at the end of 2016 and 2017.

2016 $Answer
2017 $Answer

b. Calculate the deferred tax liability for each year.

2016 $Answer
2017 $Answer

c. Calculate the income tax expense for 2017.
$Answer

In: Accounting

During the year ended December 31, 2017, Gluco, Inc., split its stock on a 4-for-1 basis....

During the year ended December 31, 2017, Gluco, Inc., split its stock on a 4-for-1 basis. In its annual report for 2016, the firm reported net income of $936,100 for 2016, with an average 293,400 shares of common stock outstanding for that year. There was no preferred stock.

a. What amount of net income for 2016 will be reported in Gluco's 2017 annual report?

b. Calculate Gluco's earnings per share for 2016 that would have been reported in the 2016 annual report. (Round your answer to 2 decimal places.)

c. Calculate Gluco's earnings per share for 2016 that will be reported in the 2017 annual report for comparative purposes. (Round your answer to 2 decimal places.)

In: Accounting

ABC inc builds and sells single-family homes. the company had the following transactions during q1 2016...

ABC inc builds and sells single-family homes. the company had the following transactions during q1 2016 period that ended on march 31, 2016:

1. purchased a single-family home on january 10, 2016 which it plans to renovate and resell. the home was purchased for $200,000 with $150,000 paid in cash and the remainder to be paid upon sale of the property.

2. Purchased $10,000 worth of building materials at home depot used in the renovation. The purchased was paid in cash.

3. Hired a contractor to perform the renovation of the house. The renovation was completed on feb. 10, 2016 and the contractor billed ABC inc $50,000 for this renovation. ABC paid $30,000 upon completion of the work. The balance was due in Q2 2016.

4. Paid office employee salaries of $10,000 during Q1 2016.

5. Sold the home for $290,000 on March 30th 2016 of which $250,000 was received and the rest due on April 20th 2016.

At the beginning of the quarter, (1/1/16) ABC inc balance sheet had only $300,000 in cash and $300,000 in owners equity.

1. present income statement for Q1

2. create ABC inc balance sheet at the end of Q1 2016

3. present statement of Cash flow

In: Accounting

Acquisition Cost and Depreciation Reveille, Inc., purchased Machine #204 on April 1, 2016, and placed the...

Acquisition Cost and Depreciation

Reveille, Inc., purchased Machine #204 on April 1, 2016, and placed the machine into production on April 3, 2016. The following information is relevant to Machine #204:

Price $60,000
Freight-in costs 2,500
Preparation and installation costs 3,900
Labor costs during regular production operation 10,200
Credit terms 2/10, n/30
Total productive output 138,500 units

The company expects that the machine could be used for 10 years, after which the salvage value would be zero. However, Reveille intends to use the machine only 8 years, after which it expects to be able to sell it for $9,800. The invoice for Machine #204 was paid April 10, 2016. The number of units produced in 2016 and 2017 was 23,200 and 29,000, respectively. Reveille computes depreciation expense to the nearest whole month.

Required:

Compute the depreciation expense for 2016 and 2017, using the following methods. Round your answers to the nearest dollar.

Straight-line method:
2016 depreciation = $
2017 depreciation = $

Sum-of-the-years'-digits method:
2016 depreciation = $
2017 depreciation = $

Double-declining-balance method:
2016 depreciation = $
2017 depreciation = $

Activity method (units of production):
2016 depreciation = $
2017 depreciation = $

In: Accounting

​​​​​​​Vibrant Company had $910,000 of sales in each of three consecutive years 2016–2018, and it purchased...

​​​​​​​Vibrant Company had $910,000 of sales in each of three consecutive years 2016–2018, and it purchased merchandise costing $505,000 in each of those years. It also maintained a $210,000 physical inventory from the beginning to the end of that three-year period. In accounting for inventory, it made an error at the end of year 2016 that caused its year-end 2016 inventory to appear on its statements as $190,000 rather than the correct $210,000.

  1. Determine the correct amount of the company’s gross profit in each of the years 2016–2018.
  2. Prepare comparative income statements to show the effect of this error on the company's cost of goods sold and gross profit for each of the years 2016−2018.

Determine the correct amount of the company's gross profit in each of the years 2016−2018.

VIBRANT COMPANY

Comparative Income Statements

2016

2017

2018

3-year total

Cost of goods sold

Cost of goods sold

Gross profit

Prepare comparative income statements to show the effect of this error on the company's cost of goods sold and gross profit for each of the years 2016−2018.

VIBRANT COMPANY

Comparative Income Statements

2016

2017

2018

3-year total

Cost of goods sold

Cost of goods sold

Gross profit

In: Accounting