Questions
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

Using PyCharm, create a new Project lab8. Under lab8 create a new Directory exercise, then create...

Using PyCharm, create a new Project lab8. Under lab8 create a new Directory exercise, then create a Python file called nested.py, type the following:

Test your code by putting the following at the bottom of the file: make_table_of_stars(2,3) (as shown in the code above). Run the file by right clicking in the code area of Pycharm, then choosing “Run nested”. Your output should be:

***

***

(2 rows with 3 columns of stars). Reverse the 2 and 3. What happens? Make a new function, make_table_of_digits that prints the digits 1..row*column instead. So nested.make_table_of_digits(2,3) would print:

123

456

To do this, change the '*' to a number. This is a little tricky. Start by just getting the first row correct. Change the printed '*' to print the value of j yields:

012

012

when make_table_of_digits(2,3) is called. Since you want to start with 1, not 0, change number being printed to (j+1) instead of j. Then, make_table_of_digits(2,3) should print

123

123

Much better. The whole first row is correct. To increase the numbers after the first row, multiply row number (i) times the total number of columns. Then, add that value to (j+1), and print. Then make_table_of_digits(2,3) prints:

123

456

That works well until you try make_table_of_digits(5,3), which prints:

123

456

789

101112

131415

make_table_of_digits only works well with 1 digit numbers. Create a new function, make_table_of_numbers, which makes each number take up 3 spaces using string.format. For example,

n = 3

print("{:3}".format(n), end=" ")

would print --3, where ‘-’ is a space. make_table_of_numbers(5,3) should print:

1 2 3

4 5 6

7 8 9

10 11 12

13 14 15

Test your solution and submit.

In: Computer Science

PYTHON PROGRAM Requirements: 1. Create an empty directory a variable named song_search 2. Repeatedly prompt the...

PYTHON PROGRAM

Requirements:

1. Create an empty directory a variable named song_search

2. Repeatedly prompt the user to enter either the title of a song or enter nothing if they have no more songs to enter

3. For each song title entered by the user, split the song title into words by using the split function and splitting on a space. For each word from each song title, ensure the song_search dictionary has a entry with that word as the key and a list (initially empty) as the value

4. Also for each song title entered by the user and each word from each song title, insert the full song title into the list inside the song_search dictionary associated with each of the words from the song. For example, the contents of the song_search dictionary after the user would have entered the song titles Crazy in Love and What is Love:

song_search = {’Crazy’ : [ ’Crazy in Love’ ],’in’ : [ ’Crazy in Love’ ],’Love’ : [ ’Crazy in Love’, ’What is Love’ ],’What’ : [ ’What is Love’ ],’is’ : [ ’What is Love’ ]}

Once the user has finished entering song titles, repeatedly ask the user if they want to look up a song by keyword until they say no. If they respond yes prompt them for a keyword and print all the song titles containing that word by looking up the value in the song_search dictionary using the key word as the key

5. If the keyword the user entered is in more than one song title, print each song title on a separate line preceeded by a number beginning with one and increasing by one for each song

6. If the keyword the user entered is in none of the song titles print the message Keyword not found in any song titles

In: Computer Science

What chmod command would you use to impose the following permissions? 1. on a directory(called dir1)...

What chmod command would you use to impose the following permissions?

1. on a directory(called dir1) and all its subdirectories such that: the owner would have read, write, and execute; the group would have read and execute; and others would have read(write the command in two ways: using rwx and using numeric value)

2. on file (called file1)such that: the owner would have read and write; the group would have no permissions; and others would have write

(write the command in two ways: using rwx and using numeric value)

