Post the journal entries to T accounts
Prepare a post-closing trial balance
Northeast Company
January 1, 2017,
Balance Sheet
Cash 20,000
Accounts receivable 110,000
Less: Allowance for doubtful accounts (2,000)
Inventory (500 units @ $20 each) 10,000
Equipment 9,000
Less: Accumulated depreciation (2,000) -----------------
Total assets 145,000
Accounts payable 20,000
Long-term notes payable (5% interest, due in 2019) 100,000
Capital stock 10,000
Retained earnings 15,000 -------------------
145,000
Transactions or events:
The company collected 98,000 of the accounts receivable in cash.
The company wrote off one $1,000 accounts receivable from J. Jones
On Jan. 1, the company bought a car for $30,000 on notes payable at 6%
The company paid 19,000 of its accounts payable in cash
The company bought 900 units of inventory for $21 each in cash
The company bought a 1 year insurance policy for $2400 on October 1
The company paid rent for the months January through December of $18,000
On July 1, the company bought rights to a patent for $20,000 The patent has ten more years of useful life
On Dec 1, the company paid dividends for $1,000 to it’s shareholders.
On Dec. 1, the company bought another 200 units of inventory for $22 on account
On Dec. 15, the company sold 1,300 units for $30 each. 1000 were sold for cash, and 300 on account. [The company accounts for its inventory on the FIFO basis, so the first items bought are assumed to be the first ones sold.]
The company decided to recorded depreciation on the equipment. The equipment is one year old. It had a cost of $9,000, salvage value of $1,000, and an expected useful life of 4 years. Use straight line to depreciate it
The company recorded depreciation on the car, using the straight line method, assuming it had a five year life, and salvage value of $6,000.
The company made the appropriate adjustment to reflect the fact the insurance policy only had nine more months left of effectiveness.
The company accrued the interest that had been built up on the long-term notes. The money had been borrowed on January 1, 2017. No payments of interest or principal were due until some time in 2018.
The company made the appropriate entry to record amortization on the patent on December 31.
On December 31, the company made an adjustment for the rent for December 2017.
The company recorded bad debt expense of 6% of the accounts receivable.
In: Accounting
Case II – Godiva Case
Any of irrelevant information to the question below, you can ignore from the description. This case is updated or continued from the first case study in week 7.
[Personal Info.]
Robinson Godiva is 46 years old, and his wife Geniece is 37 years old. Robinson and Geniece were married 8 years ago; it was Robinson’s second marriage and Geniece’s first marriage. Robinson and Geniece have one child Chaplin, who is 6 years of age. Robinson has two children by his prior marriage: Lorna, who is 14 years of age, and Eva, who is 12. All of children attend public schools.
Robinson is a chemistry professor at the university and is a partner in Lion Research Associates, a chemistry firm that Robinson started with three of his associates from the university.
[Asset Info.]
The Godivas own their personal residence in joint tenancy with right of survivorship, and it is valued currently at $250,000. They purchased the home seven years ago for $175,000. They have finished the basement and added a room and bathroom at a cost of $40,000. They have a mortgage balance of $150,000. The Godivas’ household furnishing are valued at $70,000, and Geniece’s jewelry and furs are valued at $30,000. Robinson and Geniece live in a state that follows the common-law forms of property ownership.
Robinson and Geniece have a joint checking account that contains $7,000 and a joint savings account that contains $15,000. Interest income on the savings account last year was $450. The Godivas also have $12,000 in money market mutual funds that paid dividends last year of $515. Robinson owns shares in a growth stock mutual fund that he purchased three years ago for $5,000, is now worth $5,750, and paid dividends last year of $100. Dividends on these shares are expected to grow by 8% per year, and Robinson believes that a 10% rate of return would be appropriate for these shares with their degree of risk. Geniece owns shares in a municipal bond fund purchased for $6,300, currently valued at $7,000, and yielding $400 per year tax-free. The Godivas jointly purchased 500 shares in Roters Power, Inc., a public utility company. These shares were acquired at a cost of $6,250, are currently vluaed at $8,000, and pay annual dividends of $480.
Robinson’s father died two year ago, and his mother died last year, leaving Robinson an inheritance of $150,000 in U.S. Treasury securities, paying 8% interest ($12,000 annually), and a one-half interest in common with his brother in a Florida condominium. The condominium was valued in his mother’s estate at $120,000 and was purchased six years ago for $1250,000. Real estate taxes on the condominium, half of which Robinson includes among his itemized deductions for federal income tax purposes, total $1,000. Both of Geniece’s parents are still living.
The Godivas are also joint owners of a parcel of undeveloped land in the mountains, where they plan to build a vacation home. The parcel of land cost them $75,000 and is currently valued at $70,000. They have a $30,000 mortgage on the property. Interest on the mortgage is $2,700 per year. Real estate taxes are $700.
Robinson owns an apartment building near the university that he rents to students. The apartment building was purchased four years ago for $95,000 and is currently valued at $125,000. The annual gross rental income from the property is $11,000. Robinson has a mortgage balance of $60,000, and his interest payments total $4,950. His real estate taxes and maintenance expenses are $3,000, and depreciation is $2,850.
The Godivas are joint owners of two automobiles. The cars are valued at $25,000 and $17,500. Robinson owns a sailboat which he bought for $35,000 and is valued now at $40,000.
Robinson has a one-fourth interest in the partnership Reptiles Chemicals, which is engaged in research for genetic engineering of various plants. There are no employment contracts for the partners. In addition to the partners, the firm has eight employees, including four research assistants, two secretaries, and two maintenance/hothouse workers. The research assistants are paid $30,000 each, the secretaries are paid $18,000 each, and the other workers are paid $20,000 each.
Robinson and his partners believe that the value of Reptile Chemicals is approximately $1 million. There has been no objective valuation, however. The largest assets of the firm are its building and grounds, where the firm has a laboratory, hothouses, and fields for growing experimental plants. The building and land were purchased for $250,000, and $150,000 was allocated to the building and $100,000 to the land. Additional buildings have been added at a cost of $75,000, and the current value is estimated to be $400,000. The firm has a mortgage balance on the building and land of $150,000. The partnership has been depreciating the building for tax purposes under the original accelerated cost recovery system.
[Income Tax Info.]
Robinson earns $60,000 in annual salary from the university, and he reports another $48,000 of net taxable income from the biotechnology firm. Geniece earns $30,000 working in public relations for a hospital. She also receives $5,000 at the beginning of each year from a trust established by her grandmother, with securities valued currently at $100,000. At Geniece’s death, the trust income will be paid to Charles, or if Charles is over age 25, the corpus will be distributed to him. The Godivas file joint tax returns.
Robinson pays child support for his two daughters in the amount of $400 each per month, and these payments are probably 75% of their support annually. Robinson’s daughters are in the custody of their mother and live with her for approximately nine months of the year. Robinson is required by his divorce degree to maintain a $100,000 life insurance policy to provide child support in the event of his death.
Several years ago, Robinson established custodian account for Lorna and Eva. Lorna’s account generate annual income of $900, and Eva’s account has annual income of $850.
Robinson and Geniece incur home mortgage interest costs of $12,000 per year. Real estate taxes on their home are $2,500. They will pay $4,500 in state income taxes this year and $150 in personal property taxes. Their contributions to charities totaled $2,000.
[Retirement Info.]
Geniece owns IRA accounts totaling $17,000. She is now an active participant in a defined-contribution pension plan through the hospital where she works, and her vested account value is $35,000. Eight percent of Robinson’s gross salary at the university is deducted each year and contributed to a tax-deferred annuity. The university contributes an additional six percent dollar for dollar on a tax-deferred basis. The plan is projected to pay Robinson $2,500 per month when he retires at age 65 or to Geniece at his death.
One of the partners in Reptile Chemicals is age 65 and about two years away from retirement, and two partners are age 55. The partners would like to prepare for the expected retirement of the age-65 partner, as well as the unexpected death or disability of any partner. The partners are also contemplating a retirement program for the firm and would like advice concerning the design.
[Insurance Info.]
The university provides disability income coverage for one-third of Ronbinson’s salary, group medical expense insurance covering Robinson and his family through a health maintenance organization, and group term life insurance for Robinson, with a death benefit of $50,000. Robinson owns a whole life insurance policy that will pay a death benefit of $100,000 and has a cash value of $5,500, and he owns a universal life policy with a face value of $150,000 and a cash value of $3,000. The annual premium on the whole life policy is $2,000, and the annual premium on the universal life policy is $800. Geniece has group term life insurance through her employer in a face amount that is equal to her salary.
Property and liability insurance that insures the Godivas’ house for its replacement cost has an annual premium of $1,200. The Godivas’ cars are insured under a personal auto policy provising limits for bodily injury of $100,000/$300,000, property damage of $25,000, uninsured motorists coverage of $10,000/$20,000, no-fault benefits, and a collision deductible of $250. Robinson’s sailboat is insured under a yacht policy.
[Estate Planning Info.]
Robinson’s will leaves his entire estate to Genice, but if Geniece predeceases Robinson, the estat will be left in trust for Robinson’s three children equally. Geniece’s will leaves her entire estate to Robinson or, if he predeceases her, to Charles.
Question II-1. Which of the following statement concerning the Godivas’ use of other or additional insurance coverages is correct?
Question II-2. Which of the following items of personal property would be excluded under the Godiva family’s HO-03 policy?
(1) Animals, birds, and fish
(2) Business property
(3) Loss causes by the negligent use of the dwelling fireplace
(4) Loss of $2,000 of clothing in a hotel fire while the family is vacationing in Paris
Question II-3. Which of the following would be excluded from liability coverage under the Godiva family’s personal auto policy (PAP)?
(1) Robinson’s use of a motorcycle recently acquired for weekend recreation purposes
(2) Robinson’s use of one of the family’s cars for business purposes
(3) Robinson’s use of one of the family’s cars in the neighborhood car pool, for which service each passenger pays Robinson $5.00 weekly.
In: Operations Management
Building a Balanced Scorecard
Hit-n-Run Inc. owns and operates 10 food trucks (mobile kitchens) throughout metropolitan Los Angeles. Each food truck has a different food theme, such as Irish-Mexican fusion, traditional Mexican street food, Ethiopian cuisine, and Lebanese-Italian fusion. The company was founded three years ago by Juanita O’Brien when she opened a single food truck with a unique menu. As her business has grown, she has become concerned about her ability to manage and control the business. O’Brien describes how the company was built, its key success factors, and its recent growth.
“I built the company from the ground up. In the beginning it was just me. I drove the truck, set the menu, bought the ingredients, prepared the meals, served the meals, cleaned the kitchen, and maintained the equipment. I made unique meals from quality ingredients, and didn’t serve anything that wasn’t perfect. I changed my location daily and notified customers of my location via twitter.
As my customer base grew, I hired employees to help me in the truck. Then one day I realized that I had a formula that could be expanded to multiple trucks. Before I knew it, I had 10 trucks and was hiring people to do everything that I used to do by myself. Now, I work with my team to build the menu, set daily locations for the trucks, and manage the operations of the business.
My business model is based on providing the highest quality street food and charging more for it than other trucks. You won’t get the cheapest meal at one of my trucks, but you will get the best. The superior quality allows me to price my meals a little bit higher than the other trucks. My employees are critical to my success. I pay them a better wage than they could make on other food trucks, and I expect more from them. I rely on them to maintain the quality that I established when I opened my first truck.
Things are going great, but I’m feeling overwhelmed. So far, the growth in sales has led to a growth in profitability—but I’m getting nervous. If quality starts to fall off, my brand value erodes, and that could affect the prices that I charge for my meals and the success of my business.”
Create balanced scorecard measures for Hit-n-Run Inc. Identify whether these measures best fit the innovation, customer, internal process, or financial dimension of the balanced scorecard.
| Clean up time | |
| Compensated meals | |
| Consistency of meal quality | |
| Consistency of portion size | |
| Employee turnover | |
| Food costs | |
| Food waste | |
| Fuel costs | |
| Number of employees cross-trained between trucks | |
| Number of meals served per shift (Note: Shift might be considered breakfast, lunch, dinner, late night) | |
| Number of new customers | |
| Number of new locations per time period | |
| Number of new meals developed | |
| Number of shifts per truck | |
| Number of training hours | |
| Order delivery time | |
| Quality of customer interaction | |
| Quality of food as measured in customer satisfaction surveys | |
| Quality of ingredients | |
| Quality of meal | |
| Retaining existing customers | |
| Set up time | |
| Speed of the experience (how quickly customers can be served) | |
| Time to sell out (how long it takes to sell out of meals during a shift) |
In: Accounting
Case study
In April 2019, Paul Marrapese, an independent security
researcher from San Jose, California, has published research
warning that peer-to-peer software developed by Shenzhen Yunni
Technology firm, that's used in millions of IoT devices around the
world, has a vulnerability that could allow an attacker to
eavesdrop on conversations or press household items into service as
nodes in a botnet.
The software, called iLnkP2P, is designed to enable a user to
connect to IoT devices from anywhere by using a smartphone app. The
iLnkP2P functionality is built into a range of products from
companies that include HiChip, TENVIS, SV3C, VStarcam, Wanscam, NEO
Coolcam, Sricam, Eye Sight, and HVCAM.
What Marrapese found is that as many as 2 million devices, and
possibly more, using iLnkP2P software for P2P communication do not
have authentication or encryption controls built-in, meaning that
an attacker could directly connect to a device and bypass the
firewall. Marrapese discovered the iLinkP2P flaw after buying an
inexpensive IoT-connected camera on Amazon.
"I found that I was able to connect to it externally without any
sort of port forwarding, which both intrigued and concerned me,"
Marrapese told Information Security Media Group. "I found that the
camera used P2P to achieve this, and started digging into how it
worked. From there, I quickly learned how ubiquitous and dangerous
it was."
While the flaws with the iLnkP2P peer-to-peer software apparently
have not yet been exploited in the wild, Marrapses believes it's
better for consumers to know now before an attacker decides to
start taking advantage of this particular vulnerability.
"There have been plenty of stories in the past about IP cameras and
baby monitors being hacked, but I believe iLnkP2P is a brand new
vector not currently being exploited in the wild," Marrapese says.
"With that being said, the biggest motivation behind this
disclosure is to inform consumers before it's too late - because I
believe it's only a matter of time."
As part of his research, Marrapese says he attempted to contact not
only Shenzhen Yunni Technology but also several of the IoT
manufacturers that use the company's P2P
software. As of Monday, even after publishing results, he had not
heard back from anyone.
Users of IoT devices that make use of the iLnkP2P software scan a
barcode or copy a six-digit number that is included in the product.
From there, the owner can access the device from a smartphone
app.
It's through these unique identifier numbers that Marrapese was
able to discover that each device manufacturer used a specific
alphabetic prefix to identify their particular product. For
instance, HiChip uses "FFFF" as a prefix for the identification
number for its devices. Once Marrapese was able to identify these
devices through the unique number systems, he created several
proof-of-concept attacks that took advantage of the flaws in the
software.
[Source:
https://www.databreachtoday.com/2-million-iot-devices-have-p2p-software-flaw-researcher-a-12428
Accessed July 2020]
a) In this case study, it is mentioned that vulnerable IoT devices
can service as nodes in a botnet. Explain the working mechanism of
a Botnet. Discuss any two attacks carried out by a botnet.
[8 Marks]
b) Report the importance of security in IoT devices. How does
encryption help improve security for these devices?
[6 Marks]
c) Discuss the importance of lightweight cryptography in IoT
enabled low-power devices. List the potential lightweight
cryptographic algorithms for low-power IoT devices.
In: Computer Science
1) Saint Gobain High Performance Plastics produces architectural plastics for projects such as radar domes and large pavilion-style architecture. They also produce robust industrial plastics for applications such as conveyer belts in hostile environments such as extreme temperatures, extreme temperature changes or constant exposure to various kinds of radiation. Saint Gobain offers a portfolio of standard products to the marketplace to support customer projects. St. Gobain products are built on a make-to-order basis with an average lead time of three weeks. Saint Gobain also has the capability to design one-off products to customer specifications; these engineer-to-order products represent a small fraction of the business (less than 10%) but they are high profit margin sales.
Their manufacturing process is highly capital-intensive consisting of three types of equipment:
• Industrial looms for weaving the substrate weave for their products out of various types of thread. There are a relatively small number of different substrate weave and the each form of substrate weave can be used in multiple products. Set up times and tear down for product change overs for the looms are typically in the range of two hours. Substrate is manufactured in quantities to meet the requirements of the Tower operations and is stores in rolls.
• ‘Towers’ – five-story high, purpose built machines that are used to apply coatings to the substrate weave and then bake the coatings to create the plastic. Each of the St, Gobain product offerings requires a different coating. Because of the long (on average four hours) set-up and tear down times required for product change overs, these machines produce thousands of yards of product per run which are stored in rolls.
• Cutting Operations: The rolls are then cut to customer specifications which are provided at time of order. Set-up times for the cutting operations are relatively short; typically less than an hour and the run times for the cutting phase of a customer order is typically less than three hours.
One key customer segment for Saint Gobain is the food preparation industry; they have a line of products that are FDA approved as “cook safe”. To-date these “cook safe” plastics have only been marketed to industrial firms in the food processing business. Saint Gobain has a new opportunity. McDonald’s has invited Saint Gobain to bid on the manufacture of the “grill sheets” that would be used in cooking the hamburgers in every one of the growing network of more than 37,000 McDonald’s restaurants worldwide. Grill sheets are reusable non-stick cooking surfaces that prevent the hamburger patty from sticking to the grill during cooking. St. Gobain’s design engineers have reviewed the specifications and are certain that one of the existing “cook safe” formulations can be applied with only minor changes to the Tower set-up and processing. The specification calls for one grill sheet per grill with a useful life of at least three months in a commercial application. Most McDonald’s restaurants have two grills.
One key requirement of the McDonald’s bid would be that Saint Gobain would commit to same day shipment to McDonald’s 3PL partners for McDonald’s orders.
Evaluate the supply chain impact of this new opportunity by identifying potential changes to the (a)PLAN, (b)MAKE, and(c) DELIVER processes that would be required in order to execute on this opportunity? (d) What are the inventory impacts of your recommendations?
In: Operations Management
In April 2019, Paul Marrapese, an independent security
researcher from San Jose,
California, has published research warning that peer-to-peer
software developed by
Shenzhen Yunni Technology firm, that's used in millions of IoT
devices around the world,
has a vulnerability that could allow an attacker to eavesdrop on
conversations or press
household items into service as nodes in a botnet.
The software, called iLnkP2P, is designed to enable a user to
connect to IoT devices from
anywhere by using a smartphone app. The iLnkP2P functionality is
built into a range of
products from companies that include HiChip, TENVIS, SV3C,
VStarcam, Wanscam, NEO
Coolcam, Sricam, Eye Sight, and HVCAM.
What Marrapese found is that as many as 2 million devices, and
possibly more, using
iLnkP2P software for P2P communication do not have authentication
or encryption
controls built-in, meaning that an attacker could directly connect
to a device and bypass
the firewall. Marrapese discovered the iLinkP2P flaw after buying
an inexpensive IoT-
connected camera on Amazon.
"I found that I was able to connect to it externally without any
sort of port forwarding,
which both intrigued and concerned me," Marrapese told Information
Security Media
Group. "I found that the camera used P2P to achieve this, and
started digging into how
it worked. From there, I quickly learned how ubiquitous and
dangerous it was."
While the flaws with the iLnkP2P peer-to-peer software apparently
have not yet been
exploited in the wild, Marrapses believes it's better for consumers
to know now before
an attacker decides to start taking advantage of this particular
vulnerability.
"There have been plenty of stories in the past about IP cameras and
baby monitors being
hacked, but I believe iLnkP2P is a brand new vector not currently
being exploited in the
wild," Marrapese says. "With that being said, the biggest
motivation behind this
disclosure is to inform consumers before it's too late - because I
believe it's only a matter
of time."
As part of his research, Marrapese says he attempted to contact not
only Shenzhen
Yunni Technology but also several of the IoT manufacturers that use
the company's P2P
software. As of Monday, even after publishing results,
he had not heard back from
anyone.
Users of IoT devices that make use of the iLnkP2P software scan a
barcode or copy a six-
digit number that is included in the product. From there, the owner
can access the
device from a smartphone app.
It's through these unique identifier numbers that Marrapese was
able to discover that
each device manufacturer used a specific alphabetic prefix to
identify their particular
product. For instance, HiChip uses "FFFF" as a prefix for the
identification number for its
devices. Once Marrapese was able to identify these devices through
the unique number
systems, he created several proof-of-concept attacks that took
advantage of the flaws
in the software.
[Source:
https://www.databreachtoday.com/2-million-iot-devices-have-p2p-software-
flaw-researcher-a-12428 Accessed July 2020]
a) In this case study, it is mentioned that vulnerable
IoT devices can service as nodes
in a botnet. Explain the working mechanism of a Botnet. Discuss any
two attacks
carried out by a botnet.
b) Report the importance of security in IoT devices. How
does encryption help improve
security for these devices?
c) Discuss the importance of lightweight cryptography in
IoT enabled low-power
devices. List the potential lightweight cryptographic algorithms
for low-power IoT
devices.
In: Computer Science
In this problem, assume that the distribution of differences is
approximately normal. Note: For degrees of freedom
d.f. not in the Student's t table, use
the closest d.f. that is smaller. In
some situations, this choice of d.f. may increase
the P-value by a small amount and therefore produce a
slightly more "conservative" answer.
Is fishing better from a boat or from the shore? Pyramid Lake is
located on the Paiute Indian Reservation in Nevada. Presidents,
movie stars, and people who just want to catch fish go to Pyramid
Lake for really large cutthroat trout. Let row B represent
hours per fish caught fishing from the shore, and let row
A represent hours per fish caught using a boat. The
following data are paired by month from October through April.
| Oct | Nov | Dec | Jan | Feb | March | April | |
| B: Shore | 1.7 | 1.9 | 2.0 | 3.2 | 3.9 | 3.6 | 3.3 |
| A: Boat | 1.4 | 1.5 | 1.7 | 2.2 | 3.3 | 3.0 | 3.8 |
Use a 1% level of significance to test if there is a difference in the population mean hours per fish caught using a boat compared with fishing from the shore. (Let d = B − A.)
(a) What is the level of significance?
What is the value of the sample test statistic? (Round your answer to three decimal places.)
____________________________________
In this problem, assume that the distribution of differences is
approximately normal. Note: For degrees of freedom
d.f. not in the Student's t table, use
the closest d.f. that is smaller. In
some situations, this choice of d.f. may increase
the P-value by a small amount and therefore produce a
slightly more "conservative" answer.
The western United States has a number of four-lane interstate
highways that cut through long tracts of wilderness. To prevent car
accidents with wild animals, the highways are bordered on both
sides with 12-foot-high woven wire fences. Although the fences
prevent accidents, they also disturb the winter migration pattern
of many animals. To compensate for this disturbance, the highways
have frequent wilderness underpasses designed for exclusive use by
deer, elk, and other animals. In Colorado, there is a large group
of deer that spend their summer months in a region on one side of a
highway and survive the winter months in a lower region on the
other side. To determine if the highway has disturbed deer
migration to the winter feeding area, the following data were
gathered on a random sample of 10 wilderness districts in the
winter feeding area. Row B represents the average January
deer count for a 5-year period before the highway was built, and
row A represents the average January deer count for a
5-year period after the highway was built. The highway department
claims that the January population has not changed. Test this claim
against the claim that the January population has dropped. Use a 5%
level of significance. Units used in the table are hundreds of
deer. (Let d = B − A.)
| Wilderness District | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| B: Before highway | 10.1 | 7.4 | 12.7 | 5.6 | 17.4 | 9.9 | 20.5 | 16.2 | 18.9 | 11.6 |
| A: After highway | 9.1 | 8.2 | 10.0 | 4.1 | 4.0 | 7.1 | 15.2 | 8.3 | 12.2 | 7.3 |
(a) What is the level of significance?
What is the value of the sample test statistic? (Round your
answer to three decimal places.)
In: Math
//draft to work from for Assignment 7 where you compute a student's quiz average, dropping two lowest scores, assuming
//they have 2 or more quizzes
// a max of 12 quizzes can be taken
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <fstream>
using namespace std;
const int NUM_QUIZZES = 12; //assume 12 quizzes max can be taken
int buildQuizArray( int [] ); //you need to write these 5 functions below
void printQuizArray( string, int [], int );
double calcQuizAverage( int [], int );
void sortQuizArray( int [], int );
void copyArray( int [], int [], int );
int main()
{ //this is the driver code in main routine , calling your functions
int quizArray[NUM_QUIZZES]; //declare array to hold 12 quizzes
int numQuizzes; //will be filled in with number of quizzes from buildQuizArray
numQuizzes = buildQuizArray( quizArray ); //call buildQuiz array, numQuizzes is returned from function
printQuizArray( "Quiz Scores From QuizArray After My Build Function", quizArray, numQuizzes ); //print it out to make sure it is built correctly
//take out when finished
cout << fixed << setprecision(2);
cout << endl << "Your quiz average is " << calcQuizAverage(quizArray, numQuizzes)
<< "%" << endl; //call function and get a double returned to print to user
printQuizArray( "Quiz Scores From QuizArray after calling calcQuizAverage", quizArray, numQuizzes );
//print array again to make sure you did not change the original array
return 0;
}
//********************************************************************************
int buildQuizArray( int array[] )
{
//build the array of quizzes and return the count of entries of the array back to main routine
}
//*************************************************************************
void printQuizArray( string reportTitle, int array[], int numValues )
{
//print out the quiz array with appropriate title passed to you in reportTitle....add "/10" to end of each quiz score
}
//***************************************************************************
double calcQuizAverage( int array[], int numValues )
{
//if 2 or less values in array use formula in assignment sheet for 2 or less values to compute average
//if more than 2, define another "work" array in this function, call copyArray function below to copy elements to a "work array" from array passed to you,
//and then call sortQuizArray function to sort your "work array". After work array has been sorted ascending order, use formula in sheet
// to compute the quiz average (which will not factor in the two lowest quiz scores in positions 0 and 1 in array)
//return the average computed to the main return
}
//***********************************************************
void copyArray( int destinationArr[], int sourceArr[], int numValues )
{
//copy the data from source array into destination array with a loop
// numValues has number of entries in the array
//at the bottom of this function print out destinationArr to make sure it is correctly copied, simply call printQuizArray
printQuizArray("Here's my copy/work array that is to be sorted: ", destinationArr ,numValues);
}
//***************************************************************
void sortQuizArray( int array[], int numValues )
{
//code selection sort logic here to sort array passed in , BEGIN=0, END=numValues-1
//suggestion: document each line of code here to simulate the selection sort algorithm
//at bottom of sort, to make sure table is sorted call print function and verify it is sorted
printQuizArray( "Here is my sorted array", array, numValues ); //print it out to make sure it is built correctly,take out when finished
}
In: Computer Science
import java.util.Scanner;
public class Lab5 {
public static void main(String[] args) {
final char SIDE_SYMB = '-';
final char MID_SYMB = '*';
Scanner scanner = new Scanner(System.in);
String inputStr = "";
char choice = ' ';
int numSymbols = -1, sideWidth = -1, midWidth = -1;
do {
displayMenu();
inputStr = scanner.nextLine();
if (inputStr.length() > 0) {
choice = inputStr.charAt(0);
}
switch (choice) {
case 'r':
System.out.println("Width of the sides?");
sideWidth = scanner.nextInt();
System.out.println("Width of the middle?");
midWidth = scanner.nextInt();
scanner.nextLine(); // Flush junk newline symbols
System.out.println();
System.out.println(buildRow(SIDE_SYMB, sideWidth, MID_SYMB,
midWidth));
break;
case 'p':
System.out.println("Number of symbols on the lowest layer?");
numSymbols = scanner.nextInt();
scanner.nextLine(); // Flush junk newline symbols
System.out.println();
System.out.println(buildPyramid(SIDE_SYMB, MID_SYMB, numSymbols));
break;
case 'd':
System.out.println("Number of symbols on the middle layer?");
numSymbols = scanner.nextInt();
scanner.nextLine(); // Flush junk newline symbols
System.out.println();
System.out.println(buildDiamond('*', ' ', numSymbols));
break;
case 'q':
System.out.println("Bye");
break;
default:
System.out.println("Please choose a valid option from the menu.");
break;
}
System.out.println();
} while (choice != 'q');
scanner.close();
}
/**
* Build a row of symbols (pattern) with the given parameters.
*
* For example, -----*****----- can be built by the parameters
*
* sideWidth = 5, midWidth = 5, sideSymb = '-', midSymb = '*'
*
* @param sideSymb A char to be repeated on both sides
* @param sideWidth Number of symbols on each side
* @param midSymb A char to be repeated in the middle
* @param midWidth Number of symbols in the middle
* @return A String of a row of the designed pattern
*/
private static String buildRow(
char sideSymb, int sideWidth, char midSymb, int midWidth) {
String result = "";
// YOUR CODE HERE
// Make one side
// -->
// Make the middle part
// -->
// Combine side + middle + side, save into "result"
// -->
return result;
} // End of buildRow
/**
* Build a pyramid pattern with the given parameters.
*
* For example, the following pattern
*
* -----*-----
* ----***----
* ---*****---
* --*******--
* -*********-
* ***********
*
* can be built by sideSymb = '-', midSymb = '*', numSymbols = 11
*
* When ptnHeight is not an odd integer, replace it by the closest
* even integer below. For example, if numSymbols is 10, use 9 instead.
*
* When ptnHeight is 0, return an empty String.
*
* @param sideSymb A char to be repeated on both sides
* @param midSymb A char to be repeated in the middle
* @param numSymbols The number of symbols on the lowest layer
* @return A String of the pyramid pattern.
*/
private static String buildPyramid(
char sideSymb, char midSymb, int numSymbols) {
String result = "";
int sideWidth = -1, midWidth = -1;
// YOUR CODE HERE
// If numSymbols is 0, return an empty string
// -->
// If numSymbols is not an odd number, find the
// odd number less than numSymbols and replace it
// -->
// Make a loop to iterate the pyramid's levels
for (????????????) {
// Compute the number of middle symbols
// -->
// Compute the number of symbols on one side
// -->
// Use the "buildRow" method to make a row, then
// add the row to the variable "result".
// You may need to add a linebreak char "\n".
// -->
}
return result;
}
/**
* Build a diamond pattern. The parameters are the same
* as {@link #buildPyramid(char, char, int)}.
*
* @param sideSymb A char to be repeated on both sides
* @param midSymb A char to be repeated in the middle
* @param numSymbols The height of a pyramid
* @return A String of the inverted diamond pattern.
*/
private static String buildDiamond(
char sideSymb, char midSymb, int numSymbols) {
String result = "";
// YOUR CODE HERE
// -->
return result;
}
/**
* Display the menu
*/
private static void displayMenu() {
System.out.println("Please choose one pattern from the list:");
System.out.println("r) Row");
System.out.println("p) Pyramid");
System.out.println("d) Shallow diamond");
System.out.println("q) Quit");
} // End of displayMenu
} // End of Lab5
Annotations
In: Computer Science
Case Study 1: Food Poisoning
Background
The faculty and staff of Bristol High decided to hold one of their faculty meetings at Central Park one evening after school. The plan was to have a cookout and then proceed with the meeting after everyone had time to eat and relax. Many faculty and staff members brought family members to the picnic. Everything seemed to progress as planned, that is until later that evening. That’s when people began to get sick. Many of the faculty came down with a mysterious illness.
City officials were alarmed at the sicknesses and deaths, which seem to be associated with the event. They have promised a full investigation. Park managers said that most of the symptoms—such as dehydration, stomach cramps, nausea, and vomiting—seem to indicate some type of food poisoning; however, at this point they cannot be certain.
Even the waste-water treatment plant just a few hundred yards up river will have to submit a report on their procedures for water treatment. This is the first time anything like this has happened at the park and officials want to be sure that it does not happen again.
You are now part of a team of epidemiologists that have been called in to get to the bottom of this mystery. You will need to identify the cause of the disease and prevent any further outbreaks. Time is of the essence.
Information
The picnic started at 6:00 p.m. Tuesday evening at Central Park. The park is located by the Bristol River and contains several gazebos and picnic areas. The administration and faculty of Bristol High School organized the picnic as a relaxing event before their faculty meeting to be held after dinner. Many faculty and staff brought members of their family.
Mrs. Smith and Ms. Johnston arrived at 5:30 to set up. Mr. Albert was next to arrive to set up the grill. He brought his grill from home and had to take a few minutes to clean it off because it had not been used since last summer. Mr. Drake arrived next from the supermarket where he had picked up the hamburgers. After the charcoal was lit and aluminum foil was placed over the grills, Mr. Albert began to cook.
At 5:55, Mrs. Smith realized there was only one serving spoon. She left to get some more, returning about 30 minutes later. The other teachers waited for a while, but finally decided to start eating about 6:20.
When all of the food arrived there was a full menu that included baked beans, chicken, ham, green bean casserole, tuna casserole, cherry pie, pudding, potato salad, macaroni salad, corn, and hamburgers. Drinks included soda, water, coffee, and tea.
Mr. Drake was first through the line. He tried:
Ms. Cummings was next. She ate:
The third person through the line was Mr. Carlson. He ate:
Mrs. Albert was next in line. She sampled:
Mrs. Smith arrived at this time with more serving spoons. Mrs. Bell came at the same time. She was a little late because she had to be sure that her chicken was done.
Mrs. Wolfe went through the line next. She ate:
Next was Mr. Lewis, who ate:
The line became a little unorganized at this point and it is not clear who went through next. Mrs. Smith and Ms. Johnston were two of the last people through since they helped to serve.
Mrs. Smith ate:
Others in attendance included Mr. Harvey, Ms. Jackson, Mr. Dooley, Mrs. Jones, and Mrs. Darwin. A lot of the guests said they could not remember exactly what they ate, but Mr. Harvey, Mr. Dooley, Mrs. Jones, and Mrs. Bell all had hamburgers, baked beans, and macaroni salad.
Ms. Jackson and Mrs. Darwin had ham, baked beans, corn, and some pudding for desert.
Mrs. Cain, Mrs. Williams, Dr. Oakton, Mrs. Corning, and Mrs. Reid have not yet been interviewed. Some other staff members arrived just in time for the faculty presentations, which started at 7:45. These included Mrs. Robinson, Mrs. Brown, and Mrs. Wright.
Some of the faculty and staff walked around while they ate but most sat in one of the gazebos. The presentations were held in the main gazebo, which was a relief for some of the faculty because it seemed to be one of the few places free of duck droppings.
Even during the meeting, some of the kids chased ducks with their water guns. These kids never seemed to run out of water because the guns held almost a gallon each, but even if they did run out, they quickly refilled them from the river.
Just about everyone at the picnic except for those that came for the meeting only were soaked. Since it was a hot day, the only time anyone seemed to mind the soaking was when one of the kids missed their intended target and almost put out the grill. After this incident, which happened about 6:10, the kids stayed away from the main gazebo, where the food was located, and turned their attention to the ducks and teachers walking around.
Bristol High Picnic Menu
Baked beans: Simply purchased two large cans of baked beans and heated on stove top to boiling.
Pudding: Mixed four packets of chocolate pudding with four cups of milk. Heated and then refrigerated.
Chicken: Baked chicken legs for 1 hour.
Ham: Baked ham for 2 hours 30 minutes until thermometer read 150 degrees for 20 minutes.
Green Bean Casserole: Cracker crust covered with two cans of cream of mushroom soup and two jars of green beans. Topped with 2 cans of small onions. Baked for 20 to 25 minutes to warm.
Potato salad: One jar of salad dressing, assorted diced vegetables, 2 tablespoons sugar, 1/2 cup mustard, 6 cups diced and cooked potatoes.
Macaroni salad: One box elbow macaroni, 3 T mustard, one jar salad dressing, various diced vegetables.
Tuna casserole: Cracker crust, 3 cans tuna, one can cream of mushroom soup, one can cream of chicken soup. Mixed and topped with parmesan cheese topping.
Hamburgers: Purchased at the supermarket just before the picnic (receipt showed time was 12:25).
Corn: 2 large cans of corn heated to simmering.
Cherry pie: Mountain top cherry pie, baked 40 minutes, pre-made.
Poisoned Picnic Faculty Information
Mrs. Cain
Brought plates and cups to the picnic. Had chicken, potato salad, pudding, green bean casserole. Became sick Tuesday evening. Symptoms included nausea, vomiting, and dizziness.
Mr. Lewis
Organized a game of volleyball set up by the gazebo. The players were a favorite target for the water guns!!! The only foul was when Mrs. Cain stepped on a duck going after the ball. Mr. Lewis became ill Tuesday evening. He was treated and released from the hospital Wednesday morning.
Mrs. Williams
Recovering. Became ill Tuesday night and was rushed to the hospital by her husband. Her son enjoyed his water gun, dowsing teachers with river water. She loved the burgers made by Mr. Albert. She also tried some green bean casserole, chicken, and pudding. Her son did not become ill.
Mrs. Reid
Sampled a little bit of everything. She became ill Tuesday night and finally went to the hospital Wednesday morning. She complained of stomach cramps and nausea. Doctors quickly began an IV to help replenish lost fluids. She briefly went into a coma then slowly recovered.
Dr. Oakton
Recovering. Had a great time except for when she stepped in duck droppings, which seemed to be everywhere. She didn’t even mind being soaked. She tried a little bit of everything to eat.
Mr. Albert
Mr. Albert took control of the grill. Mr. Drake soon showed up with the hamburger meat and started making the burgers. Mr. Albert had some potato salad, green bean casserole, a hamburger, and pudding for desert. Mr. Albert became ill, suffering from numbness, disorientation, nausea, and vomiting. He was treated and released after several days in the hospital.
Mrs. Corning
Arrived late, just in time to grab a burger and some green bean casserole. Most of the utensils and food were already put away. She became ill Wednesday morning and had to leave work around 8:30. She suffered from nausea, dizziness, and was so disoriented that she could not drive home.
Mrs. Smith
She arrived early with her son and helped to set up for the picnic. After many of the staff arrived, she realized that there was only one serving spoon so she went home to get some more. She returned about 30 minutes later with spoons, (after several faculty had gone through the line) to find her son chasing ducks with the water guns. Both Mrs. Smith and her son became ill.
Ms. Johnston
Helped to set up for the picnic. She had a hamburger, baked beans, pudding, and corn. She and several other teachers spent their time sitting in one of the gazebos talking and watching the children dash about after the ducks. Ms. Johnston is lactose intolerant. She became ill just a couple of hours after the picnic suffering from severe stomach pains. She went to bed and recovered overnight.
Mrs. Albert
Complained of stomach cramps early Tuesday night. Her condition continued to worsen until she finally had to be taken to the hospital. She was given massive doses of antibiotics. Her condition became worse as her symptoms began to include vomiting and disorientation. She soon found that she could not remember much about the picnic. After some time her condition improved.
Additional Information
We have since learned that luckily there was only one burger on the grill when it was soaked. Mr. Albert decided to throw it away because he had to lift up the grill and add more charcoal. Many times he would walk away from the grill to talk to someone and return to some very well done burgers. No one seemed to mind, that's the way they wanted them.
We have also learned that the wastewater treatment plant performed several tests on the water coming from their plant. The effluent (water being pumped out) was virtually void of any bacteria. The plant was doing a good job. They also did tests on the water around the park and found no notable bacterial contamination.
Pathology Report
Victim: Mrs. Wolfe
Admitted to hospital suffering from abdominal pain and vomiting. Began diagnostic tests but patient's condition deteriorated. Death due to respiratory and heart failure. Time of death: 3:30 a.m., 9/21/05.
Victim: Mr. Carlson
Paramedic response to home. Pronounced dead on arrival. Attempts to revive failed. Time of death: 11:30 p.m. 9/20/05
Victim: Mr. Drake
Admitted to hospital suffering from abdominal pain, headache, and paralysis of extremities. Lapsed into shock. Pulmonary failure followed. Time of death: 2:30 a.m. 9/21/05.
Victim: Ms. Cummings
Admitted to hospital suffering paralysis. Unable to communicate to hospital staff. Died of heart and respiratory failure. Time of death: 1:20 a.m., 9/21/05.
Include the following in your Report:
Outline a strategy to prevent future occurrences of this and other food borne illnesses.
In: Nursing