In JAVA!!!
write a method called Comparisons that will return the number of comparisons to find an element in the tree. The main program calls this method for each element, adding the comparisons each time in order to count the total number of comparisons. The program then outputs the total number of comparisons and the average number. You may use the program BuildTreeWIthMethod to build your tree. Then, after you have made the call to inOrder(root), add the following code:
int totalComparisons=0;
for (int i = 0; i < arr.length; i++) {
totalComparisons=totalComparisons + Comparisons(root,
arr[i]);
}
System.out.println("Number of comparisons to find all data in tree
is " + totalComparisons);
System.out.println("Average number of comparisons is " +
totalComparisons*1.0/arr.length);
To be clear: you ONLY have to write the method and to put the code above into your program - use the program I gave to you.
2. Repeat the above for strings in an input file. The input file is here. words2.txt
In each case work the tree by hand (pencil and paper) so you know what the answer should be. You can EITHER submit two programs OR put both into one program. Your choice.
FOR THIS LAB it is OK if you have to write two TreeInsert methods (one for Integer, one for Strings), and two Comparisons methods (you can write template methods in the next lab) - but if you put template methods in here that is good too. ALSO the integers are in an array, but the Strings are in a file. So after you have built a tree of Strings you either have to close the input file, then reopen it and pick up each word again and calculate the number of comparisonsto find it, or you have to look for another solution. (Possibilities are to read them into an array at the beginning before building your tree or count comparisons in the same loop where you read in your string. Either is fine (for now)).
words2.txt
Hi
Bye
Monday
April
Donkey
Yellow
Computers
Monkey
Dog
Cat
BuildTreeWithMethod
public class BuildTreeWithMethod {
public static void main(String[] args) {
Integer[] arr = {6, 8, 3, 4, 9, 2 }; //data to put in BST
BinaryTreeNode<Integer> root=new
BinaryTreeNode<Integer>(arr[0]);//the root
//build the tree
for (int i = 1; i < arr.length; i++) {
TreeInsert(root, arr[i]);
}
//print out the data - should be sorted
inOrder(root);
}
//method to perform- an inorder traversal of a BST
public static void inOrder(BinaryTreeNode t) {
if (t != null)
{
inOrder(t.getLeft());
System.out.println(t.getValue());
inOrder(t.getRight());
}
}
//method to insert an integer (num) into a non-null BST tree
public static void TreeInsert(BinaryTreeNode root, Integer
num)
{ BinaryTreeNode b=new BinaryTreeNode(num);
BinaryTreeNode curr=root;
while (curr != null) {
int currValue= (int)curr.getValue();
if(num<currValue){
if (curr.getLeft() == null) {
curr.setLeft(b);
break;
} else {
curr = curr.getLeft();
}
} else {
if (curr.getRight() == null) {
curr.setRight(b);
break;
} else {
curr = curr.getRight();
}
}
}
}
}
In: Computer Science
5. The main difference between perfect competition and monopolistic competition is: A) the size of the firms B) the technology used in production C) the features of the product or service are similar, but not identical D) there is only one firm producing the product, but many buyers
6. Public good are: A) rival and excludable B) non-rival and non-excludable C) rival and non-excludable D) non-rival and excludable
7. An example of a public good is a A) rhinoceros that is almost extinct B) hospital health care C) the creation of Pre. Trump of the Space Force D) All are public goods
8. If a government does not establish a rule of law, markets generally are inefficient due to the lack of we---defined: A) natural resources B) property rights C) licenses D) work hours
9. A firm’s LRAC curve keeps going down. This indicates the existence of:
a) specialization b) economies of scale c) diseconomies of scale d) diminishing returns
10. If the marginal product of labor is 4 units per hour and the marginal product of capital is 8 units per hour and labor costs $20 per hour and capital costs $35 per hour, this firm should use: A) more capital
B) more labor C) more capital and labor D) impossible to answer from the information given
11. The founder of economics wrote_________________in _________.
a) The Greatest Gift, 1542 b) My Puppy, My Life, 1924 c) The Wealth of Nations 1776 d) Wealth, Poverty, and Equality, 1848
12. Another word for ATC is a) overhead costs per unit b) production costs per unit C) average unit costs d) trigger costs
13. Profits are the same as: A) TR B) TB C) TR – TC D) none of the above
14. Average variable costs are minimized at their intersection with A) VCs B) TCs C) ATCs D0 MCs
15. At a quantity of zero production: A) A firm’s total costs will be zero B) A firm’s variable costs will be zero C) A firm’s fixed costs will be zero. D) none of the above are correct
16. In the long run, if a firm’s output doubles and its unit costs triple, this is an example of:
A) economies of scale B) diminishing returns to scale c) diseconomies of scale D) constant scale
17. The biggest problem stopping private firm from offering an adequate supply of public goods is; A) free-ridership B) tragedy of the commons C) the sword of Hercules D) bifurcation
18. If there are positive externalities created by a market, the market will give you A) too little quantity and too low a price B) too high quantity at too low a price c) too low quantity at too high a price.
D) too high a quantity at too high a price
19. Markets may not always be sufficient solution due to: a) lack of competition B) insufficient information C)the public goods problem D) all the above are possibilities
20. The yeti, sasquatch, and Big Foot may all have evolved from a common ancestor such as
A) Gigantopithecus B) Plesiosaurs C) Tasmanian Devils D) Pterodactyls
In: Economics
Fatima Hassan is responsible for the collection, and auditing services of clients' accounts for the Doha Audit Office. Has been commissioned With a new client, Al Wajba Consulting Services Company, which contracted with the Doha Audit Office recently. Company CEO It is Mr. Ali Mahmoud, who monitors all operating activities of the company and takes all major decisions. Never use this company Previously, any services from the audit office. In addition to preparing the financial statements, the Doha Audit Office will handle the related matters Company taxes. On her first visit to the company, Fatima Hassan met Hala Abdullah, she was recently hired as an accountant and is still a student. Accounting last year at a local university. At a later meeting, Hala assured Fatma that she had found the job at the beginning of the class Scholastic after extensive research. She needs money to help fund her studies at university and feels lucky to have found A well-paid job during this current phase of the economic downturn due to the COVID-19 pandemic. Hala felt that Fatima was someone she could talk to and get advice from. Hala spoke of a situation she had in mind Some time ago. Hala concerns dealing with sales revenue. When the proceeds from sales are collected and deposited on a weekly basis, the necessary report is filled out with the most accurate categories of payment: cash, checks or credit cards. Distance Depositing the total amount on a weekly basis, Mr. Ali Mahmoud prepares a report after adjusting the total amount deposited by His own vision. After looking at some of the weekly deposits, Hala noticed that 20,000 Qatari cash were missing from each Deposit process. After a more comprehensive examination of the monthly tax documents that Mr. Ali filled out, Hala notes that the total income is the monthly amount reported to the Tax Authority is QR 80,000 less than the amount actually calculated. Professor Ali He is the only person to deal with the funds after they have been pooled. It is also the only person who deposits money on a weekly basis. When Hala asked Mr. Ali about the non-reporting of these unreported revenues, Mr. Ali replied that it was being done for tax purposes. It is believed that the auditor will accept this procedure because the fees of the Doha Audit Office are to implement Audit tasks and other tax services are paid by Al Wajba Consulting Services.
Study requirements: Each student must answer the following questions but each question should be answered at least 120 word for each question:
3. What are the alternatives available to Hala Abdullah, Fatima Hassan, and Professor Ali Mahmoud?
4. For each alternative dealt with in Requirement (3), are the net benefits exceeding the net losses for all the owners? Discuss your interpretation clearly
5. Whose rights will be violated in every alternative dealt with in Question 3? Discuss your interpretation clearly
can you answer number question number 5
In: Accounting
International econ V. specific factor model The country of Riclo produces two products: Cloth and Rice. Cloth requires both Capital and Labor to produce. Rice requires both Land and Labor to produce. Riclo has perfectly competitive markets for Labor, Cloth and Rice. Riclo has 100 units of Capital, and all the Capital is used for Cloth production. Riclo has 200 units of Land, and all the Land is used for Rice production. Riclo has 1000 units of Labor, and each worker can work equally well in either Cloth or Rice production; therefore each worker will work in whichever industry pays higher wages. Since all Capital is allocated to Cloth and all Land is allocated to Rice, the production functions for each industry only depend on the quantity of Labor dedicated to that industry. The production function for Cloth is QC=20LC This means that the Marginal Product of Labor in Cloth is MPLC=10LC The production function for Rice is QR=50LR This means that the Marginal Product of Labor in Rice is MPLR=25LR You can take our word for it that these Marginal Products are correct. You do not need to use calculus to verify the equations. In Autarky the Price of Cloth is $10 and the Price of Rice is $12. You do not need to be mathematically precise on your graphs as long as the general shapes and slopes are correct. You do need to label your axes correctly. You also need to label all important points on the graph with numbers on the axes. You should draw a dotted line from the point on the graph to the number on the axis. Round all quantities to the nearest whole number, including quantities of Labor. Round all prices, wages and returns to two decimal places. Relative Prices, Relative Quantities and Slopes can be left as fractions, or they can be expressed as decimals rounded to two decimal places. Now, assume that Riclo starts to trade with the rest of the world. Assume that Relative Demand remains unchanged (that is, the World Relative Demand Curve for Cloth and Rice is the same as the Riclo Domestic Relative Demand Curve for Cloth and Rice). But the World Relative Supply Curve is different from the Riclo Relative Supply Curve, and results in a higher Relative Price of Cloth. With Free Trade, the new Price of Cloth is $20 and the Price of Rice remains at $12. Assume Free Trade for all parts of this question. Show your work for all parts of this question. Do not just write down a number. The problem continues on the next page. Calculate the quantity of Labor used in each industry in Riclo. Calculate the Quantity produced in Riclo in each industry. Calculate the equilibrium Nominal Wage in Riclo. Explain in general terms the conditions under which workers in Riclo might be better off due to Free Trade and the conditions under which the workers in Riclo might be worse off due to Free Trade. Calculate the Return to each unit of Capital in Riclo under Free Trade. Are owners of Capital in Riclo better off or worse off with Free Trade compared to Autarky?
In: Economics
Each week, you will be asked to respond to the prompt or prompts in the discussion forum. Your initial post should be 75-150 words in length, and is due on Sunday. By Tuesday, you should respond to two additional posts from your peers.
Discussion A
It is very helpful to use the new words you are learning in the context they will be used. It helps you relate the MTs to the meaning. Each week you will practice using the new words.
(Exemplar: 6 y/o male presented with likely gastroenteritis. C/o nausea without emesis, diarrhea, flatulence, and eructating. Denies rebound tenderness, r/o appendicitis. No pyrexia, but anorexia for two days.
Definitions:
Gastroenteritis:Nausea:Emesis:Diarrhea:Flatulence:Eructating:
Appendicitis:Pyrexia: Anorexia)
Use each of the MTs in a short paragraph of your creation.
Include the following aspects in the discussion:
PART 2
Each week, you will be asked to respond to the prompt or prompts in the discussion forum. Your initial post should be 75-150 words in length, and is due on Sunday. By Tuesday, you should respond to two additional posts from your peers.
Discussion B:
I have found that learning is increased when students practice going in both directions; formal to informal, and informal to formal. The primary focus is the Pathophysiology in this discussion. Anatomy and Physiology shows us how the body is supposed to work. Pathophysiology is the study of something that has gone wrong.
See the examples of the informal and formal paragraphs:
(Exemplar: Casual: I fell off my motorcycle and broke my arm. It hurt something terrible and the bones was sticking right through my arm. The medic said it was cutting of my blood flow and my fingers were numb and purply. I was really worried the doctors would have to cut them right off. But when I got to the hospital, I saw a special bone doctor and he fixed me right up.
Exemplar: Formal: The patient sustained an open compound fracture of the radius. He was complaining of severe 10/10 pain. Circulation distal to the injury was decreased. Fingers were pale with paresthesia. The patient asked if his fingers would have to be amputated. The patient was referred to an orthopedic specialist.)
Produce an informal paragraph about a pathology, then convert the paragraph into a formal one using the proper MTs.
Include the following aspects in the discussion:
In: Nursing
Auditing is a valuable skill in accounting and business, as the odds are very high that you or your organization will be subject to a compliance, federal, IRS, internal, government, or revenue audit at one point in your career. Accountants are required to make professional judgments on both the financial accounting issues and internal accounting forecasts within their organization. The auditor must provide fair, unbiased, materially correct information for investors, employers, employees, and independent stakeholders. This course will help you navigate the relevant processes to provide that unbiased, accurate information.
The purpose of the assessment is to familiarize you with the process of auditing and what to do with the auditing information once you have it. You will explore how to plan audit work, analyze financial statements, perform tests on that information, and properly and professionally communicate the results of an audit.
For this assessment, you should assume you are on the internal audit staff of a publicly traded company. Choose one of the following companies: Walmart, Target, Sears, Kroger, or Amazon. You will be required to obtain the last two years’ worth of financial statements and a recent audit report. The internal audit group at the company is tasked with preparing for an upcoming revenue audit and analyzing the business risk internally to mitigate audit findings. You will conduct an internal audit of the company using the information gathered and create a report. Then, you will prepare appropriate memos analyzing the audit report you have prepared, while offering feedback and recommendations.
For Milestone One, you will submit a draft of the procedures and field work required for conducting your audit process. Describe how you would conduct the audit process for the company you have chosen, including the analytical procedures you would use to investigate selected business transactions. Explain the appropriate field work needed to review high-risk business transactions for cash and revenue, and create a test to assess appropriate assertions for designated high-risk business transactions.
Prompt: Outline the field work and procedures that will be involved in conducting the internal audit report and explain how you intend to communicate your findings. Create a test to assess appropriate assertions for designated high-risk business transactions.
Specifically, the following critical elements must be addressed:
A. Describe how you would conduct the audit process, incorporating the analytical procedures you would use to investigate selected business transactions.
1. What steps will you take to review the company’s business transactions?
2. What would your plan be to utilize these procedures?
B. Explain the appropriate field work needed to review high-risk business transactions for cash and revenue.
1. What would you need to do in the field to investigate these?
2. Could you convey this information through charts or other supporting documentation?
C. Create a test to assess appropriate assertions for designated high-risk business transactions.
Guidelines for Submission: Your paper must be submitted as a 3–4-page Microsoft Word document with double spacing, 12-point Times New Roman font, oneinch margins, and at least three sources cited in APA format.
In: Accounting
SHORT-SIGHTED VIEW OF COST CUTTING
Jamie Ericsson, the controller for Handico, has just compiled a cost report for the second quarter. The report is prepared each quarter for corporate headquarters. She has taken particular notice of several major cost categories that show significant reductions in expenditures when compared to the first quarter. She made the following list of the major cost cuts:
| Cost Item |
Cost Reduction($) |
Cost Reduction(%) |
| General employee training | 12,000 | 25% |
| Routine machine maintenance |
13,500 |
20% |
| Process improvement | 12,000 | 12% |
| Quality training | 18,000 | 8% |
| Raw-material inspection | 6,500 | 9% |
Concerned that there may have been errors in compiling the data,
Ericsson scheduled an appointment with her supervisor, Les Winters,
the divisional vice president. At the meeting, the conversation
went like this.
Ericsson (C): “Les, I'm concerned about these cost cuts. Are these mistakes, or are we really making such substantial cuts in these areas?”
Winters (VP): “Your numbers look right, Jamie. I ordered these cutbacks myself. I think there's a lot of fat in this operation that can be cut, and I'm just getting started.”
Ericsson (C): “But these are all important areas to invest in, Les. I see the invoices for these costs every month, and I don't think it's wasted money at all.”
Winters (VP): “Corporate wants a lean company, Jamie. I'm just trying to give them one.”
Ericsson (C): “Have you thought through the implications, Les? Cutting general employee training will eventually take a toll on our productivity gains. Same thing for the cuts in process improvements. And cutting routine machine maintenance could mean breakdowns later on. Maybe not for a year or so, but eventually it'll take its toll.”
Winters (VP): Becoming annoyed, “Those are my concerns, Ms. Ericsson, not yours.”
Ericsson (C): “Look, Les, we're all on the same team. I'm just concerned, that's all. I feel as though I need to highlight these cost cuts in my report to corporate. They should at least be made aware of these issues. I'll need your authorization for that.”
Winters (VP): “No can do, Jamie. You are instructed to make your usual quarterly report using the standard format.”
After the meeting, Ericsson was commiserating with her close friend, Amy Ling, the chief of engineering.
Ericsson (C): “Amy, I just had a very unsatisfactory meeting with Les Winters. I shouldn't go into the details, but I'm concerned about some things.”
Ling (E): “Well, I have good news for you then. The grapevine has it that Les is on the very short list for taking over as president of our Japanese subsidiary. That would be a huge promotion for him. Word is that all he's got to do is turn in a good performance for the year here. If he does that, the job's his.”
Ericsson (C): “That explains a lot, Amy. Thanks for the heads up. I've got some thinking to do.”
Required:
1. What do you think is going on here?
2. What is the VP, Les Winters, up to? Is he acting ethically?
In: Accounting
Your friend has a house cleaning business, Maid Men Inc., and would like to expand the business. He needs to apply for a loan to buy a second vehicle and the bank is requesting the financial statements from the fiscal year end, December 31, 2017, prepared according to GAAP. He knows you are taking Intermediate Accounting and has confidence you would be able to help him. He has only been in business since January 2017 and in March 2018 gives you the following information and asks you to prepare in Excel the general journal including the transactional journal entries followed by the adjusting journal entries and closing entries and the four major financial statements. He says he will treat you to pizza if you say yes!
MMI (Maid Men Inc.) issued common stock for $10,000 to your friend.
MMI borrowed $20,000 from the bank and signed a note in January 2017. The loan is for 3 years at 5% interest rate and interest is paid annually in January with the principal due in January 2020.
Purchased a van for $20,000 with a useful life of 5 years on January 1st and will depreciate the vehicle using straight line depreciation and does not think it will have any value at the end of those 5 years.
Purchased cleaning supplies for $2000 cash in January.
He hired a part-time helper who began working on June 1st and pays him monthly $200/mo. He pays him his wages the first Friday of the following month. June through November wages may be recorded in one journal entry.
Gas receipts total $800 for the year. This may be recorded in one journal entry.
Business was slow in the first half of the year but, because of his superior cleaning skills and word-of-mouth referrals, really grew the second half of the year. Over 2017 he has billed his clients $30,000 on account for services rendered and has received cash payments of $25,000 from these customers. This may be recorded in one journal entry.
Purchased an additional $1,000 of supplies on account December 1st and has $800 of supplies on hand at December 31, 2017.
When he purchased the additional supplies in December he realized he needed to rent a small storage unit to store the supplies. He rented a unit for $50/mo. The storage facility required that the first 3 months be paid in advance. He was annoyed but went ahead and paid the $150 on December 1st to U Store It.
In November he decided to offer his customers a holiday cleaning deal starting in December. The customers could pay for three months of cleaning in advance and receive a 10% discount for doing so. Four customers took advantage of this amazing deal and paid your friend $600 each on December 1st. This deal is in addition to the normal billings of his customers for services rendered.
MMI paid dividends to your friend of $2,000 in December.
Since this is the first year of business your friend is unsure of MMI’s tax rate so he consulted a tax accountant who told him it would be a 20% tax rate.
In: Accounting
Case Study Paper. Stan.
Directions: Read the following case study. Write at least 500 words outlining Stan’s current development using all four of these theories:
a. Erikson’s Psychosocial
Theory
b. Piaget’s Cognitive Theory
c. Kohlberg’s Moral
Development Theory
d. The Five Factor Model
Make sure a specifically name and briefly describe the stages or factors that best fit Stan – along with an explanation of why you feel he is at each stage. Predict what the next stage of his life might be like – if he continues on the same path.
Stan is 59-years-old. His 60th birthday is fast approaching – and he is starting to feel old. His hair is thinning and grey, his eyes just don’t seem to focus as well as they used to. Stan knows he should exercise more and eat less junk food. He hasn’t seen his doctor in years – and is afraid of what any medical tests might show. Stan has been married for almost 40 years. His three children are grown and out of the house. He and his wife spend little time together. They have been sleeping in separate bedrooms since their last son left home. Stan loves to read, stays current on world events, and does a daily cross word puzzle. Stan works full time as a building inspector. He loves his job, his co-workers, and meeting new people. One weekend a month he works with a group called Habitat for Humanity. Stan firmly supports the philosophy of this organization – that everyone deserves a safe, clean home. His father taught him that happiness comes only with helping others. Stan has tried to pass this attitude on to his own children – but is not sure the message has ever gotten through. Two of his sons are still single, work hard, and play hard. He does not see them giving back to the community in any way. His daughter is married and lives in England – he has seen her only once in the last 5 years. He regrets not spending more time with his grandson. Stan sometimes wonders what he will do after he retires. He would like to work full time with Habitat – and maybe travel with them to new places. He doubts his wife would be willing to travel with him – she seems to enjoy the quiet of her garden and home. Stan is more of a people person – he gets together with friends to golf, play poker, and trade stories. Stan enjoys thinking about possibilities – he sees life as a giant adventure. He is an easy going man – although his anger is sometimes triggered when he watches news reports about corporate greed, crooked politicians, or world poverty. Stan likes to play chess with his brother – plotting the next move, predicting his brother’s reactions, and enjoying an occasional win. Stan’s parents both died from heart disease in their early 60s. He wishes they could have lived to see this children grown and settled.
In: Psychology
Case study
Fatima Hassan is responsible for the collection, and auditing services of clients' accounts for the Doha Audit Office. Has been commissioned With a new client, Al Wajba Consulting Services Company, which contracted with the Doha Audit Office recently. Company CEO It is Mr. Ali Mahmoud, who monitors all operating activities of the company and takes all major decisions. Never use this company Previously, any services from the audit office. In addition to preparing the financial statements, the Doha Audit Office will handle the related matters Company taxes.
On her first visit to the company, Fatima Hassan met Hala Abdullah, she was recently hired as an accountant and is still a student. Accounting last year at a local university. At a later meeting, Hala assured Fatma that she had found the job at the beginning of the class Scholastic after extensive research. She needs money to help fund her studies at university and feels lucky to have found A well-paid job during this current phase of the economic downturn due to the COVID-19 pandemic.
Hala felt that Fatima was someone she could talk to and get advice from. Hala spoke of a situation she had in mind Some time ago. Hala concerns dealing with sales revenue. When the proceeds from sales are collected and deposited on a weekly basis, the necessary report is filled out with the most accurate categories of payment: cash, checks or credit cards. Distance Depositing the total amount on a weekly basis, Mr. Ali Mahmoud prepares a report after adjusting the total amount deposited by His own vision. After looking at some of the weekly deposits, Hala noticed that 20,000 Qatari cash were missing from each Deposit process.
After a more comprehensive examination of the monthly tax documents that Mr. Ali filled out, Hala notes that the total income is the monthly amount reported to the Tax Authority is QR 80,000 less than the amount actually calculated. Professor Ali He is the only person to deal with the funds after they have been pooled. It is also the only person who deposits money on a weekly basis. When Hala asked Mr. Ali about the non-reporting of these unreported revenues, Mr. Ali replied that it was being done for tax purposes. It is believed that the auditor will accept this procedure because the fees of the Doha Audit Office are to implement Audit tasks and other tax services are paid by Al Wajba Consulting Services.
Study requirements:
Each student must answer the following questions but each question should be answered at least 120 word for each question:
1. What is the problem or ethical problems in this situation? And why is each of them an ethical problem?
2. Who are the affected stakeholders in this situation? Explain how.
3. What are the alternatives available to Hala Abdullah, Fatima Hassan, and Professor Ali Mahmoud?
4. For each alternative dealt with in Requirement (3), are the net benefits exceeding the net losses for all the owners? Discuss your interpretation clearly
In: Accounting