Questions
NFT Consulting and Sales Inc Post Closing Trial Balance October 31, 2018 Cash $              304,900 Accounts...

NFT Consulting and Sales Inc
Post Closing Trial Balance
October 31, 2018
Cash $              304,900
Accounts Receivable                    76,580
Allowance for Uncollectible Accounts $                  5,690
Supplies                    56,500
Inventory                    68,596
Prepaid Insurance                    57,890
Land                  260,000
Building                  550,000
Accumulated Depr – Building                    25,650
Office Equipment                  856,850
Accumulated Depr – Office Equip                    22,500
Computer Equipment                  556,500
Accumulated Depr - Computer Equip                    10,250
Accounts Payable                    56,560
Utilities Payable                    16,850
Wages Payable                    58,950
Interest Payable                    25,000
Long term Note Payable                 390,000
Mortgage Payable                 406,800
Common Stock ($1 par, 1,000,000,                 400,000
shares authorized, 400,000 issued
     and outstanding)
Retained Earnings              1,369,566
$           2,787,816 $          2,787,816
PLANNED ASSET ACQUISITIONS
Reminder that the company’s fiscal year is November 1 through October 31.
Asset Cost Useful life Salvage Value Depreciation Method Purchase Date
Land 100,000 N/A N/A N/A 1-Nov-18
Building 465,500 30 15,500 Straight line 1-Nov-18
Office Equipment 150,500 4 10,500 Straight line 1-Apr-19
Delivery Equipment 200,000 6 20,000 production 1-May-19
Additional information related to the $200,000 delivery equipment purchase: It is ESTIMATED that the equipment will be ABLE TO DRIVE 150,000 total miles over its lifetime. To complete the depreciation schedule, PRESUME that the actual miles driven for its useful life are as indicated below. Also, round depreciation expense per unit to the nearest cent and depreciation expense to the nearest dollar.
Year 1      12,560
Year 2      32,560
Year 3      31,650
Year 4      29,850
Year 5      26,500
Year 6      22,350
155,470

NFT Consulting and Sales Inc

Cash Received/Annual Cash Payment Requirement
The company could issue $2,000,000 of long-term bonds, due in 5 years with a stated rate of interest, paid semiannually, of 4%. The market rate for similar debt is 6%.  
Cash Received Annual Cash Required
Face amount
Face rate
Interest Payment periods
Interest Payment  
Term
Periods
Market rate
PV factors used single sum
annuity
PV face
PV interest
The company could issue $1,500,000 of long-term bonds, due in 4 years with a stated rate of interest, paid semiannually, of 8%. The market rate for similar debt is 6%.
Cash Received Annual Cash Required
Face amount
Face rate
Interest Payment periods
Interest Payment  
Term
Market rate
PV factors used single sum
annuity
PV face
PV interest
The company could issue 400,000 additional shares of $1 par value common stock for $4 per share The company will begin paying a dividend to ALL the common shareholders of $0.12 per share and this will continue into the future.
Cash Received Annual Cash Required
number of existing shares
number of new shares
total shares at year end
market price
Dividend rate
Dividend period
PIC year end

PIC > par year end

PARTIAL BALANCE SHEETS
The company could issue $2,000,000 of long-term bonds, due in 4 years with a stated rate of interest, paid semiannually, of 4%. The market rate for similar debt is 6%.
The company could issue $1,500,000 of long-term bonds, due in 4 years with a stated rate of interest, paid semiannually, of 8%. The market rate for similar debt is 6%.
The company could issue 400,000 additional shares of $1 par value common stock for $4 per share The company will begin paying a dividend to ALL the common shareholders of $0.12 per share and this will continue into the future.

In: Accounting

If you have a chance please answer as many as possible, thank you and I really...

If you have a chance please answer as many as possible, thank you and I really appreciate your help experts!

Question 6 2 pts

A scientist claims that the mean gestation period for a fox is 51.5 weeks. If a hypothesis test is performed that rejects the null hypothesis, how would this decision be interpreted?

The evidence indicates that the gestation period is less than 51.5 weeks
There is enough evidence to support the scientist’s claim that the gestation period is 51.5 weeks
There is not enough evidence to support the scientist’s claim that the gestation period is 51.5 weeks
There is not enough evidence to support the scientist’s claim that the gestation period is more than 51.5 weeks

Flag this Question

Question 7 2 pts

