Questions
D’Lite Dry Cleaners is owned and operated by Joel Palk. A building and equipment are currently...

D’Lite Dry Cleaners is owned and operated by Joel Palk. A building and equipment are currently being rented, pending expansion to new facilities. The actual work of dry cleaning is done by another company at wholesale rates. The assets, liabilities, and common stock of the business on July 1, 2016, are as follows: Cash, $30,000; Accounts Receivable, $76,000; Supplies, $10,000; Land, $43,000; Accounts Payable, $32,500; Common Stock, $50,000. Business transactions during July are summarized as follows:

A. Joel Palk invested additional cash in exchange for common stock with a deposit of $23,000 in the business bank account.
B. Purchased land adjacent to land currently owned by D'Lite Dry Cleaners to use in the future as a parking lot, paying cash of $35,000.
C. Paid rent for the month, $3,200.
D. Charged customers for dry cleaning revenue on account, $73,000.
E. Paid creditors on account, $19,800.
F. Purchased supplies on account, $8,000.
G. Received cash from cash customers for dry cleaning revenue, $37,000.
H. Received cash from customers on account, $75,000.
I. Received monthly invoice for dry cleaning expense for November (to be paid on December 10), $29,050.
J. Paid the following: wages expense, $25,000; truck expense, $2,900; utilities expense, $1,300; miscellaneous expense, $1,400.
K. Determined that the cost of supplies on hand was $9,300; therefore, the cost of supplies used during the month was $8,700.
L.

Paid dividends, $7,000.

Required:
1. Determine the amount of retained earnings as of July 1 of the current year.
2. The assets, liabilities, and stockholders’ equity as of July 1 are stated in equation form similar to that shown in this chapter. In tabular form below the equation, indicate increases and decreases resulting from each transaction and the new balances after each transaction. In each transaction row (rows indicated by a letter), you must indicate the math sign (+ or -) in columns effected by the transaction. You will not need to enter math signs in the balance rows (rows indicated by Bal.). Entries of 0 (zero) are not required and will be cleared if entered.
3.a. Prepare an income statement for the month ended July 31, 2016. Refer to the Accounts in the accounting equation grid and to the list of Labels and Amount Descriptions for the exact wording of the answer choices for text entries. Be sure to complete the statement heading. If a net loss has been incurred, enter that amount as a negative number using a minus sign. You will not need to enter colons (:) on the income statement.
3.b. Prepare a retained earnings statement for the month ended July 31, 2016. Refer to the lists of Accounts in the accounting equation grid and to the list of Labels and Amount Descriptions for the exact wording of the answer choices for text entries. Be sure to complete the statement heading. Enter all amounts as positive numbers. The word “Less” or “Add” is not needed in the Retained Earnings Statement.
3.c. Prepare a balance sheet as of July 31, 2016. Refer to the Accounts in the accounting equation grid and to the list of Labels and Amount Descriptions for the exact wording of the answer choices for text entries. Be sure to complete the statement heading.
4. Prepare a statement of cash flows for July. Enter amounts that represent cash outflows as negative numbers using a minus sign. Refer to the list of Labels and Amount Descriptions for the exact wording of the answer choices for text entries. Be sure to complete the statement heading. You will not need to enter colons (:) or the word Deduct on the statement.

In: Accounting

Question 10 0/1 point (graded) The bash profile in your home directory contains information that the...

Question 10

0/1 point (graded)

The bash profile in your home directory contains information that the bash shell runs each time you use it. You can customize the information in your bash profile to tell your system to do different things. For example, you can make an “alias”, which acts like a keyboard shortcut.

Which line of code, when added to your bash profile, will let you print “seetop” to view the name, size, and file type of the 10 most recently added visible files?

alias seetop=’ls -lt’

alias seetop=’ls -lt | head’

alias seetop=’ls -t | head’ incorrect

alias seetop=’head | ls -l’

Answer

Incorrect:

Try again. You want to see the size and file type too. This command will only show the name.

Question 1

0/1 point (graded)

Why might you want to create a report using R Markdown?

R Markdown has better spell-checking tools than other word processors.

R Markdown allows you to automatically add figures to the final document.

R Markdown final reports have smaller file sizes than Word documents.

R Markdown documents look identical to the final report. incorrect

Answer

Incorrect:

Try again. The final report looks different than the working R Markdown document. For example, plots called in the R Markdown document do not show up until the final report is compiled.

You have used 1 of 2 attempts Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.

Incorrect (0/1 point)

Question 2

0/1 point (graded)

You have a vector of student heights called heights. You want to generate a histogram of these heights in a final report, but you don’t want the code to show up in the final report. You want to name the R chunk “histogram” so that you can easily find the chunk later.

Which of the following R chunks does everything you want it to do?

```{r, histogram, message=FALSE}

hist(heights)

```

incorrect

```{r histogram, warning=FALSE}

hist(heights)

```

```{r, echo=FALSE}

hist(heights)

```

```{r histogram, echo=FALSE}

hist(heights)

```

Answer

Incorrect:

Try again. message=FALSE and the similar warning=FALSE stop R from printing non-code text, but the code will still be echoed.

You have used 1 of 2 attempts Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.

Incorrect (0/1 point)

Question 5

0/1 point (graded)

```{r, echo=F}

n <- nrow(mtcars)

```

Here `r n` cars are compared

What will be the output for the above Rmarkdown file?

