The following R code sorts each vector in a list (lst) and stores the new list in lst1. The code uses a for loop.
lst <-
list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE))
lst1 <- list()
for(i in 1:length(lst))
{
lst1[[i]] <- sort(lst[[i]])
}
lst1
Which of the following options does the same thing as the given R code above ?
|
lst <-
list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE)) |
||
|
lst <-
list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE)) |
||
|
None of the given options |
||
|
lst <-
list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE)) |
5 points
QUESTION 2
Match the R code on the left (with loop) to its equivalent one (without loop) on the right.
|
|
15 points
QUESTION 3
Match the R code with the value of x
(Here: try to work out the solution with hand and double check by running the code. Don't just run the code and get the answer without understanding the logic)
|
|
20 points
QUESTION 4
The following R code extracts the unique items in each vector in a list (lst) and stores the new list in lst1. The code uses a for loop.
lst <-
list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE))
lst1 <- list()
for(i in 1:length(lst))
{
lst1[[i]] <- unique(lst[[i]])
}
lst1
Which of the following options does the same thing as the given R code above ?
|
lst <-
list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE)) |
||
|
lst <-
list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE)) |
||
|
None of the given options |
||
|
lst <-
list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE)) |
5 points
Click Save and Submit to save and submit. Click Save All Answers to save all answers.
In: Computer Science
3. You are working with wild-type cells that have a 16h doubling time. BrdU is a molecule that can be used to measure the amount of DNA inside cells. When added to cell culture, cells will incorporate BrdU into DNA strands during replication as if it were the DNA base thymidine (T).
Your general experiment for using BrdU is:
1. Add BrdU to the media and let the cells continue to grow for
16h
2. Harvest cells and label them with a fluorescent antibody against
BrdU
3. Measure fluorescence intensity in cells which is proportional to
total DNA content
4. Plot a histogram which shows the number of cells with a certain
fluorescence intensity
A. (5pts) As a control, you perform the above experiment on normally growing, wild-type cells, and find the histogram to the right. Please explain why one peak shows roughly twice the fluorescence intensity as the other, what sets cells are represented by each peak, AND why the high-intensity peak is smaller.
PART B:
B. (5pts) You perform the general experiment with the following addition: when you add BrdU, you also add the drug taxol, which stabilizes microtubules. You find the histogram to the right. Please describe how the features of this histogram have changed from Part A, and explain why adding taxol could cause these changes referring to mechanisms we have discussed in class.
PART C:
C. (4pts) You construct a cell line with a temperature sensitive mutant of the G1-cyclin. You perform the general experiment with the following additions: when you add BrdU, you shift to higher temperatures, which deactivates the G1-cyclin. Please draw what you predict will be the resulting histogram after you measure BrdU on the figure to the right.
(Note: The result from the control is printed as a reference, you should draw your response on the same axes.)
In: Biology
Write a program that sorts prices of 10 tacos in ascending order based on the price, using arrays.
Requirements:
Example Output
Welcome to the taco price sorter! Enter 10 taco names and prices and I'll sort it!
Enter the name of taco 1
Crunchy Taco
Enter taco's price
1.19
Enter the name of taco 2
Crunchy Taco Supreme
Enter taco's price
1.59
Enter the name of taco 3
Soft Taco
Enter taco's price
1.19
Enter the name of taco 4
Soft Taco Supreme
Enter taco's price
1.59
Enter the name of taco 5
Chicken Soft Taco
Enter taco's price
1.79
Enter the name of taco 6
Crispy Potato Soft Taco
Enter taco's price
0.99
Enter the name of taco 7
Double Decker Taco
Enter taco's price
1.89
Enter the name of taco 8
Double Decker Taco Supreme
Enter taco's price
2.29
Enter the name of taco 9
Doritos Locos Taco (Nacho Cheese)
Enter taco's price
1.49
Enter the name of taco 10
Doritos Locs Tacos(Fiery) Supreme
Enter taco's price
1.89
Sorted Tacos are
Taco Prices Crispy Potato Soft Taco 0.99
Taco Prices Crunchy Taco 1.19
Taco Prices Soft Taco 1.19
Taco Prices Doritos Locos Taco (Nacho Cheese) 1.49
Taco Prices Crunchy Taco Supreme 1.59
Taco Prices Soft Taco Supreme 1.59
Taco Prices Chicken Soft Taco 1.79
Taco Prices Double Decker Taco 1.89
Taco Prices Doritos Locs Tacos(Fiery) Supreme 1.89
Taco Prices Double Decker Taco Supreme 2.29
In: Computer Science
I am trying to get this code to work but I am having difficulties, would like to see if some one can solve it. I tried to start it but im not sure what im doing wrong. please explain if possible
package edu.hfcc;
/*
* Create Java application that will create Fruit class and Bread
class
*
* Fruit class will have 3 data fields name and quantity which you
can change.
* The third data field price should always be 2.0
* Bread class will have 3 data fields name, quantity and price. All
three data fields can change.
*
* Create method that creates the string used write to console and
return from execute()
*
* In GroceryApp
* Create method to calculate totalPrice for fruit
* Create method to calculate totalPrice for bread
* Create method to print to console use EXACLTY like example
below
*
* Data to use
* Bread: Name=French,
Quantity=2, Price=3.0
* Fruit: Name=Apple, Quantity=5,
*
* EXAMPLE TO Console
* French
2 @ 3.0
6.0
Apple
5 @ 2.0
10.0
---------------------
16.0
*/
public class Grocery {
private static final char NEW_LINE = '\n';
private static final String TAB = "\t";
public String execute(){
Fruit fruitOne = new Fruit();
fruitOne.setName("Apple");
fruitOne.setQuantity( 5);
String fruits =
constructOutputFruit(apple);
System.out.println(fruits);
return fruits;
}
private String constructOutputFruit(Fruit fruit1)
{
String apple = fruit1.getName() +
NEW_LINE + fruit1.getQuantity() + TAB + fruit1.getPrice();
return apple + NEW_LINE;
}
}
here are my classes:
Fruit:
package edu.hfcc;
public class Fruit {
private String name;
private int quantity;
private float price;
public Fruit(){
this.price = (float)2.0;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
public float getPrice() {
return price;
}
}
Bread:
package edu.hfcc;
public class Bread {
private String name;
private int quantity;
private float price;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
public float getPrice() {
return price;
}
public void setPrice(float price) {
this.price = price;
}
}
In: Computer Science
Python
#Note: use print() to add spaces between items and when needed
in the receipt
#(e.g. between user entries and between the entries and the
receipt)
#1 Ask the user for a number using the prompt: NUMBER?
# Convert the user entered number to an integer
# Calculate the square of the number and display the result on
screen with the following text before it: Your number squared
is
#2 Ask the user for a first number using the prompt: first
number?
# Ask the user for a second number using the prompt: second
number?
# Convert the two numbers to integers
# Multiply the first number by the second number and display the
result on screen with the following text before it: Result:
"""
#3 Develop a simple food receipt
a. Ask the user for inputs about two food items using the following
prompts in turn. Do not forget to assign each user
entry to a unique variable name:
Item1 name?
Item1 price?
Item1 quantity?
Item2 name?
Item2 price?
Item2 quantity?
b. Convert the price and quantity variables to integers
c. Calculate the total cost for the order by calculating each
item's total price by
multiplying price and quantity for each item and then adding up the
total prices for the two items
d. Display the results using the format:
RECEIPT
You ordered: [item1 name] and [item2 name]
Total cost: $ [total price for both items calculated in 3c
above]
"""
#Start your code below
"""
Enhance your simple food receipt
a. Ask the user for inputs about two food items using the following
prompts in turn. Do not forget to assign each user
entry to a unique variable name:
First item name?
First item price?
First item quantity?
Second item name?
Second item price?
Second item quantity?
Third item name?
Third item price?
Third item quantity?
b. Convert the price and quantity variables to integers
c. Calculate the total cost for the order by calculating each
item's total price by
multiplying price and quantity for each item and then adding up the
total prices for the three items
d. Calculate the total cost plus tax for the order by multiplying
the total cose calculated in c by the tax rate of .09
then adding the tax to the total cost
e. Display the results using the format:
RECEIPT
You ordered: [First item name] [Second item name] [third item
name]
Total cost: $ [total price for all items calculated in 3c
above]
Total cost plus tax: $ {total cost plus tax calculated in 3d
above}
"""
#Start your code below
In: Computer Science
Python
#Note: use print() to add spaces between items and when needed
in the receipt
#(e.g. between user entries and between the entries and the
receipt)
#1 Ask the user for a number using the prompt: NUMBER?
# Convert the user entered number to an integer
# Calculate the square of the number and display the result on
screen with the following text before it: Your number squared
is
#2 Ask the user for a first number using the prompt: first
number?
# Ask the user for a second number using the prompt: second
number?
# Convert the two numbers to integers
# Multiply the first number by the second number and display the
result on screen with the following text before it: Result:
"""
#3 Develop a simple food receipt
a. Ask the user for inputs about two food items using the following
prompts in turn. Do not forget to assign each user
entry to a unique variable name:
Item1 name?
Item1 price?
Item1 quantity?
Item2 name?
Item2 price?
Item2 quantity?
b. Convert the price and quantity variables to integers
c. Calculate the total cost for the order by calculating each
item's total price by
multiplying price and quantity for each item and then adding up the
total prices for the two items
d. Display the results using the format:
RECEIPT
You ordered: [item1 name] and [item2 name]
Total cost: $ [total price for both items calculated in 3c
above]
"""
#Start your code below
Enhance your simple food receipt
a. Ask the user for inputs about two food items using the following
prompts in turn. Do not forget to assign each user
entry to a unique variable name:
First item name?
First item price?
First item quantity?
Second item name?
Second item price?
Second item quantity?
Third item name?
Third item price?
Third item quantity?
b. Convert the price and quantity variables to integers
c. Calculate the total cost for the order by calculating each
item's total price by
multiplying price and quantity for each item and then adding up the
total prices for the three items
d. Calculate the total cost plus tax for the order by multiplying
the total cose calculated in c by the tax rate of .09
then adding the tax to the total cost
e. Display the results using the format:
RECEIPT
You ordered: [First item name] [Second item name] [third item
name]
Total cost: $ [total price for all items calculated in 3c
above]
Total cost plus tax: $ {total cost plus tax calculated in 3d
above}
"""
#Start your code below
In: Computer Science
Shoaib, Qamar and Azhar are partners of a firm (Platinum Trading LLC) that deals in used cars, car parts, services, renting cars for private and public sectors and maintenance service including on call services. Their business is running successfully, and they are planning to expand the business in similar verticals to gain larger market share. Everything was going well but after the sudden demise of Shoaib things are difficult to manage for them. Shoaib wife has been appointed as his legal representatives to receive his share. Sharing profit and losses in the ratio of 3:2:1. Qamar and Azhar collect the below details of Assets, liabilities and Capital balances but some information is missed. Name of Accounts OMR Name of Accounts OMR Cash at Bank 41,963 Shoaib Capital 142,311 Sundry Debtors 31,016 Qamar Capital 114,031 Stock 32,841 Azhar Capital 72,068 Lease Hold Premises 45,612 General Reserve A/c ? Machinery 136,837 Sundry Creditors 27,367 Building 91,225 Mr. Shoaib died on 31st March 2020. The legal representative of the deceased partner entitled to receive his share after the following adjustments. a. Goodwill be valued at 3 year’s purchase of the average profit of the last four years, Which were 2016 OMR 40,500; 2017 OMR 50,000; 2018 OMR 54,000; 2019 OMR 60,500. b. Building to be appreciated by 25%. c. Provision for doubtful debts to be made at 4% on Sundry Debtors. d. The assets are to be valued as, Machinery be valued at OMR 120,000 and Stock at OMR 20,000. e. For the purpose of calculating Shoaib’s share in the profit of 2020, the profit in 2020 should be taken to have been earned on the same as in 2019. f. A sum of OMR15,000 is to be paid immediately to the executors of Shoaib and the balance transferred to his loan account. You are required to pass necessary Journal entries with narrations to record the above transactions, prepare the Revaluation Account and Shoaib executors account.
In: Accounting
You must use C Language.
End Goal:
HATFIELD, HEIDI
KAISER, RUSSELL
LIPSHUTZ, HOWARD
PENKERT, DAWN
WRIGHT, ELIZABETH
The user inputs the students first name and last names separately but within one loop. The loop should end when the user presses enter on the first name without entering any text. Upon completing entry of data, the output pictured above should display on the output.
Using the code given, follow the steps:
1. You should be able to enter up to 20 student first names. Also, change the input array to an appropriate size of 18 for the length of the first name. Use a meaningful name for the storage of first names array. Change prompts as needed. The loop should exit when the user presses enter when inputing the first name without adding any text. Compile and make sure it works from main(). At this point, you should be able to enter and alphabetize a list of up to 20 first names! Alphabetizing the first name is just a test!!! In the end, you will alphabetize the whole name string.
2. Add another array and get input for last name INSIDE the loop for your first names. This last name array will also be an array of 20 elements but with room for up to 25 characters. Again, do not use another loop! Just add code to input the last name to the first loop. The program should now ask the user to input the student's first name and then last name in that order for each individual. Then the program will loop to continue adding student names until the user presses enter on the student's first name. Make sure the last name is converted to all caps. You do not need to alphabetize this array, but you may want to print it out to make sure everything is working just as a test.
3. Make changes to convert the first name to all upper case using a function. (Example: User enters bob on the first name, then on the last name enters jenkins, it will look like Bob Jenkins instead of bob jenkins)
Last step: Combine last and first into an third array. This code is most easily added to the first loop. You just had the user enter first and last names. So the current value of the subscript used for these arrays can be used to combine content and store in the third array. Alphabetize THIS array (instead of the first name array) which means you need to send a different pointer to the stsrt() function. Print out the end result. Test that everything is working on this program.
Given Code:
void rollsheet(void) {
int ct = 0;
char *ptstr[LIMIT];
char input[LIMIT][SIZE];
int k;
printf("Enter up to %d student names, and I will sort them!\n",
LIMIT);
printf("To stop, press the Enter key at a line's start.\n");
while (ct < LIMIT && s_gets(input[ct], SIZE) !=
NULL
&& input[ct][0] != '\0')
{
ptstr[ct] = input[ct]; /* set ptrs to strings */
ct++;
}
stsrt(ptstr,ct);
puts("\nHere's the sorted list:\n");
for (k = 0; k < ct; k++)
puts(ptstr[k]) ; /* sorted pointers */
}
void stsrt(char *strings[], int num)
{
char *temp;
int top, seek;
for (top = 0; top < num-1; top++)
for (seek = top + 1; seek < num; seek++)
if (strcmp(strings[top],strings[seek]) > 0)
{
temp = strings[top];
strings[top] = strings[seek];
strings[seek] = temp;
}
}
char * s_gets(char * st, int n)
{
char * ret_val;
int i = 0;
ret_val = fgets(st, n, stdin);
if (ret_val)
{
while (st[i] != '\n' && st[i] != '\0')
i++;
if (st[i] == '\n')
st[i] = '\0';
else // must have words[i] == '\0'
while (getchar() != '\n')
continue;
}
return ret_val;
}
In: Computer Science
| Carolina Products | ||||
| Income Statement | ||||
| Years Ended 12/31/2016 & 12/31/2015 | ||||
| Horizontal Analysis | ||||
| 2016 | 2015 | $ Change | % Change | |
| Sales | $272,500 | $270,010 | ||
| Cost of Goods Sold | $157,472 | $154,589 | ||
| Gross Profit | $115,028 | $115,421 | ||
| Operating Expenses: | ||||
| Selling Expense | $49,675 | $48,500 | ||
| Salary Expense | $30,000 | $28,000 | ||
| Administrative Expense | $15,500 | $15,400 | ||
| Advertising Expense | $3,400 | $3,200 | ||
| Utilities Exp | $1,100 | $1,000 | ||
| Depreciation Exp | $1,620 | $1,450 | ||
| Total Operating Expenses | $101,295 | $97,550 | ||
| Net Income | $13,733 | $17,871 | ||
In: Accounting
| Carolina Products | ||||
| Balance Sheet | ||||
| 12/31/2016 & 12/31/2015 | ||||
| Horizontal Analysis | ||||
| Assets | 2016 | 2015 | $ Change | % Change |
| Cash | $108,886 | $107,455 | ||
| Accounts Receivable | $105,650 | $112,420 | ||
| Prepaid Insurance | $1,100 | $1,000 | ||
| Inventory | $205,000 | $189,350 | ||
| Prepaid Expenses | $1,200 | $1,050 | ||
| Land | $80,000 | $80,000 | ||
| Office Equipment | $10,500 | $10,500 | ||
| Accum Depr-Office Equip | ($2,000) | ($2,200) | ||
| Total Assets | $510,336 | $501,590 | ||
| Liabilities | ||||
| Accounts Payable | $72,090 | $70,005 | ||
| Sales Tax Payable | $3,500 | $3,450 | ||
| Interest Payable | $860 | $825 | ||
| Total Liabilities | $76,450 | $74,280 | ||
| Stockholders Equity | ||||
| Common Stock | $60,000 | $58,000 | ||
| Paid in Capital in Excess of Par | $260,000 | $254,500 | ||
| Retained Earnings | $113,886 | $114,810 | ||
| Total Stockholders Equity | $433,886 | $427,310 | ||
| Total Liabilities & Stockholders Equity | $510,336 | $501,590 | ||
In: Accounting