A marketing organization claims that less than 15% of its employees are paid minimum wage. If a hypothesis test is performed that fails to reject the null hypothesis, how would this decision be interpreted?

There is sufficient evidence to support the claim that less than 15% of the employees are paid minimum wage
There is not sufficient evidence to support the claim that less than 15% of the employees are paid minimum wage
There is not sufficient evidence to support the claim that more than 15% of the employees are paid minimum wage
There is sufficient evidence to support the claim that 15% of the employees are paid minimum wage

Flag this Question

Question 8 2 pts

A sprinkler manufacturer claims that the average activating temperatures is at least 132 degrees. To test this claim, you randomly select a sample of 32 systems and find the mean activation temperature to be 133 degrees. Assume the population standard deviation is 3.3 degrees. Find the standardized test statistic and the corresponding p-value.

z-test statistic = -1.71, p-value = 0.0865
z-test statistic = 1.71, p-value = 0.0865
z-test statistic = -1.71, p-value = 0.0432
z-test statistic = 1.71, p-value = 0.0432

Flag this Question

Question 9 2 pts

A consumer group claims that the mean acceleration time from 0 to 60 miles per hour for a sedan is 7.0 seconds. A random sample of 33 sedans has a mean acceleration time from 0 to 60 miles per hour of 7.6 seconds. Assume the population standard deviation is 2.3 seconds. Find the standardized test statistic and the corresponding p-value.

z-test statistic = -1.499, p-value = 0.067
z-test statistic = -1.499, p-value = 0.134
z-test statistic = 1.499, p-value = 0.067
z-test statistic = 1.499, p-value = 0.134

Flag this Question

Question 10 2 pts

A consumer research organization states that the mean caffeine content per 12-ounce bottle of a population of caffeinated soft drinks is 37.8 milligrams. You find a random sample of 48 12-ounce bottles of caffeinated soft drinks that has a mean caffeine content of 35.2 milligrams. Assume the population standard deviation is 12.5 milligrams. At α=0.05, do you support or reject the organization’s claim using the test statistic?

Claim is null, reject the null and reject claim as test statistic (-1.44) is in the rejection region defined by the critical value (-1.96)
Claim is alternative, fail to reject the null and support claim as test statistic (-1.44) is not in the rejection region defined by the critical value (-1.64)
Claim is alternative, reject the null and reject claim as test statistic (-1.44) is in the rejection region defined by the critical value (-1.64)
Claim is null, fail to reject the null and support claim as test statistic (-1.44) is not in the rejection region defined by the critical value (-1.96)

In: Math

Developmental Psychology Reflect on the following case study: 1. What are the risk factors and the...

Developmental Psychology

Reflect on the following case study:

1. What are the risk factors and the protective factors when it comes to "successful aging" for Frank? For Ellen?

2. Reflect on how the current situation might impact Frank and Ellen's coping with the psychosocial crisis of Generativity vs. Stagnation, and entering the next stage of Integrity vs. Despair.

Case Study: Frank and Ellen Schaeffer

Frank, age 66, and Ellen, age 64, have declared bankruptcy, and their home is in foreclosure. They have had to move about 60 miles away from their old home, and are new to the community. They are seeking assistance, especially ways to pay for Ellen's prescription drug costs, which amount to approximately $600 per month, above what is covered by Medicare. The drugs are for diabetes management, high blood pressure, and pain management from a degenerating spine. They have managed to find a place to rent within the past month (which is about half of the size of their old home), but it costs about 43% of their fixed income from Social Security and a small pension that Frank receives from his 23 years of working for a telecommunications company. Because of the bankruptcy, they have no credit cards and use cash/checks for all transactions.

Both are exhibiting signs of extreme stress. Frank says "he's fine," but upon questioning, reports a noticeable loss of weight in the past 3 months, trouble sleeping, and his smoking has increased. He appears irritable, and he expresses sarcasm when asked about their financial situation, the past several months of trying to look for employment, or their attempts to work with banks and government agencies. Ellen reports a significant increase in her smoking, insomnia, but no change in her weight (although she is noticeably overweight for her height). She discloses that she cries about 1-2 times a week, for the past 6-8 months. Ellen mentions that both she and Frank have trouble with remembering things sometimes, especially lately. She is especially concerned about Frank.