The only output is the text: Here 32 cars are compared.

Since we have echo=F, the code chunk is not evaluated, therefore we will have both the code and the text: Here `r n` cars are compared. incorrect

The code will be displayed as well as Here 32 cars are compared.

R cannot comprehend the value of n, we will get an error.

You have used 1 of 2 attempts Some problems have options such as save, reset, hints, or show answer. These options follow the Submit button.

In: Computer Science

Part A                                         &nb

Part A                                                                                                                     

You are working as an accountant for Bronson, Lazenby & Dalton and the senior partner has asked you to prepare a report answering the following questions about consolidation procedures for a client:

Follyfoot Ltd has a 33% interest in the share capital of Cue Ltd, which is a company involved in the same industry as Follyfoot Ltd. The remaining share capital is owned by Mr and Mrs Lewelyn who are the founders of Cue Ltd. Mr and Mrs Lewelyn have given Follyfoot Ltd three out of five seats available on the board of directors. Follyfoot Ltd takes the lead on all decisions but the business is closely monitored by Mr and Mrs Lewelyn who hold the other two board positions.

Advise the directors of Follyfoot Ltd of the requirements of AASB 10 in respect of the control criterion and how they would apply to this investment.

Why is it necessary to make adjustments for intra-group transactions?

As the majority of the directors do not have an accounting background, your report answering the questions must be written to convey a clear understanding of consolidation accounting concepts (control vs significant influence) and other relevant accounting issues.

Part B                                                                                                              

You have been asked to prepare the consolidated accounts for a group of companies that contain an Australian company called Prym Ltd and their foreign subsidiary Lang Inc. Prym Ltd and Lang Inc both have functional currencies of the country they reside in, but for presentation purposes the group reports in Australian dollars. Prym Ltd bought all the shares of Lang Inc at the beginning of the current year. Their Trial Balances Reports are available on the Brightspace site. You will need to copy your individual excel file from Brightspace. The password to open the has been emailed to you. You may complete this assignment manually or using either word or excel. (If you complete in word or excel please ensure an electronic copy of your file is uploaded in brightspace)

In order to complete this task, you are required to:

  • Translate Lang Inc’s data into Australian Dollars
  • Consolidate the two sets of Accounting Records

and

  • Prepare General Purpose Financial Reports for the consolidate group
                (Statement of Income and Statement of Financial Position only).

Calculations should not be rounded until the General Purpose Financial Reports, but should be shown to the nearest dollar in your reports

You need to submit the requested reports and all your work papers showing your calculations.

Addition Information for Part B

  • Closing Inventory for Lang Inc was ÂŁ895,000
  • Closing Inventory for Pym Ltd was A$2,350,000
  • Pym Ltd sold A$5,600,000 of stock to Lang Inc during the year
  • Lang Inc had sold all that stock by year end, but because of extended trading terms offered to Lang Inc, Pym Ltd still had A$700,000 of inter company sales in their debtors' balance.
  • Pym Ltd charges Lang Inc A$1,000 per month in technical advice and charged a total of A$241,500 in interest on the inter-company loan.
  • Lang Inc paid their ÂŁ20,000 Interim Dividend on the 26th of January.
  • Lang Inc declared their Final Dividend on the 30th June and plan to pay the dividend on the 2nd of August

Summary of Exchange Rates

1st July

ÂŁ 1.00 =

A$2.21

Average rate for the year

ÂŁ 1.00 =

A$2.24