3. set the special permission SGID and sticky bit for dir1.(you don't need to change the defined permission in 1)

Starting from the Linux default permissions for file and directories, what umask command would you use to ensure that for all new:

4. directories, the owner would have read, write, and execute; members of the group would have read and execute; and others would have read

5. files, the owner would have read and execute; the group would have read, write, and execute; and others would have execute

In: Computer Science

Create a console application named TakeHomePay.cs under your homework directory (please refer to the earlier recorded...

Create a console application named TakeHomePay.cs under your homework directory (please refer to the earlier recorded Zoom sessions if you are not sure how to do it) that calculates the take-home pay for an employee. The two types of employees are salaried and hourly. Allow the user to input the employee’s first and last name, id, and type. If an employee is salaried, allow the user to input the salary amount. If an employee is hourly, allow the user to input the hourly rate and the number of hours clocked for the week. For hourly employees, overtime is paid for hours over 40 at a rate of 1.5 of the base rate. For all employees’ take-home pay, federal tax of 18% is deducted. A retirement contribution of 10% and a Social Security tax rate of 6% should also be deducted. Use appropriate constants and decision making structures.

In: Computer Science

Match drawbacks to the following capital budgeting techniques IRR (Ignore Scale, Provide conflicting answers w/ NPV...

Match drawbacks to the following capital budgeting techniques

IRR (Ignore Scale, Provide conflicting answers w/ NPV for independent projects, Favor projects with early positive cash flow, or bias against short-term projects)

PI (Ignore Scale, Provide conflicting answers w/ NPV for independent projects, Favor projects with early positive cash flow, or bias against short-term projects)

Payback Period   (Ignore Scale, Provide conflicting answers w/ NPV for independent projects, Favor projects with early positive cash flow, or bias against short-term projects)

In: Finance

When the Accounting Standards Board issues new standards, the implementation date is usually 12 months after...

When the Accounting Standards Board issues new standards, the implementation date is usually 12 months after the issue date, but early implementation is encouraged. As the Controller for Wheelz Manuafacturing your are discussing their financial statements with Wheelz' vice-president the need for early implementation of a standard that would result in a fairer presentation of the company's financial condition and earnings. When the vice-president determines that early implementatino of the standard will lower the reported net income for the year, he discourages you from implementing the standard until it is requried. Discuss the ethical issues you will need consider in making your decision to implement or not.

In: Accounting

Theoretically, fractional distillation gives better separation than simpledistillation .� Use mole ratios for early and late...

Theoretically, fractional distillation gives better separation than simpledistillation

.� Use mole ratios for early and late fractions from both simple and fractionaldistillations determined by GC analysis to calculate the volume and mole %composition of each. Present a single model of those calculations.

� Compare these mole % composition results to explain whether your experimentaldata supports this theory.

Data: Mole Ratio cyclohexane:touluene

Orginal mix: 1:1.05

early fractional simple : 1: 0.37

Late fractional simple : 1: 25

Early Fraction fractional: 1: 0.204

Late fraction fractional: 1: 194

In: Chemistry

The heights of adult men in America are normally distributed, with a mean of 69.4 inches...

The heights of adult men in America are normally distributed, with a mean of 69.4 inches and a standard deviation of 2.66 inches. The heights of adult women in America are also normally distributed, but with a mean of 64.4 inches and a standard deviation of 2.59 inches.

a) If a man is 6 feet 3 inches tall, what is his z-score (to two decimal places)? z =

b) What percentage of men are SHORTER than 6 feet 3 inches? Round to nearest tenth of a percent.

c) If a woman is 5 feet 11 inches tall, what is her z-score (to two decimal places)? z =

d) What percentage of women are TALLER than 5 feet 11 inches? Round to nearest tenth of a percent.

In: Statistics and Probability

The T-Bond future with maturity date March 2021 was quoted 113.25 (% of face value, 100...

The T-Bond future with maturity date March 2021 was quoted 113.25 (% of face value, 100 bonds per contract) today on Chicago Board of Trade (CBT). The margin requirements from the clearinghouse are: initial margin 11%; maintenance margin 5%. Bank of America just took a short position on this future contract at the price.

1) What is the initial deposit for the long position? If the future price is 114.75 in May 2020, what would be the balance of Bank of America’s margin account? (5 points)

2) If future price is 109.75 in May 2020, what is the return rate on Bank of America’s initial deposit? (5 points)

3) At what future price would Bank of America get a margin call? (5 points)

In: Finance