Frank and Ellen have been married for 43 years, and have three sons and a daughter. The adult children live about 70 miles away. They help out as much as they can financially, and they are in contact with Frank and Ellen at least once a week. Frank and Ellen both report a strong marriage -- but noticeable estrangement from their own families of origin, their brothers and sisters. Ellen has one friend whom she sees about once a month. Most of their time is spent watching TV, and Frank works on a vintage car in the garage. They call themselves spiritual, but they do not practice any religion nor are they members of any religious organization.

Frank and Ellen both have high school diplomas, but no higher education. Frank has gone through many technical training programs in the course of his work for the telecommunications company, where he worked for 23 years in a variety of capacities, but most of that time involving the installation of computer/ telecommunications networks for office buildings. For the past 15 years, Frank has been working for a different company that contracts out to his original employer, for installing networks. The past 4 years, Frank has worked for this smaller satellite company as a contract worker, on call for different office building contracts. These projects are sporadic, involving stints of work for 2-3 weeks at a time. Frank obviously wants to work, but is clearly frustrated by the lack of job opportunities and feels that no one will hire someone his age. Ellen spent many years taking care of children in their home, but now can no longer do that because of pain and mobility problems, and the loss of their home of 35 years.

In: Psychology

2.        Shauna Coleman is single. She works as an architectural designer for Streamline Design (SD).For 2018,...

2.        Shauna Coleman is single. She works as an architectural designer for Streamline Design (SD).For 2018, she correctly calculated her AGI to be $107,000. However, she wasn’t sure how to compute the rest of her taxable income. She provided the following information with hopes that you could use it to determine her 2018 federal income tax return.

a.           Shauna paid $4,680 for medical expenses for care from a broken ankle sustained in a biking accident. Blake, Shauna’s boyfriend, drove Shauna (in her car) a total of 115 miles so that she could receive care for the broken ankle.

b.          Shauna paid a total of $3,400 in health insurance premiums during the year (not through an exchange). SD did not reimburse any of this expense. Besides the health insurance premiums and the medical expenses for her broken ankle, Shauna had Lasik eye surgery last year and she paid $3,000 for the surgery (she received no insurance reimbursement). She also incurred $450 of other medical expenses for the year.

c.           SD withheld $1,800 of state income tax, $7,495 of Social Security tax, and $14,500 of federal income tax from Shauna’s paychecks throughout the year.

d.          In 2018, Shauna was due a refund of $250 for overpaying her 2017 state taxes. On her 2017 state tax return that she filed in April of 2018, she applied the overpayment towards her 2018 state tax liability. She wasn’t sure but she estimated that her state tax liability for 2018 will be $2,300.

e.           Shauna paid $3,200 of property taxes on her personal residence. She also paid $500 to the developer of her subdivision, because he had to replace the sidewalk in certain areas of the subdivision.

f.            Shauna paid a $200 property tax based on the state’s estimate of the value of her car.

g.           Shauna has a home mortgage loan in the amount of $220,000 that she secured when she purchased the home. The home is worth about $400,000. Shauna paid interest of $12,300 in interest on the loan this year.

h.          Shauna made several charitable contributions throughout the year. She contributed stock in ZYX Corp. to the Red Cross. On the date of the contribution, the FMV of the donated shares was $1,000 and her basis in the shares was $400. Shauna originally bought the ZYX Corp. stock in 2008. Shauna also contributed $300 cash to State University and religious artifacts she has held for several years to her church. The artifacts were valued at $500 and Shauna’s basis in the items was $300. Shauna had every reason to believe the church would keep them on display indefinitely. Shauna also drove 200 miles doing church-related errands

i             Shauna paid $250 in investment advisory fees and another $150 to have her tax return prepared (that is, she paid $150 in 2018 to have her 2017 tax return prepared).

j.            Shauna is involved in horse racing as a hobby. During the year, she won $2,500 in prize money (which she is including in income) and incurred $10,000 in expenses. She has never had a profitable year with her horse racing activities, so she acknowledges that this is a hobby for federal income tax purposes.

k.              Shauna sustained $2,000 in gambling losses over the year (mostly horse-racing bets) and   only had $200 in winnings (which she is including in income)

Required: Determine Shauna’s 2018 taxable income starting with Adjusted Gross Income of $107,000 reported on line 7 of Form 1040 and complete page 2 of Form 1040 through Taxable Income, line 10. Also complete Schedule A, Itemized Deductions.

In: Accounting

CASE STUDY – INTERNAL CONTROL Honkydory Musical School wants to raise money for a new sound...

CASE STUDY – INTERNAL CONTROL

