c++
Create a class named EvolutionTree which will hold a list of species and their expected age, and allow a user to search for a particular species or an age.
EvolutionTree should have private data members:
EvolutionTree should have a default constructor which should initialize the species array to empty strings ("") and initialize the speciesAges array to 0's and the following public methods:
LoadTree should read in a filename where each line is the name of a species and its expected age, separated by a comma. The method should read the file and put the appropriate data into species and speciesAges. LoadTree should return -1 for invalid filenames, and it should return 0 for valid filenames. Each species and species age will only appear once. The last line may or may not end in '\n'.
Few lines from the file to be loaded:
Human,82 Asian elephants,86 Dog,7 Cat,10
SearchForSpecies will search for a particular species' name, and return the index where that name is located. It should return -1 if the name is not found.
GetSpecies will take in an age and return the corresponding species name. It should return an empty string ("") if the age is not found.
You only need to write the class definition and any code that is required for that class. Place all code within the class definition. Our code will create and test your class.
NOTE: We have provided a function that may make the parsing easier:
int split(string s, char sep, string words[], int max_words);
int split(string phrase, char delimer, string result[],
int length)
{
//add one more delimer in the end
phrase += delimer;
//introduce variables
string partHolder = "";
int partCounter = 0;
int phraseLength = phrase.length();
for (int i = 0; i < phraseLength; i++)
{
//if we do not need to split,
if (phrase[i] != delimer)
{
//store result in the correct position
partHolder += phrase[i];
}
else
{
//make postion and holder ready for a new word, store part in
result string, and count a part
if (partCounter < length && partHolder != "") //accounts
for double delimer
{
result[partCounter] = partHolder;
partCounter++;
partHolder = "";
}
}
}
C++
In: Computer Science
Imagine that you are preparing taxes for a local tax service provider. A married couple named Judy and Walter Townson have come to you to seeking assistance with their federal income taxes. During your meeting with the Townsons, you gather the following information: They are both 55 years of age. They have two daughters and one son. One daughter (age 25) is married with children. One daughter (age 20) is living at home and attending college. Their son (age 16) is a junior in high school. They are currently paying for their college-student daughter to attend school full time. Judy is employed as a teacher and makes $60,000 a year. She used $500 of her personal funds to purchase books and other supplies for her classroom. Walter is employed as a CPA and makes $100,000 a year. They provided you a 1099-INT which reported $4,500 in interest of which $500 was savings bond interest. They provided you a 1099-DIV which reported $300 in dividends. They received a state tax refund last year of $385. They provided you a list of expenses including: Doctor’s bills, $800 Prescriptions, $400 New glasses, $2000 Dental bills, $560 Braces, $5000 Property taxes for their two cars of $800, which included $50 in decal fees Real estate taxes of $4500 Mortgage interest of $12,000 Gifts to charities, $1000 GoFundMe contribution to local family in need, $100 Tax Preparation Fees for last year’s taxes, $400 Consider the most beneficial way for Judy and Walter to file their federal income tax return. Prepare a brief written summary that addresses the following: Estimated taxable income for Judy and Walter (please show computations!) Summary of tax return, including any suggestions or tax planning considerations Explain how you determined the filing status, dependents, and use of standard/itemized deduction. Note: The summary should be no more than 500 words and should be uploaded as a Word document with a cover page via the Blackboard assignment tab in Week 5. The specific course learning outcomes associated with this assignment are: Review tax authorities and sources of tax law. Assess the concepts of gross income and strategies to minimize gross income. Examine deductions from income, limitations on those deductions, and strategies for maximizing deductions.
In: Accounting
Solve the follwing Problem.
First create an Accounting Equation Grid. Then, Income statement, Retained Earning statment and Balance Sheet.
On August 1, 2018, Brooke Kline established Western Realty. Brooke completed the following transactions during the month of August.
| A. | Opened a business bank account with a deposit of $22,000 in exchange for common stock. |
| B. | Paid rent on office and equipment for the month, $2,500. |
| C. | Paid automobile expenses (including rental charge) for month, $1,350, and miscellaneous expenses, $500. |
| D. | Purchased office supplies on account, $1,150. |
| E. | Earned sales commissions, receiving cash, $18,000. |
| F. | Paid creditor on account, $650. |
| G. | Paid office salaries, $2,900. |
| H. | Paid dividends, $3,000. |
| I. | Determined that the cost of supplies on hand was $400; therefore, the cost of supplies used was $750. |
| Required: | |
|---|---|
| 1. | Indicate the effect of each transaction and the balances after each transaction, using the tabular headings in the exhibit below. In each transaction row (rows indicated by a letter), you must indicate the math sign (+ or -) in columns affected by the transaction. You will not need to enter math signs in the balance rows (rows indicated by Bal.). Entries of 0 (zero) are not required and will be cleared if entered. |
| Assets | = Liabilities + | Stockholders’ Equity | ||||||||
| Accounts | Common | Sales | Salaries | Rent | Auto | Supplies | Miscellaneous | |||
| Cash | + Supplies | = Payable | + Stock | - Dividends | + Commissions | - Expense | - Expense | - Expense | - Expense | - Expense |
| 2. a. Prepare an income statement for August. If a net loss has been incurred, enter that amount as a negative number using a minus sign. Refer to the list of Labels, Accounts and Amount Descriptions for the exact wording of the answer choices for text entries. Be sure to complete the statement heading. You will not need to enter colons (:) on the income statement. | |
| 2. b. Prepare a retained earnings statement for August. Refer to the list of Labels, Accounts and Amount Descriptions for the exact wording of the answer choices for text entries. Be sure to complete the statement heading. If a net loss is incurred or dividends were paid, enter that amount as a negative number using a minus sign. The word “Less” or “Add” is not needed in the Retained Earnings Statement. If an amount is zero, enter "0". | |
| 2. c. Prepare a balance sheet as of August 31. Refer to the list of Labels, Accounts and Amount Descriptions for the exact wording of the answer choices for text entries. Be sure to complete the statement heading. |
In: Accounting
Lets use Excel to simulate rolling two 8-sided dice and finding the rolled sum.
• Open a new Excel document.
• Click on cell A1, then click on the function icon fx and select Math&Trig, then select RANDBETWEEN.
• In the dialog box, enter 1 for bottom and enter 8 for top.
• After getting the random number in the first cell, click and hold down the mouse button to drag the lower right corner of this first cell, and pull it down the column until 25 cells are highlighted. When you release the mouse button, all 25 random numbers should be present.
• Repeat these four steps for the second column, starting in cell B1.
• Put the rolled sum of two dice in the third column: Highlight the first two cells in the first row and click on AutoSum icon. Once you receive the sum of two values in the third cell, drag the lower right corner of this cell, C1, down to C25. This will copy the formula for all 25 rows. We now have 25 trials of our experiment.
Once these steps are completed, attach a screenshot of your Excel file to your assignment.
(a) Find the theoretical probability that the rolled sum of both dice is 8.
(b) Based on the results of our experiment of 25 trials, obtain the relative frequency approximation to the probability found in (a). You can do so in Excel in two different ways: i) create the histogram of the third column data, then scroll the mouse over the relevant bar - this will give you the frequency with which you can determine the relative frequency; or ii) in a cell, type the function COUNTIF(C1:C25,8)
(c) Generate the frequency distribution histogram of your experiment of 25 trials, and copy it to a Word document. Make sure to add a title to your histogram.
(d) Repeat the simulation for 100 and 1000 trials, and calculate the relative frequency for each, and create the frequency distribution histogram - resize the 3 histograms so that all 3 fit beside each other in a row.
(e) Identify which of the 3 relative frequencies for ’8’ is the closest value to the theoretical probability found in (a). Briefly explain how these experiments demonstrate the Law of Large Numbers.
(f) Identify the shape of the probability distribution (uniform, bell-curved, right-skewed or left-skewed).
In: Math
Assignment:
Create data file consisting of integer, double or String values.
Create unique Java application to read all data from the file echoing the data to standard output. After all data has been read, display how many data were read. For example, if 10 integers were read, the application should display all 10 integers and at the end of the output, print "10 data values were read"
My issue is displaying how many integers were read and how many strings were read.
Here's my code:
/*
* File: ReadDateFile.java
* Author: Mia Robinson
* Date: 10/7/2020
* Purpose: This program will read data from a file
* and will echo the data to standard output
*/
package readdatafile;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
/**
*
* @author mrsar
*/
public class ReadDataFile {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner scannerIn = null;
FileInputStream in = null;
BufferedReader inputStream = null;
// int equivalent of the char
int fileChar;
String fileLine;
int intCount=0; // Initialize integer and word counter
String stringCount =0;
try {
in = new FileInputStream("Read.txt");
System.out.println("Fun with integers");
// Read one char at a time
while ((fileChar = in.read()) != -1) {
int length = String.valueOf(fileChar).length();
intCount += String.valueOf(fileChar).length();
// convert int to char
System.out.print((char) fileChar);
}
// Print the number or string values read to the console
System.out.println("\n\n" + intCount + " data values were read!");
// Separate the file output
System.out.println(" \n");
// Use of Scanner and BufferedReader
inputStream = new BufferedReader(new FileReader("ReadStrings.txt"));
System.out.println("We've reached the end:");
// Read one Line using BufferedReader
while ((fileLine = inputStream.readLine() ) != null) {
System.out.println(fileLine);
}
// Print the number or string values read to the console
System.out.println("\n" + stringCount + " string values were read!");
} catch (IOException io) {
System.out.println("File IO exception" + io.getMessage());
} finally {
// Need another catch for closing
// the streams
try {
// Close the streams
if (in != null) {
in.close();
}
if (inputStream != null) {
inputStream.close();
}
} catch (IOException io) {
System.out.println("Issue closing the Files" +
io.getMessage());
}
}
}
}
In: Computer Science
1) Download the file Assign2.asm. Read it and make sure it can be compiled and executed in Mars.
Assign2.asm
.data
Array: .word 43, -5, 11, 12, 64, -7, 14, 71, 70, 13, -27
string1: .asciiz "Please input the flag: \n"
string2: .asciiz "Sorted Result: \n"
# Tranfer the C code of selection sort to MIPS code. Please do not modify the existing code.
.text
main:
# write your code here to ask the user to input a flag (int number)
la $t0, Array
li $t1, 0
li $t7,11 # array length n=11
mul $t7, $t7, 4 # 4*n, end of inner loop
subi $t8, $t7, 4 # 4*(n-1), end of outer loop
OuterLoop:
add $t2, $t1, 4 # i is in $t1 and j is in $t2
# write your code here for Selection Sort with flag checking
# write your code here to print the sorted result
# exit
addi $v0, $zero, 10
syscall
2) Write code to finish all the tasks listed in Assign2.asm. In Assign2.asm, an array ‘a’of ‘n’=11integers are given at the beginning (make sure do not change these integers):
43, -5, 11, 12, 64, -7, 14, 71, 70, 13, -27
The finished Assign2.asm should be filled with your MIPS code in the specified space to implement the given C code for Selection Sort:
for (int i=0; i<n-1;i++) {
for(int j=j+1; j<n;j++) {
if a[i] > a[j] {
int temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
This above code will generate the sorted result from minimum to maximum.
3) Your code will ask the user to input a flag (int number). If the flag is 1, your code outputs the sorting result from minimum to maximum; otherwise, your code outputs the sorting result from maximum to a minimum.
Here is an example output:
--------------------------------------------
Please input the flag: # user inputs 1
Sorted Result:
-27
-7
-5
11
12
13
14
43
64
70
71
---------------------------------------------
Please input the flag: # user inputs 0
Sorted Result:
71
70
64
43
14
13
12
11
-5
-7
Note: MIIPS code
In: Computer Science
Choose a real-world example of someone you would describe as a great leader. Examples would include; Steve Jobs, Colin Powell, Mahatma Gandhi, Elon Musk, Margaret Thatcher, etc. Prepare a 500-word essay describing their leadership successes as they relate to the "sources and types of power" discussed in chapter 8. Be sure to address their source of leader power (person vs position), type of leader power, and the overall impact of such power upon their leadership efforts.
-Power of the Position Based on what leaders can offer to others Reward power is the capacity to offer something of value as a means of influencing others: “If you do what I ask, you will be rewarded.” Control over pay, promotions, and parking places are examples of reward power. Coercive power is the capacity to punish as a means of influencing others: “If you don’t do what I ask, you will be punished.” Coercive power is leadership by fear and intimidation. Legitimate power is the capacity to influence others by virtue of formal authority or the rights of office: “Because I am the leader, you should do as I ask.” Examples are the boss who assigns jobs, the coach who decides plays, the captain who gives orders, and the teacher who assigns homework. Information power comes from having access to data and news of importance to others: “I have important information, so you should do as I ask.” Keepers of standards, rules, and regulations have information power.
-Power of the Person Based on how leaders are viewed by others Expert power is the capacity to influence others because of expertise, specialized knowledge, or skill. A mechanic, actor, or lawyer may be influential because she is recognized as the best in her profession. Ability in an art, science, a profession, or a trade are examples of expert power. Referent power is the capacity to influence others because of their desire to identify with the leader. Unselfish motives and virtuous character raise trust and respect. Being admired as a role model brings referent power. Rational power is the capacity to influence others because of well-developed reasoning and problem-solving ability. Intelligence increases rational power. Charisma power is the ability to motivate and inspire others by force of personal traits, including optimism, sense of adventure, and commitment to a cause. Charisma power transforms people to achieve superior performance.
In: Operations Management
You are a financial manager for Zoom Corp., which manufactures
bicycles. In the most recent fiscal year,
Zoom manufactured and sold 20,000 bicycles. Wheels, seats, and
brake calipers are three components of
the bicycles currently manufactured by Zoom. Three different
vendors have proposed to provide those
components to Zoom, and quoted prices (including shipping) for
their delivery. Your task is to determine
which, if any, of these proposals should be accepted.
Prepare a make vs. buy incremental analysis for each possible
course of action in an Excel worksheet. Your
grade will be based on the correctness of your answers, as well as
the use of Excel. That is, where possible,
you should use formulas to get your answers, rather than keyed-in
values. See your instructor for help with
Excel basics if you need it.
In a Word document, prepare a memo stating which of the
proposals you suggest accepting, as well as the
basis for your conclusions. Also identify any nonfinancial factors
you should consider before accepting any
of the outsourcing proposals.
Below is cost data for Zoom's production of wheels, seats, and
calipers. Outside suppliers have offered to
provide wheels for $6.90, seats for $9.39, and calipers for $2.14
per piece. Both wheels and seats are branded
with the Zoom logo, and that logo will need to be added at the Zoom
factory at a cost of $0.50 each for any
of these components that are outsourced. For all three components,
75% of the fixed costs are avoidable, and
will be eliminated if the component's production is outsourced. In
addition, seats and calipers are both
produced out of the same small factory space. If both seats and
calipers were outsourced, Zoom could lease
the space out and increase net income by $6,000 per year, while
eliminating all fixed costs for the two
components.
| Wheels | Seats | Calipers | |
| Cost category | |||
| Direct materials | $138,000 | $54,500 | $87,500 |
| Direct labor | 97,000 | 71,500 | 44,500 |
| Variable overhead | 21,000 | 14,000 | 16,000 |
| Fixed overhead | 60,400 | 36,600 | 31,400 |
| Total cost | $316,400 | $176,600 | $179,400 |
| Units produced | 40,000 | 20,000 | 80,000 |
| Cost per unit | $7.91 | $8.83 | $2.24 |
Hints: Prepare incremental analyses for each component
separately. Make wheels vs. buy wheels, etc. Since
there are additional implications to outsourcing both seats and
calipers, do a make vs. buy analysis assuming
both are outsourced. A correct solution, then, will likely have at
least four incremental analyses.
In: Accounting
Leighton Beridon owns "Jeemp Farms", located near Weimar, TX. The farm produces pecan trees and sod. He has so many orders from the Houston metropolitan area that he is able to sell all his inventory each year, but he is not netting as much as he has in past years. His daughter, Liesl Beridon, came home from college over Thanksgiving and mentioned ABC costing, which she learned about in her cost accounting class. Mr. Beridon does not really know what ABC costing is and is skeptical as to whether it would be right for his business. He has hired your company to educate him about ABC and whether or not he should use an ABC system. Over the next few weeks, you will work towards helping Mr. Beridon decide what is the best route for his company to take. Shortly after you get started, Mr. Beridon sends you an email stating that he feels he needs to discontinue the sod portion of his business and focus on his tree sector, as he can charge more per tree than he can charge for a foot of sod. He sends you an email stating, "I can charge so much more for a tree than a foot of grass. Therefore, I am planning on discontinuing the sod portion of the business immediately as I make so much more on the trees! I am going to plant all my sod acres with trees". Write a 700- to 1,050-word paper plan for your boss explaining how you will analyze Jeemp Farms. Include the following: Prepare an argument convincing him to hold off on his decision and see the results of your analysis first. As you have not had time to do any analysis yet, you need to convince Mr. Beridon to wait on whether to discontinue his sod business. Project potential benefits Mr. Beridon could gain from using an ABC system. Explain how ABC creates these benefits. Your team is planning on conducting an analysis of whether ABC would be beneficial to Mr. Beridon. Create a process for conducting this analysis. Include the following:
How could you apply the data in the company's general ledger?
In: Accounting
Case study:
In order to direct decision-making, a relatively young cosmetics company, which sells a range of organic and eco-friendly beauty products, decides to investigate the impact of their marketing strategy. As the company is only five years old, there has been significant investment in advertising and marketing their brand. In order to assess the impact that their marketing initiatives have had, they have implemented a four-month survey-research project in order to determine how their customers heard about their brand. Each customer was asked to complete a five-minute survey upon making an online order. The results were analysed, and it was determined that the customers heard about the company through the following means:
These results were compared to the amount of money spent on their three means of advertising: Google AdWords, magazine print advertisements, and radio advertising. Furthermore, the researchers compared their marketing approach to that of other cosmetics and holistic-living companies.
As the money spent on print advertising accounts for nearly 40% of their marketing spend, and radio advertising for 15%, the return on investment is very low, and thus a new strategy is needed. After interpreting all the data, the researchers suggest that the company should vastly reduce spending on print and radio advertising, and increase their investment in online advertising, including Google AdWords and Facebook advertising. Furthermore, with a shift in focus towards digital marketing, the company might need to re-structure their marketing department, and consider employing a digital marketing manager.
Answer Template:
Having read the case study, write a paragraph of 500 words in which you address the following:
In: Operations Management