Generally Accepted Accounting Principles: This question post with a minimum 100-word count requirement.This week we have learned about four of the generally accepted accounting principles – revenue recognition, expense recognition, the matching principle, and the historical cost principle. Briefly explain what is meant by each of these and how they are applied to accrual accounting.
In: Accounting
In this assignment we are not allowed to make changes to Graph.h it cannot be changed! I need help with the Graph.cpp and the Driver.cpp.
Your assignment is to implement a sparse adjacency matrix data structure Graph that is defined in the header file Graph.h. The Graph class provides two iterators. One iterator produces the neighbors for a given vertex. The second iterator produces each edge of the graph once.
Additionally, you must implement a test program that fully exercises your implementation of the Graph member functions. Place this program in the main() function in a file named Driver.cpp.
The purpose of an iterator is to provide programmers a uniform way to iterate through all items of a data structure using a forloop. For example, using the Graph class, we can iterate thru the neighbors of vertex 4 using:
Graph::NbIterator nit ; for (nit = G.nbBegin(4); nit != G.nbEnd(4) ; nit++) { cout << *nit << " " ; } cout << endl ;
The idea is that nit (for neighbor iterator) starts at the beginning of the data for vertex 4 in nz and is advanced to the next neighbor by the ++ operator. The for loop continues as long as we have not reached the end of the data for vertex 4. We check this by comparing against a special iterator for the end, nbEnd(4). This requires the NbIterator class to implement the ++, !=and * (dereference) operators.
Similarly, the Graph class allows us to iterate through all edges of a graph using a for loop like:
Graph::EgIterator eit ; tuple<int,int,int> edge ; for (eit = G.egBegin() ; eit != G.egEnd() ; eit++) { edge = *eit ; // get current edge cout << "(" << get<0>(edge) << ", " << get<1>(edge) << ", " << get<2>(edge) << ") " ; } cout << endl ;
Note that each edge should be printed only once, even though it is represented twice in the sparse adjacency matrix data structure.
Since a program may use many data structures and each data structure might provide one or more iterators, it is common to make the iterator class for a data structure an inner class. Thus, in the code fragments above, nit and eit are declared asGraph::NbIterator and Graph::EgIterator objects, not just NbIterator and EgIterator objects.
Here are the specifics of the assignment, including a description for what each member function must accomplish.
Requirement: your implementation must dynamically resize the m_nz and m_ci arrays. See the descriptions of Graph(constructor) and addEdge, below.
Requirement: other than the templated tuple class, you must not use any classes from the Standard Template Library or other sources, including vector and list. All of the data structure must be implemented by your own code.
Requirement: your code must compile with the original Graph.h header file. You are not allowed to make any changes to this file. Yes, this prevents you from having useful helper functions. This is a deliberate limitation of this project. You may have to duplicate some code.
Requirement: a program fragment with a for loop that uses your NbIterator must have worst case running time that is proportional to the number of neighbors of the given vertex.
Requirement: a program fragment with a for loop that uses your EgIterator must have worst case running time that is proportional to the number of vertices in the graph plus the number of edges in the graph.
Graph.h:
#ifndef _GRAPH_H_ #define _GRAPH_H_ #include <stdexcept> // for throwing out_of_range exceptions #include <tuple> // for tuple template class Graph { public: // Graph constructor; must give number of vertices Graph(int n); // Graph copy constructor Graph(const Graph& G); // Graph destructor ~Graph(); // Graph assignment operator const Graph& operator= (const Graph& rhs); // return number of vertices int numVert(); // return number of edges int numEdge(); // add edge between u and v with weight x void addEdge(int u, int v, int x); // print out data structure for debugging void dump(); // Edge Iterator inner class class EgIterator { public: // Edge Iterator constructor; indx can be used to // set m_indx for begin and end iterators. EgIterator(Graph *Gptr = nullptr, int indx = 0); // Compare iterators; only makes sense to compare with // end iterator bool operator!= (const EgIterator& rhs); // Move iterator to next printable edge void operator++(int dummy); // post increment // return edge at iterator location std::tuple<int,int,int> operator*(); private: Graph *m_Gptr; // pointer to associated Graph int m_indx; // index of current edge in m_nz int m_row; // corresponding row of m_nz[m_indx] }; // Make an initial edge Iterator EgIterator egBegin(); // Make an end iterator for edge iterator EgIterator egEnd(); // Neighbor Iterator inner class class NbIterator { public: // Constructor for iterator for vertices adjacent to vertex v; // indx can be used to set m_indx for begin and end iterators NbIterator(Graph *Gptr = nullptr, int v = 0, int indx = 0); // Compare iterators; only makes sense to compare with // end iterator bool operator!=(const NbIterator& rhs); // Move iterator to next neighbor void operator++(int dummy); // Return neighbor at current iterator position int operator*(); private: Graph *m_Gptr; // pointer to the associated Graph int m_row; // row (source) for which to find neighbors int m_indx; // current index into m_nz of Graph }; // Make an initial neighbor iterator NbIterator nbBegin(int v); // Make an end neighbor iterator NbIterator nbEnd(int v); private: int *m_nz; // non-zero elements array int *m_re; // row extent array int *m_ci; // column index array int m_cap; // capacity of m_nz and m_ci int m_numVert; // number of vertices int m_numEdge; // number of edges }; #endif
In: Computer Science
In: Psychology
An FI has purchased a $211 million cap of 8 percent at a premium
of 0.60 percent of face value. A $211 million floor of 5.1 percent
is also available at a premium of .65 percent of face value.
a. If interest rates rise to 9 percent, what is
the amount received by the FI? What are the net savings after
deducting the premium?
b. If the FI also purchases a floor, what are the
net savings if interest rates rise to 10 percent? What are the net
savings if interest rates fall to 4.1 percent? (Negative
amounts should be indicated by a minus sign.)
c. If, instead, the FI sells (writes) the floor,
what are the net savings if interest rates rise to 10 percent? What
if they fall to 4.1 percent? (Negative amounts should be
indicated by a minus sign.)
In: Finance
What appeals you about working in the financial services Industry, particularly at BNY Melon?
In: Finance
Part 1
Recall from Chapter 1 that computer memory is comprised of individual bits of data. A bit (short for binary digit) can store one of only two values, commonly referred to as 0 and 1. However, using two bits, you can represent four different values through the bit patterns 00, 01, 10, and 11. With three bits, you can represent eight different values—via 000, 001, 010, 011, 100, 101, 110, and 111. In general, N bits of memory enable you to represent 2N different values.
Create a Web page named bits.html that contains a text box where the user can enter a number, call it N. At the click of a button, your page should compute and display 2N, the number of values that can be represented using the specified quantity of bits. For example, if the user entered 10 in the text box, the page would display the message:
With 10 bits, you can represent 1024 different values.
Once you have created your page, use it to determine the number of values that each of the following can represent (Test the following numbers to see if they give the correct results)
8 bits (1 byte)
16 bits (2 byte)
32 bits (4 bytes)
64 bits (8 bytes)
Part 2
Most lotteries select winning numbers by drawing numbered balls out of bins. For example, a typical Pick-4 lottery will utilize four bins, each containing balls with numbers starting at 0. If there are 10 balls to choose from in each of four bins, labeled 0 to 9, then 104 = 10,000 different number sequences can potentially be picked. Increasing the number of balls significantly increases the number of possible sequences, which significantly decreases a person’s odds of winning. For example, if there are 20 balls to choose from in each bin, labeled from 0 to 19, then 204 = 160,000 different number sequences could be selected.
Make a copy of the lucky1.html page from Figure 7.4 in your text and name it pick4.html. Then modify this new page so that it simulates a Pick-4 lottery. Your page should have one text box, where the user can enter the highest ball number (it is assumed that the lowest ball number is always 0). When a button is clicked, four random ball numbers should be selected and displayed in a message such as the following:
The Pick-4 winners are: 5-0-8-2
Part 3
Modify your pick4.html page from above so that it makes use of a function in the HEAD. Your function should contain the code previously assigned to the button, and have a name descriptive of the task it performs, such as GeneratePicks or PickNumbers. You should then modify the button’s ONCLICK attribute to call that function.
In: Computer Science
Allow the user to enter the number of people in the party. Calculate and display the amount owed by each person if the bill were to be split evenly among the party members.
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.mdc.tippcalcula"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
-------------------------------
<?xml version="1.0" encoding="utf-8"?> <GridLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:columnCount="2" android:useDefaultMargins="true" tools:context=".MainActivity"> <EditText android:id="@+id/amountEditText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="10" android:hint="" android:digits="0123456789" android:inputType="number" android:layout_column="0" android:layout_columnSpan="2" android:maxLength="6"/> <TextView android:id="@+id/amountTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_row="0" android:layout_column="0" android:layout_columnSpan="2" android:layout_gravity="fill_horizontal" android:background="@color/amount_background" android:elevation="@dimen/elevation" android:hint="@string/enter_amount" android:padding="@dimen/textview_padding" /> <TextView android:id="@+id/percentTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical|end" android:text="@string/tip_percentage" /> <SeekBar android:id="@+id/percentSeekBar" android:layout_width="wrap_content" android:layout_height="@dimen/seekbar_height" android:layout_gravity="fill_horizontal" android:max="30" android:progress="15"/> <TextView android:id="@+id/TipLabelTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="end" android:text="@string/tip" /> <TextView android:id="@+id/tipTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="fill_horizontal" android:background="@color/result_background" android:elevation="@dimen/elevation" android:gravity="center" android:padding="@dimen/textview_padding" /> <TextView android:id="@+id/totalLabelTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="end" android:text="@string/total" /> <TextView android:id="@+id/totalTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="fill_horizontal" android:background="@color/result_background" android:elevation="@dimen/elevation" android:gravity="center" android:padding="@dimen/textview_padding" /> <EditText android:id="@+id/numberOfPeopleEditText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="fill_horizontal" android:background="@color/result_background" android:elevation="@dimen/elevation" android:gravity="center" android:padding="@dimen/textview_padding" android:ems="10" android:hint="Enter Number Of People" android:digits="012345678" android:inputType="number" android:layout_columnSpan="2"/> <TextView android:id="@+id/eachPersonLabelTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="end" android:text="@string/each" /> <TextView android:id="@+id/eachPersonTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="fill_horizontal" android:background="@color/result_background" android:elevation="@dimen/elevation" android:gravity="center" android:padding="@dimen/textview_padding" /> </GridLayout>
----------
package com.mdc.tippcalcula; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity; import android.text.Editable; import android.text.TextWatcher; import android.widget.EditText; import android.widget.SeekBar; import android.widget.SeekBar.OnSeekBarChangeListener; import android.widget.TextView; import java.text.NumberFormat; public class MainActivity extends AppCompatActivity { private static final NumberFormat currencyFormat = NumberFormat.getCurrencyInstance(); private static final NumberFormat percentFormat = NumberFormat.getCurrencyInstance(); private double billAmount = 0.0; private double percent = 0.15; private double numPeople = 0; private TextView percentTextView; private TextView tipTextView; private TextView amountTextView; private TextView totalTextView; private TextView eachPersonTextView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); amountTextView = (TextView) findViewById (R.id.amountTextView); percentTextView = (TextView) findViewById (R.id.percentTextView); tipTextView = (TextView) findViewById(R.id.tipTextView); totalTextView = (TextView) findViewById(R.id.totalTextView); eachPersonTextView = (TextView) findViewById(R.id.eachPersonTextView); tipTextView.setText(currencyFormat.format(0)); totalTextView.setText(currencyFormat.format(0)); eachPersonTextView.setText(currencyFormat.format(0)); EditText amountEditText = (EditText) findViewById(R.id.amountEditText); amountEditText.addTextChangedListener(amountEditTextWatcher); SeekBar percentSeekBar = (SeekBar) findViewById(R.id.percentSeekBar); percentSeekBar.setOnSeekBarChangeListener(seekBarListener); } private void calculate(){ percentTextView.setText(percentFormat.format(percent)); double tip = billAmount * percent; double total = billAmount + tip; tipTextView.setText(currencyFormat.format(tip)); totalTextView.setText((currencyFormat.format(total))); } private final OnSeekBarChangeListener seekBarListener = new OnSeekBarChangeListener() { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean b) { percent = progress / 100.0; calculate(); } @Override public void onStartTrackingTouch(SeekBar seekBar) { } @Override public void onStopTrackingTouch(SeekBar seekBar) { } }; private final TextWatcher amountEditTextWatcher = new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { try { billAmount = Double.parseDouble(charSequence.toString()) / 100.0; amountTextView.setText(currencyFormat.format(billAmount)); } catch (NumberFormatException e){ amountTextView.setText(""); billAmount = 0.0; } } @Override public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void afterTextChanged(Editable editable) { } }; }
------
<?xml version="1.0" encoding="utf-8"?> <resources> <dimen name="textview_padding">12dp</dimen> <dimen name="elevation">4dp</dimen> <dimen name="seekbar_height">40dp</dimen> </resources>
---
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="colorPrimary">#6200EE</color> <color name="colorPrimaryDark">#3700B3</color> <color name="colorAccent">#03DAC5</color> <color name="amount_background">#BBDEFB</color> <color name="result_background">#ffE0B2</color> </resources>
----
<resources> <string name="app_name">Tip Calculator</string> <string name="enter_amount"> Enter Amount</string> <string name="tip_percentage">15%</string> <string name="tip">Tip</string> <string name="total">Total</string> <string name="number">No. Of People</string> <string name="each">Each Person</string> </resources>
In: Computer Science
There queer gangs of young Socialists, youths and girls (Nazis),.... They strike one as strange. something primitive, like loose roving gangs of broken, scattered tribes...as if everything and everybody recoiled from the old unison, as barbarians lurking in a wood recoil out of sight�
In: Physics
What is the vapor pressure of a solution made by adding 25.0 g of glucose, C6H12O6 (molar mass = 180. g/mol) to 145 g of water and heating the solution to 60 °C? The vapor pressure of pure water at 60 °C is 149 torr. The vapor pressure of pure glucose at 60 °C is negligible.
(a) 2.53 torr
(b) 127 torr
(c) 143 torr
(d) 146 torr
In: Chemistry
Consider the two processes below with specifications 100 plus or minus 10:
Q. What is the fraction non-conforming for each process?
In: Operations Management
You have a short position in one corn futures contract. Each futures contract calls for the delivery of 5,000 bushels of No. 2 yellow com. The initial margin was $2,500 and the maintenance margin is $1,250. At the close of trading yesterday, the futures price was $5.23 per bushel and the balance in your margin account was $1 ,750. Today, the settlement price for corn futures is $5.43. What is the balance in your account at the end of today's trading? Assume that you made the minimum deposit necessary if there was a margin call.
A) $1,750
B) *$2,500
C) $3,250
D) $ 1 ,500
Looking for the process work to understand why the solution is B) $2,500.
In: Finance
Suppose Intel stock has a beta of 1.53, whereas Boeing stock has a beta of 0.91. If the risk-free interest rate is 3.5% and the expected return of the market portfolio is 10.9%, according to the CAPM,
a. What is the expected return of Intel stock? Answer in percentage
b. What is the expected return of Boeing stock? Answer in percentage
c. What is the beta of a portfolio that consists of 60% Intel stock and 40% Boeing stock?
d. What is the expected return of a portfolio that consists of 60% Intel stock and 40% Boeing stock? (There are two ways to solve this.) (Answer in percentage)
In: Finance
The Government of Canada 2-year coupon bond has a face value of $1,000 and pays annual coupons of $30. The next coupon is due in one year. Currently, the one and two-year spot rates on Government of Canada zero coupon bonds are 5% and 5.5%. Use this information to answer part a) and b).
a) What is the correct price for the coupon bond at time zero (immediately)?
A) $925.46
B) $952.41
C) *$953.98
D) $971.68
E) $1009.54
b) What is the expected price for the coupon bond at year one (after the first coupon is paid)?
A) $953.98
B) *$971.69
C) $976.30
D) $980.95
E) $1009.54
Looking for the process work to understand why the solution for part a) is $953.98 and for b) is $971.69.
In: Finance
Paladin Furnishings generated $2 million in sales during 2016, and its year-end total assets were $1.7 million. Also, at year-end 2016, current liabilities were $500,000, consisting of $200,000 of notes payable, $200,000 of accounts payable, and $100,000 of accrued liabilities. Looking ahead to 2017, the company estimates that its assets must increase by $0.85 for every $1.00 increase in sales. Paladin's profit margin is 4%, and its retention ratio is 35%. The data has been collected in the Microsoft Excel Online file below. Open the spreadsheet and perform the required analysis to answer the question below.
How large of a sales increase can the company achieve without having to raise funds externally? Write out your answer completely. For example, 25 million should be entered as 25,000,000. Do not round intermediate calculations. Round your answer to the nearest cent.
please Help!Thank you!;)
In: Finance
Java Programming Question:
A dog shelter would like a simple system to keep track of all the dogs that pass through the facility. The system must record for each dog:
dogId (int) - must be unique
name (string)
age (double) - cannot be less than 0 or more than 25
breed (string)
sex (char) – m for male, f for female
foundHome (bool) - true means the dogs has been places in a home false otherwise.
You must create an object oriented java solution with a text based menu as summarized on the next page. The system must check that valid data is entered. For example, the menu has four items so only 1 to 5 must be allowed as input from the menu.
Summary of Operations
System Menu:
Overview:
Add Dog:
When a dog is added to the system, you must check that the dogId is not already used in the system. All new dogs have no home as yet (foundHome = false).
View all Dogs:
This menu option shows all dogs in the system. This includes dogs that have a home and those that do not.
View all available dogs:
Shows all dogs in the system, that have no homes as yet.
View dog:
Asks the user for a dogId and then displays the dog information if found and “There is no dog with that id..” if it is not found.
Update dog home status:
Asks the user for a dogId. If a dog with that id is found, the “foundHome” status is changed to true and the dog information is to be displayed. If the dog is not found the message “There is no dog with that id..” should be displayed.
In: Computer Science