Honkydory Musical School wants to raise money for a new sound system for its auditorium. The primary fund-raising event is a dance at which the famous disc jockey, John Henry will play funky hip-hop and not so funky hip-hop dance tunes. Mr Bishop, the music and theater instructor, has been given the responsibility for coordinating the fund-raising efforts. This is Bishop’s first experience with fund-raising.

Bishop had 500 unnumbered tickets printed for the dance. He left the tickets in a box on his desk and told the choir students to take as many tickets as they thought they could sell for $10 each. In order to ensure that no extra tickets would be floating around, he told them to dispose of any unsold tickets. When the students received payment for the tickets, they were to bring the cash back to Mr. Bishop, and he would put it in a locked box in his desk drawer.

Some of the students were responsible for decorating the gymnasium for the dance. Mr. Bishop gave each of them a key to the money box and told them that if they took the money out to purchase materials, they should put a note in the box saying how much they took and what it was used for.

After 2 weeks the money box appeared to be getting full, so Mr. Bishop asked Luke Wilson to count the money, prepare a deposit slip, and deposit the money in a bank account that he had opened for this fundraising event. On the day of the dance, Bishop wrote a check from the account to pay the DJ, however the DJ said that he accepted only cash and did not give receipts. So Bishop took $ 500 out of the cash box and gave it to him. At the dance Bishop saw Sally working at the entrance to the gymnasium, collecting ticket from the students and selling tickets to those who had not pre-purchased them. Bishop estimated that 400 students attended the dance.

The following day Bishop closed out the bank account, which had $450 in it, and gave that amount plus the $ 300 in the cash box to the Principal of the school. He seemed surprised that after generating roughly $ 4000 in sales, the dance netted only $ 750 in cash. Bishop did not know how to respond.

Required:

1. List the internal controls that were ignored by Mr. Bishop during this fundraiser. (There are at least six)

2. Create an internal control policy that will provide all needed guidelines for the School to follow for every subsequent fundraiser.

3. Do you believe that the Principal should investigate whether fraud has occurred by Mr. Bishop?

4. Do you believe the students have committed fraud?

5. Who could help this principal develop the proper policy and controls?

In: Accounting

Please read the following on NC Economic Incentives: We have all heard that Amazon is planning...

