Program C You are given some data from an animal shelter, listing animals that they currently have. They have asked you to write a program to sort the dogs and cats in age in ascending order, respectively, and write them in separate files. Assume the input file has the format of name (one word), species (one word), gender (one word), age (int), weight (double), with each animal on a separate line:
Hercules cat male 3 13.4
Toggle dog female 3 48
Buddy lizard male 2 0.3 ….
Example input/output:
Enter the file name: animals.txt
Output file name: sorted_dogs.txt sorted_cats.txt
1. Name your program animals.c.
2. The output file name should be sorted_dogs.txt and sorted_cats.txt. Assume the input file name is no more than 100 characters.
3. The program should be built around an array of animal structures, with each animal containing information of name, species, gender, age, and weight. Assume that there are no more than 200 items in the file. Assume the name of an animal is no more than 100 characters.
4. Use fscanf and fprintf to read and write data.
5. Your program should include a sorting function so that it sorts the animals in age. You can use any sorting algorithms such as selection sort and insertion sort. void sort_animals(struct animal list[], int n);
6. Output files should be in the format of name gender age weight, with 2 decimal digits for weight.
For example,
Toggle female 3 48.01
Rocky male 5 52.32
In: Computer Science
|
2 |
Insert a function in cell B2 to display the current date from your system. |
|
3 |
With cell B2 selected, set the width of column B to AutoFit. |
|
4 |
Insert a VLOOKUP function in cell C5 to display the ring cost for the first student. The cost of the ring type should be an exact match. Use appropriate relative and absolute cell references. |
|
5 |
Copy the formula from cell C5 to the range C6:C11. |
|
6 |
Apply Accounting number format to the range C5:C11. |
|
7 |
Insert an IF function in cell E5 to calculate the total due. If the student has chosen to personalize the ring, there is an additional charge of 5% located in cell B21 that must be added to the cost of the ring; if not, the student only pays the base price. Use appropriate relative and absolute cell references. |
|
8 |
Copy the formula from cell E5 to the range E6:E11. |
|
9 |
Apply Accounting number format to the range E5:E11. |
|
10 |
Insert a function in cell G5 to calculate the first student's monthly payment, using appropriate relative and absolute cell references. Ensure the result is a positive number. |
|
11 |
Copy the formula from cell G5 to the range G6:G11. |
|
12 |
Apply Accounting number format to the range G5:G11. |
|
13 |
Calculate totals in cells C12, E12, and G12. |
|
14 |
Apply Accounting number format to the cells C12, E12, and G12. |
|
15 |
Set 0.3" left and right margins and ensure the page prints on only one page. |
|
16 |
Insert a footer with your name on the left side, the sheet name in the center, and the file name on the right side. |
|
17 |
Save and close Exp19_Excel_Ch02_Cap_InlandJewelers.xlsx. Exit Excel. Submit the file as directed |
In: Computer Science
(a) Chau’s electric circuit is a simple electronic circuit that can exhibit chaotic behaviour. The voltages x(t) and y(t), and current z(t), across components in the circuit can be investigated using the Matlab command
[t,xyz] = ode45(@ChuaFunction,[-10 100],[0.7 0.2 0.3]);
and the function:
1 function dxyzdt = ChuaFunction(~,xyz)
2 % xyz(1) = X, xyz(2) = Y, xyz(3) = Z
3 4 dxdt = 15.6*(xyz(2) - xyz(1) + 2*tanh(xyz(1)));
5 dydt = xyz(1) - xyz(2) + xyz(3);
6 dzdt = -28*xyz(2); 7
8 dxyzdt = [dxdt dydt dzdt]’;
9 end
(i) What is the differential equation involving x˙(t)? Here a dot represents differentiation with respect to time t.
(ii) What is the initial condition for the variable y(t)?
(iii) What does the apostrophe after the square brackets in line 8 of the function signify and why is the apostrophe needed here?
(b) For a given function u(t), explain how the derivative of u(t) with respect to t can be approximated on a uniform grid with grid spacing ∆t, using the one-sided forward difference approximation
du/dt ≈ Ui+1 − Ui/ ∆t ,
where ui = u(ti). You should include a suitable diagram explaining your answer
(c) Using the one-sided forward difference approximation from part (b) and Euler’s method, calculate the approximate solution to the initial value problem
du/dt + t cos(u) = 0, subject to u(0) = −0.2,
at t = 0.4, on a uniform grid with spacing ∆t = 0.1.
In: Electrical Engineering
PYTHON (BEGINNER) program that allows the user to choose any of the three sports options described below and computes the relevant statistic in each case: Quidditch Score Total: Determined based on the number of goals and whether or not the snitch was caught. A goal is scored by propelling the quaffle through a hoop and each earns the team 10 points. If a team catches the snitch, that team earns an additional 30 points. The snitch can be caught at most once. More details on Quidditch available from the International Quidditch Association. (Simplified) Quarterback Rating: Defined as 100 * [5(completions/attempts – 0.3) + 0.25(passing_yards/attempts-3) + 20(touchdown_passes/attempts) + 2.375 – (25 * interceptions/attempts)]/6, where attempts is the number of passing attempts made, completions is the number of completed passing attempts, touchdown_passes is the number of passes for a touchdown, and interceptions is the number of times the ball was intercepted. A perfect passer rating in the NFL is considered to be a 158.3. In addition to the rating, tell the user whether or not the quarterback is a perfect passer. Gymnast Score: Begins with six scores, one for difficulty and five for execution, each between 0 and 10. Of the execution scores, the highest and lowest are dropped. The final score is given by the sum of the difficulty score and the average of the three remaining execution scores. Input Validation: Check if you are going to divide by zero when relevant, and do not do the calculation if that is the case. Before typecasting user inputs to an int, check that it is only digits, and don’t typecast or do the calculation otherwise. (For this assignment, do not worry about checking if floats are valid.) In any case where an error is detected, output an error message. Do not continue the calculation. You may additionally output a result of zero in such a case.
In: Computer Science
Selected ratios for 2018 for two companies in the same industry are presented below:
| Ratio | Potter | Draco | Industry Average |
| Asset turnover | 2.7x | 2.3x | 2.5x |
| Average collection period | 31 days | 35 days | 38 days |
| Basic Earnings per share | $2.75 | $1.25 | Not available |
| Current Ratio | 1:9:1 | 3:0:1 | 1:8:1 |
| Dividend yield | 0.3% | 0.1% | 0.2% |
| Debt to total assets | 48% | 32% | 45% |
| Gross profit margin | 30% | 34% | 33% |
| Inventory turnover | 10x | 7x | 8x |
| Payout ratio | 9% | 19% | 14% |
| Price-earnings ratio | 29x | 45x | 38x |
| Profit margin | 8% | 6% | 5% |
| Return on assets | 12% | 10% | 10% |
| Return on common shareholders' equity | 24% | 16% | 18% |
| Time interest earned | 5.2x | 7.6x | 7.2x |
REQUIRED: Answer each of the following questions providing the ratio(s) to support your answer, explain.
1) Comment on how successful each company appears to managing
its accounts receivable. Terms are net 30 for both companies
2) How well does each company appear to be managing its
inventory?
3) Which company is more solvent, explain using
ratios?
4) Which company is more profitable, explain using ratios?
5) The gross profit margin for Draco is higher than Potter's and
the industry average. Provide two reasons why this would be the
case?
6) Which company would investors believe would have greater
prospects for seeking growth?
7) Why is Basic Earnings per Share not comparable between
companies?
In: Accounting
Case:
Carl Kelly is an American transpatriate assigned to Motorola’s facility in a former USSR satellite nation in Eastern Europe, called Ruritania. Carl has found that Ruritanian culture strange and experienced a bit of culture shock, which explains why he arranged to have his wife Kathleen join him as soon as possible. Kathleen arrived in Ruritania 10 months ago, eagerly looking forward to spending more time with Carl than was possible back in Florida. She was rudely surprised. In those 10 months she was able to spend “quality” time with him on exactly 7 weekends!
Then came some good news. Last month Carl was told that for the next four weeks you would be assigned to Surabaya, Indonesia. Kathleen, who had a long-standing interest in Javanese arts, wanted to go along. That way, on weekdays she could enjoy local music, dance, drama, painting and sculpture, and on weekends she and Carl could finally snatch some quality time together in nearby Bali.
But there was a problem. All three of the Kelly children were in college, and their combined tuition payments were huge financial burden, making it difficult to afford Kathleen’s airfare to Indonesia.
Yaroslav, a Ruritanian colleague of Carl’s, offered to help them out. Yaroslav got in touch with Easy Virtue Travel, a most obliging local company. That evening Easy Virtue delivered to round-trip coach tickets to Surabaya for Carl and Kathleen, along with a bill for just one round trip “business-class” passage for Carl. This way, Carl would bill Motorola for business-class reimbursement, while he and Kathleen would fly coach. Carl would be personally out-of-pocket only an extra $27.94 for Kathleen’s seat. “Not bad,” exclaimed Carl. “That will make up for all of those lonely weekends,” added an eager Kathleen.
That night, though, Carl had trouble sleeping. “Deserve it or not, this is probably against some corporate regulation. I better check with Sam.”
Sam Smoothover was Motorola’s HR manager for Ruritania. Sam had long experience in the former satellite countries and suspected that local Ruritania travel agencies often did things that were technically frowned upon by foreigners, yet actually humane in their consequences. Sam also enjoyed an enviable reputation for putting the well-being of Motorolans high on his list of value priorities – certainly higher than formal compliance with the details of regulations set by headquarters 4,000 miles away.
Sam’s reaction was, “Okay, Carl, you and Kathleen make the trip this time. I just don’t go around talking to people about it.”
However, a few days later Sam had his own second thoughts and decided to check with corporate officials in Schaumburg, just to make sure it really was okay.
Additional information for the case:
Motorola allows for business travel for any trip over five hundred miles so Carl could travel with a business class ticket. The home office also recognizes that the Ruritania assignment is difficult given the primitive living conditions there and that unlike several of his predecessors Carl has done an exceptional job meeting the requirements of the company.
Answer the following questions.
1. What is the issue?
2. Do you think that the travel plan for Carl and his wife appropriate? Why?
3. What are your thoughts regarding Sam Smoothover's response to Carl? What would you have done?
In: Statistics and Probability
Here is an example of T-test down blow (it doesn't have to be exactly) I need to help with my data which it is about phone service survey. Please help and I really appreciate your time.
T-test looked at how far people travel to visit a healthcare clinic compared to how easy it was to understand the information that their physician was explaining to them (Table 2). The sample group was divided into two categories: people who travel less (?5 miles) and people who travel more (?6 miles). Table 2 shows that, on average, people who travel less understood more information that their physician was explaining to them than the people that traveled more (people who travel less = 4.63, people who travel more = 4.10, p = .026). The conclusion that could be drawn from this finding is that physicians who work in clinics close to dense populations are better at explaining information to their patients. This could be due to these physicians seeing more patients with similar conditions, making it easier for them to explain information to their patients with similar conditions.
Table 2. Distanced Normally Traveled vs. How Easy Information was Explained by Physician
Group Statistics
|
NormTravel.re |
N |
Mean |
Std. Deviation |
Std. Error Mean |
||
|
Information |
People who travel less People who travel more |
19 |
4.6316 |
.49559 |
.11370 .19401 |
|
|
21 |
4.0952 |
.88909 |
Independent Samples Test
|
Levene's Test for Equality of Variances |
t-test for Equality of Means |
||||||||
|
F |
Sig. |
t |
df |
Sig. (2tailed) |
Mean Difference |
Std. Error Difference |
95% Confidence Interval of the Difference |
||
|
Lower |
Upper |
||||||||
|
Information Equal variances assumed Equal variances not assumed |
3.098 |
.086 |
2.322 |
38 31.914 |
.026 .023 |
.53634 |
.23102 |
.06866 .07824 |
1.00402 |
|
2.385 |
.53634 |
.22488 |
.99444 |
||||||
Table 2. Distanced Normally Traveled vs. How Easy Information was Explained by Physician
Group Statistics
|
NormTravel.re |
N |
Mean |
Std. Deviation |
Std. Error Mean |
||
|
Information |
People who travel less People who travel more |
19 |
4.6316 |
.49559 |
.11370 .19401 |
|
|
21 |
4.0952 |
.88909 |
Independent Samples Test
|
Levene's Test for Equality of Variances |
t-test for Equality of Means |
||||||||
|
F |
Sig. |
t |
df |
Sig. (2tailed) |
Mean Difference |
Std. Error Difference |
95% Confidence Interval of the Difference |
||
|
Lower |
Upper |
||||||||
|
Information Equal variances assumed Equal variances not assumed |
3.098 |
.086 |
2.322 |
38 31.914 |
.026 .023 |
.53634 |
.23102 |
.06866 .07824 |
1.00402 |
|
2.385 |
.53634 |
.22488 |
.99444 |
||||||
Here is my data down blow and I need help with interpret or explain just like the exmpale. Thank you so much!
|
Group Statistics |
|||||
|
Gender |
N |
Mean |
Std. Deviation |
Std. Error Mean |
|
|
Overall Satisfaction |
Male |
17 |
4.35 |
.786 |
.191 |
|
Female |
18 |
4.11 |
.832 |
.196 |
|
|
Levene's Test for Equality of Variances |
t-test for Equality of Means |
||||||||||
|
F |
Sig. |
T |
df |
Sig. (2-tailed) |
Mean Difference |
Std. Error Difference |
95 % confidence interval of the difference |
||||
|
Lower |
Upper |
||||||||||
|
Overall Satisfaction |
Equal variances assumed |
.009 |
.927 |
.883 |
33 |
.384 |
.242 |
.274 |
-.316 |
.799 |
|
|
Equal variances assumed |
.884 |
33.000 |
.383 |
.242 |
.274 |
-.315 |
.798 |
||||
In: Statistics and Probability
Case Study: Omega College
Omega College is a private liberal arts college located in a small
town in the Midwest. The closest large city is about fifty miles
away. There is a community college in the next town about twenty
miles away. Most faculty and staff live in the town or in small
towns nearby.
Originally a Protestant-affiliated institution, Omega is now a
completely independent institution and receives no funding from the
church. It was founded in the late 1800s to meet a pressing need
for teachers in the state. Until recently enrollment at Omega has
been relatively stable, with average enrollment of 850 full-time
undergraduates, some limited programs for part-time students, and a
very limited master's degree program in education focusing on
certification issues in the state. Undergraduates come to Omega
from nearby states, although there is a smattering of students from
other areas of the country. There is a very small international
student enrollment and most international students study at Omega
for a semester and then return home.
Omega has a robust information site on U-Can (the University and
College Accountability Network). The cost of tuition is $25,000 for
the academic year and room and board is an additional $7800 for two
semesters. About 70% of the full-time students who attend Omega
receive some type of financial aid (state, federal, and/or
institutional).
In each of the last four years the freshman enrollment has missed
the target by about twenty students. To offset that enrollment
drop, the admissions staff developed an outreach program to the
nearby community college to encourage transfer students, but most
of the community college transfer students go to the regional
campus of the state university to complete their bachelor's degree.
There is a nearby military base, but students rarely come to Omega
from that source. The average enrollment over the last four years
has dropped to 800 full-time students. This is of concern for many
reasons, not the least of which is the financial health of the
institution.
Omega has a very limited endowment (most of which is earmarked for
student financial aid, some academic departmental support, and
three endowed professorships) and thus is very dependent on
undergraduate tuition to meet the day-to-day operating expenses of
the institution. Graduate tuition for the part-time teacher
certification program is a financial plus for the
institution.
An annual fund program is essential to the fiscal health of the
institution and relies on the generosity of board members, alumni,
and friends of the institution to help fund the annual operating
budget. The decline in enrollment has caused the institution to
reduce nonessential budget expenditures, and faculty and staff have
not received a raise for the past two years. Obviously, Omega
College is just holding on and a new approach to financing the
ongoing expenses of the institution is needed.
The institutional administration and faculty and the governing
board are currently focused on development of a strategic plan for
the institution that deals with both the financial and enrollment
questions. The strategic planning committee is charged with the
following responsibilities:
1.The development of a five-year financial
plan for the institution.
2.The development of an academic plan that
increases the options and opportunities for students to come to
Omega College at the undergraduate and graduate levels.
3.The development of an aggressive institutional
advancement plan. As the committee does its work the college
administration must work to stabilize enrollment and keep the doors
of the institution open.
What other actions might you recommend that the institution consider for the short term?
In: Finance
1/1/17 Co buys land and pays $50,000 for the land, $500 for removal of scrap, $2500 for attorney’s fee (associated with land purchase), $2500 real estate commission, $5000 for accrued taxes and $1000 for current-year taxes. Journalize the land purchase.
Also on 1/1/17, Co buys a car and a computer. The car costs $25,000 , sales tax $2000 and insurance during delivery $1000. The car has an estimated 100,000 miles of useful life and a salvage value of $3000. The computer costs $3000, tax $400 and insurance during deliver of $100. The computer has and estimated useful life of 5 years and a salvage value of $500. Journalize the purchase of both.
On 12/31/17 the car has 10,000 miles on the odometer. Journalize the depreciation of the car using units of activity and the computer using straight-line.
On 7/1/18 the car has 15,000 on the odometer and was sold for $25,250. Make the appropriate journal entries.
12/31/18 Co exchanges computer for a new one and pays $500 cash in the trade. The fair market value of the old computer is $2000. Remember the company is using straight line method for the computer. Make the appropriate journal entries.
1/1/19 Co pay $50,000 for a patent estimated to have a useful life of 10 years. Co also pays $10,000 research and development costs associated with the patent and $5000 legal costs to defend the patent in court. Make appropriate journal entries:
If 5 years ago a company bought a $10,500 piece of equipment with $500 salvage value and 10 year usefull life and is using straight-line depreciation what is its book value now? If it revises estimated life to 15 years (10 more years left) what is revised annual depreciation?
What is the cost-allocation account for a natural resource?
On January 1, Company sells merchandise and collects $5000 in cash which includes 6% sales tax. Journalize the sale.
Company’s employees earned $20,000 for the pay period ending January 31. The Company withholds $1530 FICA, $4373 Federal Income Tax and $585 State Income Tax. Journalize the entry.
On January 1 Company issues a 5 year $1,000,000 face value bond with a 5% annual coupon paid semiannually. The company issues it for $916,884 for an effective interest rate of 7% and uses the effective-interest amortization method. Journalize the issuance:
What is the total cost of the borrowing over the life of the SSS bond?
Journalize the entry on July 1 to record SSS’s payment of interest and the amortization of the bond discount (assume no accrual was made June 30):
What is the accrual JE on 12/31?
On July 1 Incorporation issues a 10 year $2,000,000 face value bond with a 6% coupon paid semiannually. The Company issues it for $2,327,029 at an effective interest rate of 4%. Journalize the issuance.
Journalize the adjustments made by Incorporation on December 31 for the accrual of interest expense and the amortization of bond premium.
On February 1, ABC redeems its $3,000,000 face value bonds before maturity at a price of $2,600,000. The bonds were originally issued at a discount and currently the account Discount on Bond Payable has a debit balance of $500,000. Journalize the bond redemption.
In: Accounting
QUESTION 5: Case Study I - ETHICS CASE STUDY [10 Marks] One for the Road—Anyone? “Florence Yozefu is a brilliant scientist who heads a robotics research laboratory at one of the top ten research universities. Florence has been developing wearable robotics gear that can take over the driving functions of a vehicle from a human operator when it is worn by the driver. In laboratory tests, the robot, nicknamed Catchmenot, has performed successfully whenever Florence and her assistants have worn the robot. However, no real-life experiment has ever been conducted outside the lab. Florence has been planning to try it out in her project plan but has not yet had a chance to do so. For New Year’s Eve, Florence has plans to visit her mother and sister, about 100 miles away. This was a good opportunity to show her mother and her sister what she has been working on in the last few months. So, she decides to take Catchmenot with her. She packs her car the evening before and on the morning of the trip, she passes by the lab to get her robot and put it in the car. She drives the 100 miles in a little under her usual time and arrives at her mother’s house earlier than usual”. “In the evening, Florence bids her mother good-bye and passes by her sister’s apartment as promised. At her sister’s apartment, she finds a few of her teen friends and they get right into a party mode. Florence drinks and dances and forgets about the time. There are many stories to tell and to listen to. About 1:00 a.m., after the midnight champagne toast, she decides to leave and drive back to her apartment. She had promised to accompany her friends to a pre-planned engagement. Although she is very drunk, and against her friend’s advice and insistence that she should not drive, Florence puts on Catchmenot and in a few minutes she is off. Thirty minutes later, she is cruising at 70 mph and she is also sound asleep. She is awakened by a squirrel running all over her car at about 5:00 a.m. She is parked by the roadside in front of her apartment complex. She has made it home safely. She has no idea when and where she passed out and what happened along the way. She will never know. Although she is surprised, confused, and feels guilty, she is happy how well Catchmenot has worked. She decides to market it. How much should she charge for it, she wonders”. [Source: Kizza J.M. History of Computing. In: Ethical and Social Issues in the Information Age, 2010, Texts in Computer Science. Springer, London] Please answer the following questions:
1. As AI applications increase, such as in the use of robotics, will the wider use of these “manlike” machines compromise our moral values system? Why or why not? [2 Marks]
2. Discus the future of computer ethics in the integrated environment of Artificial Intelligence (A I), Virtual Reality (VR), and cyberspace. [3 Marks]
3. If anything went wrong during the ride home, would Florence be responsible? Who should be? What are the consequences? [3 Marks]
4. Discuss the ethical implications of Artificial Intelligence. [2 Marks
In: Computer Science