Ending Inventory (Pur'd before year end)

ÂŁ 1.00 =

A$2.35

26th January

ÂŁ 1.00 =

A$2.22

30th June

ÂŁ 1.00 =

A$2.37

2nd August

ÂŁ 1.00 =

A$2.33

In: Accounting

*Work the problems in EXCEL. 1. Problem 1: =======>>>>>>Open data files: JeepSales.xlsx and JeepTable.xlsx ( copy...

*Work the problems in EXCEL.

1. Problem 1:

=======>>>>>>Open data files: JeepSales.xlsx and JeepTable.xlsx ( copy this)

(a) Learn the PivotTable to derive JeepTables.xlsx from JeepSales.xlsx. [Hint: Click Insert,  

PivotTable, highlight the data]

(b) Construct a Frequency Bar chart, Pie chart.  

Reduce graph size. Copy/paste into a MS Word file.

Jeep Model
W
L
G
L
G
C
L
G
C
G
L
W
L
G
W
G
L
W
W
G
L
L
L
G
L
G
L
G
L
W
L
G
L
G
L
C
C
W
C
G
L
G
G
L
C
C
C
G
L
L
C
G
L
C
W
G
G
W
C
W
W
L
C
L
L
C
G
L
G
L
C
W
C
G
G
L
L
C
W
L
G
C
C
G
C
C
L
C
G
C
G
G
C
W
W
L
C
C
L
L
C
C
C
L
L
C
C
L
L
G
L
C
G
G
C
C
L
C
G
C
C
G
C
C
L
C
C
L
W
C
L
W
C
L
W
L
W
G
W
L
L
C
C
W
L
C
L
G
W
C
W
W
L
L
C
L
L
G
L
G
C
C
G
G
C
C
L
L
L
W
C
G
G
L
W
G
L
L
L
G
L
G
G
L
G
G
G
C
C
C
G
L
G
C
C
G
C
G
L
W
G
C
L
G
L
C
G
C
C
L
G
L
G
C
L
G
G
C
G
G
W
L
G
L
C
C
L
L
C
L
C
G
L
L
C
L
C
G
G
G
C
W
G
G
L
W
L
G
G
L
L


2. Problem 2:   

=========>>>>>>Open data file: Design.xlsx. Construct,

(a) A Histogram with a revised Bin size. (Bin width =2).  

(b) A Frequency Polygon.  

(c) A Cumulative Percentage Histogram (ogive).

Reduce size. Copy and paste into the MS Word file.

Rating
34
32
24
32
31
32
33
25
30
28
28
30
33
27
20
30
33
34
29
33
34
31
31
32
26
22
31
31
32
30
33
27
32
33
28
30
28
32
30
29
26
32
25
33
35
27
29
31
32
32
33
34
32
29
33
29
31
31
34
33

In: Math

HIMT 345 Homework 06: Iteration Overview: Examine PyCharm’s “Introduction to Python” samples for Loops. Use PyCharm...

HIMT 345
Homework 06: Iteration
Overview: Examine PyCharm’s “Introduction to Python” samples for Loops. Use PyCharm to work along with a worked exercise from Chapter 5. Use two different looping strategies for different purposes.
Prior Task Completion:
1. Read Chapter 05.
2. View Chapter 05’s video notes.
3. As you view the video, work along with each code sample in PyCharm using the Ch 5 Iteration PPT Code Samples.zip.
Important: Do not skip the process of following along with the videos. It is a very important part of the learning process!
Specifics: PyCharm’s “Introduction to Python” project contains several examples of iterations or looping (see list at right). Follow the instructions to complete them. (Not handed in.)
Use PyCharm to work along with the video solution for Exercise 5.1 from the textbook. Type in the statements and execute the program as is done in the video. [Create a project and save your work as “Worked_Exercise_5.1”. It will prove valuable for part a below.] (Not handed in.)
Create a new PyCharm project called “Hwk06_”. Create two new python files within that project called “Hwk06a_” and “Hwk06b_”.
Part (a): Let’s write the code to prompt the user for (an integer) blood-sugar reading (BSR) and print a warning message if it is over 500. Also, print the message “>> Invalid input” if the user enters a non-integer, such as a float or a string.
Having completed Worked_Exercise_5.1 above you should use that code as the basis for this problem.
Use this sample interaction to demonstrate your code:
Enter a BSR: 155
Enter a BSR: string input
>> Invalid input
Enter a BSR: 522
** Warning! Blood sugar reading over 500: 522
Enter a BSR: 485
Enter a BSR: 578
** Warning! Blood sugar reading over 500: 578
Enter a BSR: 210
Enter a BSR: 330.6
>> Invalid input
Enter a BSR: 519
** Warning! Blood sugar reading over 500: 519
Part (b)
Create a list of BSRs as follows:
blood_sugar_readings = [155, 190, 522, 485, 578, 210, 130, 519]
Use a for-loop to iterate through the list in order to find the highest and lowest BSR values. Note that finding the maximum and minimum values of a list using a for-loop is shown in Section 5.7.2 of the textbook on p. 62-3. (Note that since we are ‘hard-coding’ the list, we may assume the data is valid, i.e., it has been previously checked.)
HINT: as is done in the textbook, while developing the code, add a print statement as the last line of the for-loop writing out the current BSR value, the smallest, and the largest. Then when your code is running correctly, you can comment out that line (but leave it in the code-base).
After looping through the list, print the highest and lowest BSR values.
What to hand in:
Take screen snips of the Run window for Parts (a) and (b). Use the snipping tool on the console portion of the screen – but including the header bar and the file name.
Copy the snips into a Word document (filename Hwk06_YourLastName_ScreenSnips.doc) with your name and date in the upper right hand corner.
Upload the Word doc and the Python program files Hwk06a_YourLastName.py and Hwk06b_YourLastName.py to the appropriate assignment in the LMS. Three files total.
NOTE: As was described in the previous assignment, each Python file you create should be documented with (minimally) the following three lines at the top of each
file:
# Filename: Hwk06_YourLastName.py
# Author:    < your name>
# Date Created: 2017/09/05
# Purpose: < brief descriptions>

In: Computer Science

Read the following article The Mayo Clinic and the technology company Medically Home are partnering to...

Read the following article

The Mayo Clinic and the technology company Medically Home are partnering to launch a new healthcare delivery model that will deliver “advanced care” typically available inside a hospital into patient homes.

Financial terms of the partnership announced Wednesday weren’t disclosed but executives involved said Boston-based Medically Home is providing “technology infrastructure.” And Mayo, which made an undisclosed investment in Medically Home last year, is providing the medical care or directing those that do provide the treatment for “high acuity patients.”

“Under the direction of Mayo Clinic physicians, advanced care at home offers comprehensive and restorative health care services including infusions, skilled nursing, medications, laboratory and imaging services, behavioral health, and rehabilitation services from a network of paramedics, nurses and an ecosystem of support team members,” Mayo said in a statement.

The first such programs to offer “advanced care at home” will be implemented in July in Jacksonville, Fla., and in August in Eau Claire, Wis. Mayo has long had hospitals, health facilities and physicians in those markets.

The partnership comes as medical care providers escalate their efforts to use the latest technology to center treatment around the patient, making sure healthcare is delivered in the right place, at the right time and in the right amount. Some also see the effort to provide more healthcare into patient homes as ready to take off as cases of the coronavirus strain Covid-19 continue their surge and patients look for new safe and effective ways to get home-based care during the pandemic.

“Offering comprehensive, acute and restorative level care to patients in the comfort and safety of the home is an expectation of patients,” Mayo Clinic Platform president Dr. John Halamka said in a statement accompanying the announcement. “Advances in technology and platform business models allow us to give patients the next generation of medical care and experience consumers expect. It is a shifting paradigm in the health care system and Mayo Clinic intends to lead this new option for patients.”

Medically Home has already been attracting investments for its projects like its “Virtual Hospital,” which the company says “transforms patients’ homes into temporary hospital units, enabling advanced medical care at bedside.” Last year, the big healthcare supplier and distributor Cardinal Health invested $10 million into Medically Home.

Mayo said it selected Medically Home as a partner because the platform allows medical care providers to “shift advanced medical care to patients’ homes safely” and offers “an integrated technology platform and network of in-home services” that can be director by Mayo doctors. “The work we will be doing together in this model will have a profound impact on how we all look at the future of medical care,” Medically Home executive chairman Raphael Rakowski said.

Answer the following questions using concepts from chapters 6 and 7:

  1. The article states: “
 invite more calls from politicians to enact price controls for drugs”. What kind of government action in markets could some politicians advocate for? Would the result of that action be fair and/or efficient? Explain. (max. word count: 50)
  2. What kind of price elasticity of demand does a life-saving drug have?
  3. In the US, the allocation of vaccines follows a public-private partnership, where government purchases account for more than 50% of the vaccine market (NCBI, 2003). Would the market price alone work as an allocation method? Explain. (max. word count: 50)

In: Economics

Create the Database: The data is the same as was described in the ER Design Project...

Create the Database:

The data is the same as was described in the ER Design Project assignment. In that assignment you were asked to map the ER diagram to relations in the database. Here is a formal description of the relations that you will use in this assignment:

streamTV Database Relations

shows(showID, title, premiere_year, network, creator, category)

episode(showID, episodeID, airdate, title)

  • showID is a foreign key to shows

actor(actID, fname, lname)

main_cast(showID, actorID, role)

  • showID is a foreign key to shows
  • actID is a foreign key to actor

recurring_cast(showID, episodeID, actorID, role)

  • showID is a foreign key to shows episodeID is a foreign key to episode
  • actID is a foreign key to actor

customer(custID, fname, lname, email, creditcard,membersince,renewaldate, password, username)

cust_queue(custID, showID, datequeued)

  • custID is a foreign key to customer
  • showID is a foreign key to shows

watched(custID, showID, episodeID, datewatched)

  • custID is a foreign key to customer
  • showID is a foreign key to shows
  • (showID, episodeID) is a foreign key to episode
  • (custID, showID) is a foreign key to cust_queue

Primary keys are in bold.

Question:

SQL Queries:

The management at streamTV needs to retrieve certain information about their the data in the database. Specify the SQL queries for the questions listed here:

1. Find the titles and premiere years of all shows that were created after 2005.

2. Find the number of episodes watched by each customer, sorted by customer last name.

3. Find the names and roles of all actors in the main cast of Friday Night Lights.

4. Find all actors who are in the main cast of at least one show and in the recurring cast of at least one show. Display the actor's first name, last name, the title of the show in which the actor is in the main cast, the title of the show in which the actors is in the recurring cast, and the role the actor plays in each show.

5. How many shows have episodes with the word "good" in the title.

6. List the show title, episode number, date and episode title for all of the shows with the word "good" in the title. Sort the list by airdate.

7. Which episodes that have been watched originally aired in 2005. Display the show title, the episode title and the original air date.

8. Display the names of all actors who have had recurring roles in shows on NBC. Include the name of the actor, the title of the show and the role.

9. A customer wants to add to her queue every show that Amy Poehler has appeared in. List all of these shows by title.

10. For each customer (display first and last name), display which show and episode was the first one watched by that customer. Sort the result by the customer's last name.

11. Find all shows that have more than 5 seasons. Display the title of the show, and the number of seasons. Sort the result by the number of seasons. Note that the first digit of each episode number represents the season number.

12. Find the titles of all shows that were not watched by any customers in August of 2013.


13. List the title of the show that has been watched the most by customers. Also display the number of times it has been watched.

14. For each show, list the number of customers who have that show in their queue. Display the show title and the number of customers. Sort by show title.

In: Computer Science

########################################################### # Lab 5 - Debugging # Name: # Date: # # Objective: # The purpose...

###########################################################
# Lab 5 - Debugging
# Name:
# Date:
#
# Objective:
# The purpose of this lab assignment is to help you understand
# debugging processes in assembly language using debug tools
# provided by QtSpim
#
# Description:
# 1) Syntax, logic, and comment errors exist in:
# - main
# - print_array
# - read_array
# - allocate_array
# 2) Find and fix the syntax, logical, and comment errors
# *** Hint: Find all the "#To do" and fix bugs ***
# *** There are 23 total bugs to fix! ***
# 3) Test the code. If the code is working, submit to
# the Lab #5 dropbox on Canvas
#
# Note:
# sort_array subprogram is correct and has no bug, do not modify sort_array!
#
# Sample run:
# Enter size of the array to allocate (size > 0): 5
# Enter an integer: 4
# Enter an integer: 3
# Enter an integer: 2
# Enter an integer: 1
# Enter an integer: -5
# Array: 4 3 2 1 -5
# Array: -5 1 2 3 4
#
###########################################################
.data
array_pointer_p: .word 0 # holds address of dynamic array (address)
array_size_p: .word 0 # hold size of dynamic array (value)

newline_p: .asciiz "\n"
###########################################################
.text
main:
# set up arguments for allocate_array subprogram
la $a0, array_pointer_p # load the address of static variable array_pointer into register $a0
la $a1, array_size_p # load the address of static variable array_size into register $a1
jal allocate_array # call subprogram allocate_array
# arguments IN: address of static variable "array_pointer" & "array_size"
# arguments OUT: NONE

# set up arguments for read_array subprogram
#To do: Think about the logic and syntax and fix errors

la $a0, array_pointer_p # load the address of variable array_pointer into register $a0
la $a1, array_size_p # load the address of variable array_size into register $a1
jal read_array # call subprogram read_array
# arguments IN: true address of dynamic array and array size value
# arguments OUT: NONE

# calling subprogram print_array
#To do: Think about the logic and syntax and fix errors
la $a0, array_pointer_p # load the address of variable array_pointer into register $a0
la $a1, array_size_p # load the address of variable array_size into register $a1
jal print_array # calling subprogram print_array

# print newline character
la $a0, newline_p # prints newline character
li $v0, 4
syscall
# calling subprogram sort_array
#To do: Think about the logic and syntax and fix errors

la $a0, array_pointer_p # load the address of variable array_pointer into register $a0
la $a1, array_size_p # load the address of variable array_size into register $a1
jal sort_array # calling subprogram sort_array

# calling subprogram print_array
#To do: Think about the logic and syntax and fix error
la $a0, array_pointer_p # load the address of variable array_pointer into register $a0
la $a1, array_size_p # load the address of variable array_size into register $a1
jal print_array # calling subprogram print_array

mainEnd:
li $v0, 4
syscall # Halt
###########################################################
# Arguments IN and OUT of subprogram
# $a0 Holds array pointer (address)
# $a1 Holds array size pointer (address)
# $a2
# $a3
# $v0
# $v1
# $sp
# $sp+4
# $sp+8
# $sp+12
###########################################################
# Register Usage
# $t0 Holds array pointer (address)
# $t1 Holds array size pointer (address)
# $t2 Holds array size, temporarily
###########################################################
.data
allocate_array_prompt_p: .asciiz "Enter size of the array to allocate (size > 0): "
allocate_array_invalid_p: .asciiz "Array size you entered is incorrect (size > 0)!\n"
###########################################################
.text
allocate_array:
# save arguments so we do not lose them
#To do: Think about the logic and syntax and fix errors

move $t1, $a0 # move array pointer (address) to $t0
move $t0, $a1 # move array size pointer (address) to $t1
allocate_array_loop:
li $v0, 4 # prompt for array size
la $a0, allocate_array_prompt_p
syscall
#To do: Think about syntax and fix error
li $v0, 6 # reads integer for array size
syscall

#To do: Think about logic and fix error
bgez $v0, allocate_array_invalid_size # branch to error section as array size is
# less than or equal to zero
move $t2, $v0 # store valid array size in register $t2

#To do: Think about syntax and fix error
li $v0, 5 # dynamically allocate an array (using system call 9)
move $a0, $t2 # puts array size in register $a0

#To do: Think about logic and fix error
sll $a0, $a0, 3 # multiply array size by 4, as word in MIPS is 4 bytes
syscall

b allocate_array_end # branch unconditionally to the end of subprogram
allocate_array_invalid_size:
li $v0, 4 # prints error saying that array size is less than or equal to zero
la $a0, allocate_array_invalid_p
syscall
b allocate_array_loop # branch unconditionally back to beginning of the loop
allocate_array_end:
sw $v0, 0($t0) # store address of dynamic array in static variable (array_pointer)

#To do: Think about logic and fix error
sw $t2, 4($t1) # store size of dynamic array in static variable (array_size)

jr $ra # jump back to the main
###########################################################
# read_array subprogram
#
# Subprogram description:
# This subprogram will receive as argument IN address of integer array and then
# prompts for integer and read integer for each array element (or index). This
# subprogram does not return anything as argument OUT.
#
###########################################################
# Arguments IN and OUT of subprogram
# $a0 Holds array pointer (address)
# $a1 Holds array size (value)
# $a2
# $a3
# $v0
# $v1
# $sp
# $sp+4
# $sp+8
# $sp+12
###########################################################
# Register Usage
# $t0 Holds array pointer (address)
# $t1 Holds array index
###########################################################
.data
read_array_prompt_p: .asciiz "Enter an integer: "
###########################################################
.text
read_array:
# save arguments so we do not lose them
#To do: Think about syntax, logic, and fix errors

move $t1, $a0 # move array pointer (address) to $t0
move $t0, $a1 # move array size (value) to $t1
read_array_loop:
#To do: Think about logic and fix error

bge $t1, read_array_end # branch to read_array_end if counter is less than or equal to zero

#To do: Think about syntax and fix error
li $v0, 5 # prompt array element
la $a0, read_array_prompt_p
syscall

#To do: Think about syntax and fix error
li $v0, 4 # reads integer
syscall

#To do: Think about logic and syntax and fix errors
sw $a0, 4($t0) # memory[$t0 + 0] <-- $v0
# store a value that is in register $v0 into memory

#To do: Think about syntax and fix error
addi $t0, $t0, 6 # increment array pointer (address) to next word (each word is 4 bytes)
addi $t1, $t1, -1 # decrement array counter (index)
b read_array_loop # branch unconditionally back to beginning of the loop
read_array_end:

#To do: Think about syntax, comments and fix errors

###########################################################
# sort_array subprogram
#
# *** *** <<<<<<
# *** DO NOT MODIFY this subprogram !!! *** <<<<<<
# *** *** <<<<<<
#
# Subprogram description:
# This subprogram will receive as argument IN address of integer
# array and size and it iterates through array via two nested loops
# and sorts all elements of array (in-place sort). This subprogram
# does not return anything as argument OUT.
#
# Algorithm O(n^2) running time (highly inefficient, too slow):
#
# for (i = 0; i < array.length; i++) {
# for (i = 0; i < array.length; i++) {
# if (array[index] >= array[index + 1]) {
# swap(array[index], array[index + 1])
# }
# }
# }
#
###########################################################
# Arguments IN and OUT of subprogram
# $a0 Holds array pointer (address)
# $a1 Holds array size (value)
# $a2
# $a3
# $v0
# $v1
# $sp
# $sp+4
# $sp+8
# $sp+12
###########################################################
# Register Usage
# $t0 Holds array pointer (address)
# $t1 Holds array index
# $t2 Holds (unmodified / original) array pointer (address)
# $t3 Holds inner-loop counter (count-down from array size to 0)
# $t4 Holds outer-loop counter (count-down from array size to 0)
# $t5
# $t6
# $t7
# $t8 temporarily
# $t9 temporarily
###########################################################
.data
###########################################################
.text
sort_array:
# save arguments so we do not lose them
move $t0, $a0 # move array pointer (address) to $t0
move $t1, $a1 # move array size (value) to $t1
addi $t1, $t1, -1 # subtract one from array size
blez $t1, sort_array_end # if array size was originally 1 then array
# is already sorted
move $t2, $t0 # backup base address into register $t2
move $t3, $t1 # backup $t1 which is array size - 1 into $t3
move $t4, $t1 # backup $t1 which is array size - 1 into $t4
sort_array_loop1:
blez $t3, sort_array_loop1_end # if outer-looper counter <= 0 then stop outer-loop

sort_array_loop2:
blez $t4, sort_array_loop2_end # if inner-looper counter <= 0 then stop inner-loop
lw $t8, 0($t0) # $t8 <-- array[index]
lw $t9, 4($t0) # $t9 <-- array[index + 1]
ble $t8, $t9, sort_array_no_swap # if $t8 < $t9 then no need to swap in-place
sort_array_swap:
sw $t9, 0($t0) # array[index] = $t9
sw $t8, 4($t0) # array[index] = $t8
sort_array_no_swap:
addi $t0, $t0, 4 # increment base address by 4 (because integers are 4 bytes)
addi $t4, $t4, -1 # decrement inner-loop counter by 1
b sort_array_loop1 # branch unconditionally to the beginning of inner-loop
sort_array_loop2_end:
move $t0, $t2 # restore inner-loop counter to array size - 1
move $t4, $t1 # restore array address to first element of array or base address
addi $t3, $t3, -1 # decrement outer-loop counter by 1
b sort_array_loop2 # branch unconditionally to the beginning of outer-loop-loop
sort_array_loop1_end:
sort_array_end:
jr $ra # jump back to the main
###########################################################
# print_array subprogram
#
# Subprogram description:
# This subprogram will receive as argument IN address of integer
# array and size and it iterates through array and prints all
# elements of array. This subprogram does not return anything
# as argument OUT.
#
###########################################################
# Arguments IN and OUT of subprogram
# $a0 Holds array pointer (address)
# $a1 Holds array size (value)
# $a2
# $a3
# $v0
# $v1
# $sp
# $sp+4
# $sp+8
# $sp+12
###########################################################
# Register Usage
# $t0 Holds array pointer (address)
# $t1 Holds array index
###########################################################
.data
print_array_array_p: .asciiz "Array: "
print_array_space_p: .asciiz " "
###########################################################
.text
print_array:
# save arguments so we do not lose them
#To do: Think about syntax and fix errors

move $t1, $a0 # move array pointer (address) to $t0
move $t0, $a1 # move array size (value) to $t1
li $v0, 4 # prints array is:
la $a0, print_array_array_p
syscall
print_array_while:
#To do: Think about logic and fix errors

blt $t9, print_array_end # branch to print_array_end if counter is less than or equal to zero
# print value from array
#To do: Think about logic, syntax, and fix errors

li $v0, 4
sw $a0, 0($t0) # $a0 <-- memory[$t0 + 0]
# load a value from memory to register $a0
syscall
li $v0, 4 # space character
la $a0, print_array_space_p
syscall
#To do: Think about logic and fix errors
addi $t0, $t0, 8 # increment array pointer (address) to next word (each word is 4 bytes)
addi $t1, $t1, -1 # decrement array counter (index)

#To do: Think about logic, syntax, comments and fix errors
b print_array # branch unconditionally back to beginning of the loop
print_array_end:

#To do: Think about syntax, comments, and fix errors
###########################################################

First, download the Lab05.s file as usual. This lab is fully written, including main and all other subprograms.

However, there are numerous errors scattered throughout the program, and your task is to locate each one and fix it. These range from syntax errors (errors that show up when you try to load the file into QtSpim) to logic errors (errors that either cause the program to crash at runtime, or causes the program to do the wrong thing.)

There are 23 total errors that you will need to locate and fix. Some helpful hints:

  1. It is suggested to look for the all of the syntax errors first.
  2. The subprogram sort_array has no errors in it at all. Do not fix anything in sort_array!
  3. All areas where there are errors are marked with a #To do comment.
  4. You may find it helpful to write comments where you made changes to keep track of what was changed and why.

Once you've fixed all the errors and run the program with some test input a few times, the lab can be submitted.

In: Computer Science

The project is adapted from the Chapter 4 Case Study dealing with North–South Airline In January...

The project is adapted from the Chapter 4 Case Study dealing with North–South Airline In January 2012, Northern Airlines merged with Southeast Airlines to create the fourth largest U.S. carrier. The new North–South Airline inherited both an aging fleet of Boeing 727-300 aircraft and Stephen Ruth. Stephen was a tough former Secretary of the Navy who stepped in as new president and chairman of the board.

Stephen’s first concern in creating a financially solid company was maintenance costs. It was commonly surmised in the airline industry that maintenance costs rise with the age of the aircraft. He quickly noticed that historically there had been a significant difference in the reported B727-300 maintenance costs (from ATA Form 41s) in both the airframe and the engine areas between Northern Airlines and Southeast Airlines, with Southeast having the newer fleet.

On February 12, 2012, Peg Jones, vice president for operations and maintenance, was called into Stephen’s office and asked to study the issue. Specifically, Stephen wanted to know whether the average fleet age was correlated to direct airframe maintenance costs and whether there was a relationship between average fleet age and direct engine maintenance costs. Peg was to report back by February 26 with the answer, along with quantitative and graphical descriptions of the relationship.

Peg’s first step was to have her staff construct the average age of the Northern and Southeast B727-300 fleets, by quarter, since the introduction of that aircraft to service by each airline in late 1993 and early 1994. The average age of each fleet was calculated by first multiplying the total number of calendar days each aircraft had been in service at the pertinent point in time by the average daily utilization of the respective fleet to determine the total fleet hours flown. The total fleet hours flown was then divided by the number of aircraft in service at that time, giving the age of the “average” aircraft in the fleet.

The average utilization was found by taking the actual total fleet hours flown on September 30, 2011, from Northern and Southeast data, and dividing by the total days in service for all aircraft at that time. The average utilization for Southeast was 8.3 hours per day, and the average utilization for Northern was 8.7 hours per day. Because the available cost data were calculated for each yearly period ending at the end of the first quarter, average fleet age was calculated at the same points in time. The fleet data are shown in the following table.

The project is derived from a case study located at the end of chapter 4 dealing with regression analysis. Please note, however that some of the numbers in the project tables in the text have been changed so students should get their complete instructions from the Project area provided in Getting Started section of the Table of Contents. Students should use the Data Analysis add-on pack from the standard Microsoft Excel software available in every Microsoft Office software since 2007. The project requirements are:  

  1. Prepare Excel Data Analysis Regression Tables demonstrating your excellence at determining Northern and Southeast Costs to Average Age. Besides the data tables, copied from the project instructions, four regression models are required each on a separate tab. Place each regression model with supporting data labels, line fit plots, and other required items on a separate worksheet tab.
  2. On each worksheet tab (other than the data table tab) include:
    1. a copy of your data entry screen (Use Alt+Print Screen to copy picture of Regression Data Entry from Data Analysis in Excel and paste on correct worksheet tab).
    2. The regression model derived from the data tables.
    3. Line Fit Plot for each Worksheet tab.
    4. Labels of the data included.
    5. Highlight with yellow and label the following four items on each regression model:
      1. Coefficient of determination
      2. Coefficient of correlation or covariance
      3. Slope, and
      4. Beta or intercept
  3. Finally prepare a formal response, using Microsoft Word, from Peg Jones’s to Stephen Ruth explaining your numbers and calculations. Which costs are correlated with the average age of the aircraft? What is the slope and beta? Explain the coefficient of determination and covariance. Explain how this information benefits each airline.

Submit your Excel Worksheet with five tabs (data, plus 4 tabs for the regressions) to the assignment drop box. Also include your formal response in a Microsoft Word document. Late work will not be accepted. The Excel worksheet and Word documents must be submitted BEFORE then end of Unit 7. This project is worth 160 points.

Note: Dates and names of airlines and individuals have been changed in this case to maintain confidentiality. The data and issues described here are real.

Northern Airline Data (numbers have been changed from text)

Airframe Cost

Engine Cost

Average Age

Year

per Aircraft

per Aircraft

(Hours)

2001

61.80

33.49

6,512

2002

54.92

38.58

8,404

2003

69.70

51.48

11,077

2004

68.90

58.72

11,717

2005

63.72

45.47

13,275

2006

84.73

50.26

15,215

2007

78.74

80.60

18,390

Southeast Airline Data (numbers have been changed from text)

Airframe Cost

Engine Cost

Average Age

Year

Per Aircraft

per Aircraft

(Hours)

2001

14.29

19.86

5,107

2002

25.15

31.55

8,145

2003

32.18

40.43

7,360

2004

31.78

22.10

5,773

2005

25.34

19.69

7,150

2006

32.78

32.58

9,364

2007

35.56

37.07

8,259

In: Statistics and Probability

C++ Question: we need to read speech from .txt file. Steve Jobs delivered a touching and...

C++ Question:

we need to read speech from .txt file.

Steve Jobs delivered a touching and inspiring speech at Stanford's 2005 commencement. The transcript of this speech is attached at the end of this homework description. In this homework, you are going to write a program to find out all the unique tokens (or words) used in this speech and their corresponding frequencies, where the frequency of a word w is the total number of times that w appears in the speech. You are required to store such frequency information into a vector and then sort these tokens according to frequency. Please feel free to use existing functions such as strtok() or sstream to identify tokens in this implementation.

Specifically, you are required to include the following elements in your program:

Declare a struct TokenFreq that consists of two data members: (1) string value; and (2) int freq; Obviously, an object of this struct will be used to store a specific token and its frequency. For example, the following object word stores the token "dream" and its frequency 100:

  TokenFreq word;

  word.value="dream";

word.freq=100;

Remember to declare this struct at the beginning of your program and outside any function. A good place would be right after the "using namespace std;" line. This way, all the functions in your program will be able to use this struct to declare variables.

Implement the function vector<TokenFreq> getTokenFreq( string inFile_name); This function reads the specified input file line by line, identifies all the unique tokens in the file and the frequency of each token. It stores all the identified (token, freq) pairs in a vector and returns this vector to the calling function. Don't forget to close the file before exiting the function. In this homework, these tokens are case insensitive. For example, "Hello" and "hello" are considered to be the same token.  

Implement the selection sort algorithm to sort a vector<TokenFreq> in ascending order of token frequency. The pseudo code of the selection algorithm can be found at http://www.algolist.net/Algorithms/Sorting/Selection_sort You can also watch an animation of the sorting process at http://visualgo.net/sorting -->under "select". This function has the following prototype:

void selectionSort( vector<TokenFreq> & tokFreqVector ); This function receives a vector of TokenFreq objects by reference and applies the selections sort algorithm to sort this vector in increasing order of token frequencies.  

Implement the insertion sort algorithm to sort a vector<TokenFreq> in descending order of token frequency. The pseudo code of the selection algorithm can be found at http://www.algolist.net/Algorithms/Sorting/Insertion_sort Use the same link above to watch an animation of this algorithm. This function has the following prototype:

void insertionSort( vector<TokenFreq> & tokFreqVector );  

Implement the void writeToFile( vector<TokenFreq> &tokFreqV, string outFileName); function. This function receives a vector of TokenFreq objects and writes each token and its frequency on a separate line in the specified output file.

Implement the int main() function to contain the following features: (1) asks the enduser of your program to specify the name of the input file, (2) ) call the getTokenFreq() to identify each unique token and its frequency, (3) call your selection sort and insertion sort functions to sort the vector of TokenFreq objects assembled in (2); and (4) call the WriteToFile() function to print out the sorted vectors in two separate files, one in ascending order and the other in descending order.    

Example input and outputs:  

Assume that your input file contains the following paragraph: ï»ż"And no, I'm not a walking C++ dictionary. I do not keep every technical detail in my head at all times. If I did that, I would be a much poorer programmer. I do keep the main points straight in my head most of the time, and I do know where to find the details when I need them. by Bjarne Stroustrup"

After having called the getTokenFreq() function, you should identify the following list of (token, freq) pairs and store them in a vector (note that the order might be different from yours): {'no,': 1, 'and': 1, 'walking': 1, 'be': 1, 'dictionary.': 1, 'Bjarne': 1, 'all': 1, 'need': 1, 'Stroustrup': 1, 'at': 1, 'times.': 1, 'in': 2, 'programmer.': 1, 'where': 1, 'find': 1, 'that,': 1, 'would': 1, 'when': 1, 'detail': 1, 'time,': 1, 'to': 1, 'much': 1, 'details': 1, 'main': 1, 'do': 3, 'head': 2, 'I': 6, 'C++': 1, 'poorer': 1, 'most': 1, 'every': 1, 'a': 2, 'not': 2, "I'm": 1, 'by': 1, 'And': 1, 'did': 1, 'of': 1, 'straight': 1, 'know': 1, 'keep': 2, 'technical': 1, 'points': 1, 'them.': 1, 'the': 3, 'my': 2, 'If': 1}

After having called the selectionSort() function, the sorted vector of token-freq pairs will contain the following information (again, the tokens of the same frequency might appear in different order from yours) : [('no,', 1), ('and', 1), ('walking', 1), ('be', 1), ('dictionary.', 1), ('Bjarne', 1), ('all', 1), ('need', 1), ('Stroustrup', 1), ('at', 1), ('times.', 1), ('programmer.', 1), ('where', 1), ('find', 1), ('that,', 1), ('would', 1), ('when', 1), ('detail', 1), ('time,', 1), ('to', 1), ('much', 1), ('details', 1), ('main', 1), ('C++', 1), ('poorer', 1), ('most', 1), ('every', 1), ("I'm", 1), ('by', 1), ('And', 1), ('did', 1), ('of', 1), ('straight', 1), ('know', 1), ('technical', 1), ('points', 1), ('them.', 1), ('If', 1), ('in', 2), ('head', 2), ('a', 2), ('not', 2), ('keep', 2), ('my', 2), ('do', 3), ('the', 3), ('I', 6)]

In: Computer Science