Please read the following on NC Economic Incentives: We have all heard that Amazon is planning on opening a second headquarters. The hope is that this new HQ could bring in 50,000 jobs and $5 billion in investments. As a result, states are in a bidding war to attract Amazon. These bids are what we can economic incentives. Many politicians have argued that the government should provide economic incentives to companies in order to bring jobs to NC. The proponents of economic incentives programs say that they are necessary for the State to give tax breaks, subsidies and other benefits to attract large companies to NC. Unfortunately, many other states are doing the same thing, thus making any NC incentive program difficult and expensive. For example, after some of the first Hunger Games movie was shot in NC, much of the subsequent movies went to Georgia. The point is that other states are outbidding NC and businesses are following the money and not coming to NC, but instead are going to other states. The opponents of State Sponsored Economic Incentives for businesses call this Corporate Welfarism. They point to the many times that government has failed to achieve its goals. Opponents of government economic incentives say that the program is too expensive for the results generated. More fundamentally, opponents say that the state shouldn't use tax money to pick winners and losers. They point to the failed attempts to pick Dell, Google, and Boeing; they point to government mistakes such as the "famous" Randy Parton Theater Project. (See here: https://www.carolinajournal.com/news-article/no-celebration-for-randy-parton-theaters-10th-birthday/) Additionally, they claim that picking winners leads to crony capitalism. 2. Suppose that you have been called to Raleigh to give expert testimony before a joint North Carolina House and Senate Committee assigned to review North Carolina's economic incentive policy. Using the questions below to help guide your testimony to the committee, write a three to four page paper in a Microsoft Word document to respond to this issue: When government uses tax monies to attract businesses (creating economic incentives--both the positive and the perverse), what are the short-term effects? What are the long-term effects? What are the effects on the local community? What are the wider implications? Can this problem be explained in a game theoretic context? If government economic incentives are so good, then why is it that North Carolina has reduced the amount of incentives offered to film and television companies? [Note: When economists use incentives, they mean it in a particular sense: broad institutions that influence people's decisions. So while a coupon for $5 off is an incentive, that is not what is being asked. Instead, economists look at broader policy implications. For example, unemployment insurance pays people if they do not work. Thus, the policy (regardless of intent) creates an incentive not to work.] 3. Your paper should be in written in APA style with appropriate references and bibliography. Titles pages and abstracts are NOT necessary.

In: Economics

Question 16 The customers at Peete's coffee shop want to grab a quick cup of coffee...

Question 16

The customers at Peete's coffee shop want to grab a quick cup of coffee before boarding the Metra train into Chicago. The sign in the window promises "Quick, In-and-Out Service," and usually Peete's Coffee Shop keeps that promise. But one morning, customers were frustrated when the staff behind the counter showed more interest in gossiping about their social lives than in waiting on customers. Peete's coffee shop is suffering from a ________ gap.

                knowledge

                social expectations

                delivery

                communications

                standards

Question 17

The marketing of services such as lawn care by TruGreen differs from product marketing because services are all of these except

                inseparable.

                intangible.

                renewable.

                perishable.

                heterogeneous.

Question 18

David manages a Shoney's restaurant. He is considering staying open later in the evening. For David, the variable costs associated with staying open longer hours will include all of the following except

                rent on the restaurant building.

                hours worked by the servers.

                energy costs.

                hours worked by cooks.

                ingredients used in preparing food.

Question 19

The Coffee Express company is located in a business district with few customers on the weekend. To attract customers on Saturday and Sundays, it reduces its prices on these two days. This is an example of

                the target return effect.

                the substitution effect.

                dynamic pricing.

                the income effect.

                cross-price elasticity.

Question 20

For which of the following is demand likely to be least sensitive to price increases?

                restaurant meals

                theater tickets

                a specific brand of cereal

                spring break vacations

                prescription drugs

Question 21

Which of the following is most likely to be a pure competitive market?

                soybeans

                soft drinks

                computer operating systems

                fast-food restaurants

                cereal

Question 22

Natalie operates on a pretty tight budget. She is a price-conscious shopper and usually buys store or generic brands to save money. Recently, however, Natalie was given a pretty substantial raise. As such, she has altered her shopping patterns and now regularly buys more expensive, name-brand goods. This is an example of

                the substitution effect.

                cross-price elasticity.

                the income effect.

                the target return effect.

                the price inelasticity coefficient.

Question 23

A customer orientation toward pricing implicitly invokes the concept of

                positioning.

                value.

                knowing the dimensions of the target market.

                the income effect.

                profit.

Question 24

Which of the following markets is most likely to be an Oligopoly?

                pens and pencils

                smartphone service providers

                electrical service to the home

                soybeans

                men's clothing

Question 25

When Jennifer Hudson decides how to price new products in her gift store, she measures the value of her product offerings against those of the other stores in her area. Jennifer Hudson uses a ________ pricing strategy.

                competitor-oriented

                maximizing profits

                target profit

                target return

                sales oriented

In: Operations Management

I need an introduction and conclusion for the following paragraph please. Intro should be between 10-15...

I need an introduction and conclusion for the following paragraph please. Intro should be between 10-15 sentences and conclusion should be between 5-10 sentences

One thing that sets London and Washington, D.C. apart is their history. These cities developed on very different time lines. London, for example, has a history that dates back over two thousand years. It was part of the Roman Empire and known by the similar name, Londinium. It was not only one of the northernmost points of the Roman Empire but also the epicenter of the British Empire where it held significant global influence from the early sixteenth century on through the early twentieth century. Washington, DC, on the other hand, has only formally existed since the late eighteenth century. Though Native Americans inhabited the land several thousand years earlier, and settlers inhabited the land as early as the sixteenth century, the city did not become the capital of the United States until the 1790s. From that point onward to today, however, Washington, DC, has increasingly maintained significant global influence.

Another difference between the two city concerns their cultural life and heritage. While Washington, DC, has the National Gallery of Art and several other Smithsonian galleries, London’s art scene and galleries have a definite edge in this category. From the Tate Modern to the British National Gallery, London’s art ranks among the world’s best. This difference and advantage has much to do with London and Britain’s historical depth compared to that of the United States. London has a much richer past than Washington, DC, and consequently has a lot more material to pull from when arranging its collections. Speaking of theaters, London wins this comparison, too, both in quantity and quality of theater choices. With regard to other cultural places like restaurants, pubs, and bars, they also have some differences, While London may be better known for its pubs and taste in beer, DC offers a different bar-going experience. With clubs and pubs that tend to stay open later than their British counterparts, the DC night life tend to be less reserved overall.

The two cities also differ in cultural diversity. Perhaps the most significant difference between the resident demographics is the racial makeup. Washington, DC, is a “minority majority” city, which means the majority of its citizens are races other than white. In 2009, according to the US Census, 55 percent of DC residents were classified as “Black or African American” and 35 percent of its residents were classified as “white.” London, by contrast, has very few minorities—in 2006, 70 percent of its population was “white,” while only 10 percent was “black.” However, things are changing rapidly for London. According to UCL, 1/3 of Londoners were born abroad, and 200 languages are spoken in the city.

In: Psychology

Is the percentage average room rate increase from May to August affected by the number of...

Is the percentage average room rate increase from May to August affected by the number of stars of a hotel? In order to answer this question you are asked to use one way analysis of variance. 1.1 Compute the percentage Average Room Rate Increase from May to August for each hotel in the sample, rounding up to the second decimal. Call this variable PCT_ARR_INCREASE. 1.2 State the null and alternative hypotheses. 1.3 Test the null hypothesis at the 5% significance level. 1.4 What can you conclude from the above findings? 1.5 A friend of yours insists that the data clearly show that 5-star hotels have larger percentage average room rate increases than lesser star hotels so he/she is confident that the number of stars affects the percentage average room increase. What would be your answer to him/her be?

STARS   ARR_MAY   ARR_AUG
5 95 160
5 94 173
5 81 174
5 131 225
5 90 195
5 71 36
5 85 114
4 70 159
4 64 109
4 68 148
4 64 132
4 59 128
4 25 63
3 76 130
3 40 60
3 60 70
3 51 65
3 65 90
2 45 55
1 35 90
4 22 51
4 70 100
3 60 120
3 40 60
3 48 55
2 52 60
2 53 104
2 80 110
2 40 50
1 59 128
4 90 105
3 94 104
2 29 53
2 26 44
1 42 54
1 30 35
2 47 50
1 31 49
1 35 45
1 40 55
1   40 55
1   35 40
3   40 55
4   57 97
2   35 40
5   113 235
5   61 132
5   112 240
5   100 130
4   87 152
4   112 211
4   95 160
4   47 102
4   77 178
4   48 91
3   60 104
3   25 33
5   68 140
4   55 75
3   38 75
3   45 70
3   45 90
5   100 180
4   180 250
3   38 84
3   99 218
3   45 95
2   28 40
2   30 55
1   16 35
3   40 70
2   60 100
1   16 20
2   22 41
2   55 100
1   40 100
1   80 120
1   80 120
1   18 35
3   80 100
2   30 45
1   40 65
1   30 50
1   25 70
1   30 35
4   215 265
4   133 218
2   35 95
2   100 150
2   70 100
5   60 90
5   119 211
5   93 162
5   81 138
5   44 128
5   100 187
5   98 183
5   100 150
5   102 211
5   103 160
4   40 56
4   69 123
4   112 213
4   80 124
3   53 91
4   73 134
4   94 120
4   70 100
3   40 75
3   50 90
3   70 120
3   80 95
3   85 120
3   50 80
3   30 68
3   30 100
2   32 55
2   50 90
2   70 120
2   30 73
2   94 120
4   100 180
2   70 120
2   19 45
2   35 70
2   50 80
1   25 45
1   30 50
2   55 80
3   95 120
1   25 31
1   16 40
1   16 40
1   19 23
1   30 40 THREE COLUMNS (STARS -ARR_MAY-ARR_AUG)

PLEASE ANSWER QUESTION 1.3,1.4,1.5

THANKS IN ADVANCE

In: Statistics and Probability

JAVA Programming. How Long is this Gonna Take? Undergraduate students are surprised to learn that as...

JAVA Programming.

How Long is this Gonna Take?

Undergraduate students are surprised to learn that as much intellectual energy has been invested in sorting and searching as almost any other part of Computer Science. Think of Duke Energy's customer database—it’s huge. New customers have to be added, former ones deleted, bills must be sent out, customers send in their payments and inquire about their accounts. An efficient data organization is required for Duke to function at all. The first attack on organizing data involves sorting data elements into some order, and exploiting that order when trying to retrieve a particular element.

Hundreds of sorting algorithms have been developed, and like all sorting algorithms, Selection Sort accomplishes its task by making comparisons and data movements. We often compare algorithms by counting the number of comparisons and movements required—the fewer the better. This begs the question, how many comparisons and movements does the Selection Sort make? And, are these actions affected by the initial arrangement of data values in the array? This is the focus of this lab.

Objectives

By the end of this lab students should be able to

  • Allocate arrays
  • Initialize an array with random numbers
  • Initialize an array to be contain monotonically increasing and decreasing values
  • Sort arrays
  • Explain how sorting time increases as the number of elements to be sorted increases

Collecting Sorting Data

Start with the SelectionSort class in the zip file attached to this item. Keep the name SelectionSort, and add a main method to it.

  • Modify the selectionSort method to have two counters, one for the number of comparisons, and one for the number of data swaps. Each time two data elements are compared (regardless of whether the items are in the correct order—we're interested in that a comparison is being done at all), increment the comparison counter. Each time two data items are actually swapped, increment the data swap counter.
  • At the end of the selectionSort method, print the size of the sorted array, and the counters. (Be sure to identify which counter is which in your print message
  • In your main method,
    • Declare a final int, NUM_ELEMENTS. Initially set NUM_ELEMENTS to 10 to debug your program.
    • Declare and create three double arrays of NUM_ELEMENTS length, lo2Hi, hi2Lo, random.
    • Initialize the first array, lo2Hi, with values 1.0, 2.0, …, NUM_ELEMENTS
    • Initialize the second array, hi2Lo with values NUM_ELEMENTS, 24.0,…, 1.0
    • Initialize the third array, random, with random double values between 0.0 and less than 1.0
    • call the selectionSort method using each array. (Note: you might want to print the array elements themselves for debugging purposes when NUM_ELEMENTS is small, but you’ll not want to print them with larger values for NUM_ELEMENTS.)
  • Run your program three times with different values for NUM_ELEMENTS: 1000, 2000 and 4000.

In your submission write some text describing the relationship between the number of comparisons of the various values of NUM_ELEMENTS. For example, what do we find if we divide the number of comparisons for 2000 elements by the number of comparisons for 1000 elements? What do we find if we divide the number of comparisons for 4000 elements by the number of comparisons for 2000 elements?

Epilog: As you can tell, Selection sort doesn’t scale very well. The number comparisons increase quadradically as a function of number of elements. There comes a point that, because of array size, it’s impractical to use Selection sort. The good news is there are hundreds of sorting algorithms. Some suffer from the same performance shortcomings as Selection sort, but others that are almost “magical” in that increasing the number of elements has minor impact on performance. If you’re interested, take a look at chapter 23 Sorting.

Reporting Sorting Data

Submit, in addition to your program, submit the following information in some understandable form (it doesn’t have to be this exact table, but your submission should contain this information).

1000 elements

2000 elements

4000 elements

Comparison count lo2Hi

Comparison count hi2Lo

Comparison count random

Swap count lo2Hi

Swap count hi2Lo

Swap count random

Increasing the number of elements from 1000 to 2000 increases the number of comparisons by a factor of

Increase factor

Increasing the number of elements from 2000 to 4000 increases the number of comparisons by a factor of

Increase factor

Grading Elements

  • use class SelectionSort with the selectionSort method
  • instrument selectionSort with comparisonCnt and swapCnt, and print the number of array elements and the comparisonCnt and swapCnt values
  • write a main method with final int NUM_ELEMENTS
  • declare and create three double arrays of length NUM_ELEMENTS
  • initialize the arrays as specified
  • call selectionSort with each array
  • Run the SelectionSort with different values for NUM_ELEMENTS: 1000, 2000 and 4000.
  • Document the 18 data values described above.
  • Document the ratio of comparisonCnt values for 2000 elements and 1000 elements.
  • Document the ratio of comparisonCnt values for 4000 elements and 2000 elements
SelectionSort.java 
public class SelectionSort {
  /** The method for sorting the numbers */
  public static void selectionSort(double[] list) {
    for (int i = 0; i < list.length - 1; i++) {
      // Find the minimum in the list[i..list.length-1]
      double currentMin = list[i];
      int currentMinIndex = i;

      for (int j = i + 1; j < list.length; j++) {
        if (currentMin > list[j]) {
          currentMin = list[j];
          currentMinIndex = j;
        }
      }

      // Swap list[i] with list[currentMinIndex] if necessary;
      if (currentMinIndex != i) {
        list[currentMinIndex] = list[i];
        list[i] = currentMin;
      }
    }
  }
}

In: Computer Science