Questions
What is clustering? Explain how K-Means Clustering Algorithm works? What are the Advantages and disadvantages of...

  1. What is clustering? Explain how K-Means Clustering Algorithm works?

  2. What are the Advantages and disadvantages of Clustering ALgorithms discussed in our class (K-Means,Hierchal)?

  3. Which Clustering Algorithm is better K-Means or hierarchical Clustering? Explain with a proper example which is better algorithm?

In: Computer Science

Dyrdek Enterprises has equity with a market value of $10.7 million and the market value of...

Dyrdek Enterprises has equity with a market value of $10.7 million and the market value of debt is $3.50 million. The company is evaluating a new project that has more risk than the firm. As a result, the company will apply a risk adjustment factor of 1.5 percent. The new project will cost $2.18 million today and provide annual cash flows of $571,000 for the next 6 years. The company's cost of equity is 11.03 percent and the pretax cost of debt is 4.87 percent. The tax rate is 39 percent. What is the project's NPV?

In: Finance

Complete a 2-3-page paper with an abstract and conclusion (plus cover sheet and reference page) that...

Complete a 2-3-page paper with an abstract and conclusion (plus cover sheet and reference page) that discusses:

1. How does a cloud based storage service differ from Software as a Service (SaaS)?

2. Give a brief overview of the following types of cloud based storage (Public, Private, Hybrid and Mobile).

3. What are the disadvantages and advantages to using cloud based storage?

4. What are the availability, performance, and security considerations?

Specific questions or items to address:

1. How does a cloud based storage service differ from Software as a Service (SaaS)?

2. Give a brief overview of the following types of cloud based storage (Public, Private, Hybrid and Mobile).

3. What are the disadvantages and advantages to using cloud based storage?

4. What are the availability, performance, and security considerations?

In: Computer Science

data = [] infile = open("Mac_menu.csv", "r") line = infile.readline() for line in infile: line =...

data = []
infile = open("Mac_menu.csv", "r")
line = infile.readline()
for line in infile:
line = line.rstrip("\n")
result = tuple(line.split(","))
data.append(result)
infile.close()

def myMenu():
print('\t1) - Category')
print('\t2) - Item')
print('\t3) - Serving Size')
print('\t4) - Calories')
print('\t5) - Calories from Fat')
print('\t6) - Total Fat')
print('\t7) - Cholesterol')
print('\t8) - Sodium')
print('\t9) - Carbs')
print('\t10) - Protein')
print('\t11) - Sugar')
print('\t12) - Done')

def processInput(results):
headings=['Category','Item','Serving Size','Calories','Calories from Fat','Total Fat','Cholesterol',\
'Sodium','Carbs','Protein','Sugar']

print('The user entered choice: {0} - {1}'.format(results,headings[results-1]))
sortData = sorted(data, key = lambda r:(int(r[results-1])), reverse = True)

top5 = 0
print("Top 5 Items:\n")
for count in range(5):
top5+=1
print(" {}| {} {}".format(top5, sortData[count][1], sortData[count][results-1]))

def printMenu():
while True:
try:
myMenu()
choice = int(input('Enter a number between 1 and 12. '))
if choice > 12:
print('Enter a number between 1 and 12. ')
else:
return choice
except ValueError:
print('Invalid number enter.')

def main():
choice=printMenu()
processInput(choice)

main()

  
This is my code and my prof. said.

Your code is working....with one change

In your processInput() function you need to determine what your results variable is:

if "results" is greater than or equal to 0 and less then or equal to 2:
sort WITHOUT the int: sortData = sorted(data, key = lambda r:(r[results-1]), reverse = True)
else
if "results is greater than 5 and less than 10:
results += 4
sortData = sorted(data, key = lambda r:(int(r[results-1])), reverse = True)

How do I change it? by putting an if statement? in a try and except? I don't know.

In: Computer Science

Strong Metals Inc. purchased a new stamping machine at the beginning of the year at a...

Strong Metals Inc. purchased a new stamping machine at the beginning of the year at a cost of $1,330,000. The estimated residual value was $70,000. Assume that the estimated useful life was five years and the estimated productive life of the machine was 300,000 units. Actual annual production was as follows:

Year Units
1 70,000
2 67,000
3 50,000
4 73,000
5 40,000

Required:

1. Complete a separate depreciation schedule for each of the alternative methods.

a. Straight-line.

b. Units-of-production.

c. Double-declining-balance.

In: Finance

2. Will the following statements cause any error? (Yes/No) If a statement causes an error, what...

2. Will the following statements cause any error? (Yes/No) If a statement causes an error, what type of errors it is? (logic error, syntax/compile error, or runtime error). Again, there is no need to do the java code and test in jGrasp. You don’t need to provide the error message from the compiling or running results. The types of the error will be enough.

a. byte temp = 850;

b. celsius = 5 / 9 * (fahrenheit – 32);

c. int x = 3 / 0;

d. int y = 7 / 3.0;

e. int z = (int) 2.34567;

f. int value = 2147483647 + 1;

In: Computer Science

Part I– Check your file system Step 1: Execute the ls /dev/sd* command to see the...

Part I– Check your file system

Step 1: Execute the ls /dev/sd* command to see the current hard disk devices.

Step 2. Execute the fdisk -l command to list the current hard disk partitions

Step 3. Execute the parted -l command to list the current hard disk partition table.

Part II– Create a new virtual disk

Step 1. In the Oracle VM VirtualBox Manager program, create a new virtual hard disk with the size of 200 MB, and name it as “your_name.vdi” (for example, jbondsvdi).

Step 2. Load this virtual hard disk to your virtual machine.

Step 3. Repeat the steps in Part I, and highlight the differences

Part III– Creating Partitions and Filesystems

Step 1. Use the fdisk command to create a new primary partition on the new hard disk.

Step 2. Use the correct command to create an ext4 filesystem on the new partition.

Step 3. Repeat the steps in Part I, and highlight the differences

Step 4. Make a new directory named /cyse. And mount the new partition under this directory.

Step 5. Use the df command to check the mounting point of the new partition.

Step 6. Create a new file named file1.txt in the directory /cyse and put your name in that file

Step 7. Unmount /cyse directory.

Step 8. Check the contents in /cyse directory. What do you find?

In: Computer Science

import java.util.Scanner; import java.util.Arrays; /* You have 3 small methods to write for this exam; public...

import java.util.Scanner;
import java.util.Arrays;

/*
You have 3 small methods to write for this exam;
public static int smallest(int[] v1, int[] v2)
public static int[] convert1(String str)
public static String convert2(int[] v)
  
The comments right before each of them tell you exactly what they are
expected to do. Read all requirements first, then start implementing
the easiest methods first. You may work on them in any order.

You are also provided with a main method and two other methods that
are just there to call the methods your wrote with a bunch of tests
and display the outcomes of these tests on the console to help you debug
them.

Please note that the tests we provide you with are not exhaustive.
Your methods still need to meet all requirements even if we did
not provide you with a test for that particular requirement.

if you want to add more tests, I recommend you modify the main method.
If you are comfortable with the code in the two testing methods,
you may also modify them instead but do not waste too much time working
on them.

Good luck!   
*/
public class COP2513E1{

/**
This method returns 1 if vector v1 is the "smallest", 2 if it is vector v2,
or 0 otherwise.
We define "smallest" as follows;
If one of the vector has fewer elements than the other, it is the smallest one.
If both are the same size, then we look at every element one by one in order.
As soon as one of the two vectors has an element that is < than the corresponding
element from the other vector, then it is recognized as the "smallest" one by our method.
**/
public static int smallest(int[] v1, int[] v2){
return 0; // always returns 0 for now, replace this with your code
}// end method smallest




/**
This method takes a string that is guaranteed to be made only
of digits, without spaces or anything else.
Examples; "123" or "0"
Your goal is to create a new array of int values that will hold
each of the digits specified in the String.
Example; if the string passed is "123" your returned array
should contain the int value 1 at index 0, the value 2 at index 1,
and the value 3 at index 2.
Once you are done, return the reference to your newly created
array of int values.
**/
public static int[] convert1(String str){
return new int[1]; // always returns an array with 1 element for now, replace this with your code
}// end method convert1


/**
This method does the opposite work of the above convert1 method.
It takes a vector of single-digit int values and return a string
with all these digits one after the other.
If one of the values in the vector is not in the range 0 to 9 inclusive,
then simply have this method return an empty string as result instead.
**/
public static String convert2(int[] v){
return ""; // always returns an empty string for now, replace this with your code
}// end method convert2



/*
Do not modify the main, or the other methods below this line,
except if you want to add more tests
*/
//=========================================================================


public static void main(String[] args){
testSmallest();
testConvert();
}// end main method
  
public static void testSmallest(){
System.out.println("Testing your method smallest(...)");
  
int[][] testVectors1 = {
{1,2,3},
{1,2,3,4},
{1,2,3},
{1,2,3},
{2,3,4}
};
  
int [][] testVectors2 = {
{1,2,3,4},
{1,2,3},
{1,2,3},
{2,3,4},
{1,2,3}   
};
  
int [] expectedOutcomes = {
1, 2, 0, 1, 2
};
  
if((expectedOutcomes.length != testVectors2.length)
||(expectedOutcomes.length != testVectors1.length)
||(testVectors1.length != testVectors2.length)){
System.out.println("All tables must have the same # of tests");
System.exit(-1);
}// end if
  
int nTests = expectedOutcomes.length;
  
for(int test=0; test < nTests ; test++){
int observedOutcome = smallest(testVectors1[test], testVectors2[test]);
System.out.print("\tTest #" + test + " with vectors "
+ Arrays.toString(testVectors1[test]) + " and " + Arrays.toString(testVectors2[test]));
if(observedOutcome == expectedOutcomes[test])
System.out.println(" SUCCEEDED");
else
System.out.println(" FAILED");
}// end for loop
} // end testSmallest method


public static void testConvert(){
String[] strings= {
"",
"0",
"9",
"12",
"123"
};
  
int[][] vectors = {
{},
{0},
{9},
{1,2},
{1,2,3}
};
  
System.out.println("\nTesting your method convert1(...)");
if(vectors.length != strings.length){
System.out.println("All tables must have the same # of tests");
System.exit(-1);
}// end if
  
for(int test=0 ; test < strings.length ; test++){
int[] observed = convert1(strings[test]);
System.out.print("\tTest #" + test + " with string \"" + strings[test] + "\"");
System.out.println(" "+ (Arrays.equals(observed, vectors[test])?"SUCCEEDED":"FAILED"));
}//end for loop
  
System.out.println("\nTesting your method convert2(...)");

for(int test=0 ; test < vectors.length ; test++){
String observed = convert2(vectors[test]);
System.out.print("\tTest #" + test + " with vector " + Arrays.toString(vectors[test]));
System.out.println(" "+ (observed.equals(strings[test])?"SUCCEEDED":"FAILED"));
}//end for loop

}// end testConvert method

} // end class

In: Computer Science

[The following information applies to the questions displayed below.] At the beginning of the year, Plummer's...

[The following information applies to the questions displayed below.]

At the beginning of the year, Plummer's Sports Center bought three used fitness machines from Brunswick Corporation. The machines immediately were overhauled, installed, and started operating. The machines were different; therefore, each had to be recorded separately in the accounts.

Machine A Machine B Machine C
Invoice price paid for asset $ 32,300 $ 32,300 $ 23,400
Installation costs 2,300 2,400 1,100
Renovation costs prior to use 4,000 1,000 1,900


By the end of the first year, each machine had been operating 6,500 hours.

2. Prepare the entry to record depreciation expense at the end of Year 1, assuming the following. (If no entry is required for a transaction/event, select "No journal entry required" in the first account field.)

ESTIMATES

Machine Life Residual Value Depreciation Method
A 9 years $1,700 Straight-line
B 64,000 hours 3,700 Units-of-production
C 8 years 1,500 Double-declining-balance

In: Finance

In sql: Write a query to produce a listing of unique vendor names who have at...

In sql: Write a query to produce a listing of unique vendor names who have at least one invoice with us. You are using a table view called COMPANY_INFORMATION that lists a vendor id, vendor name, term id, and term description. The second table you will reference is the invoice table that lists vendor id, invoice num, invoice number, and invoice total. Do not show duplicate results.

In: Computer Science

A compound of molecular formula C7H13Br is a tertiary bromide, is optically inactive, and has one...

A compound of molecular formula C7H13Br is a tertiary bromide, is optically inactive, and has one primary carbon atom. C7H13Br is inert to catalytic hydrogenation. C7H13Br is reacted with another unknown compound. Thin-layer chromatography of the product mixture shows that two products are formed. GC analysis shows that the two products are formed in unequal amounts. Upon isolation from each other via distillation, both isolated products are optically inactive. Both products de-colorize molecular bromine.

Answer questions a-c below.

a. Based on the information provided, is the reaction between the tertiary bromide and the unknown compound a: 1. substitution, or 2. elimination reaction? ________

b. Will the organic starting material give a positive (P) or negative (N) result for the silver nitrate in alcohol test? ________

c. Propose a structure for C7H13Br. Name the structure.

In: Chemistry

Universal Technologies, Inc. has identified two qualified vendors with the capability to supply some of its...

Universal Technologies, Inc. has identified two qualified vendors with the capability to supply some of its electronic components. For the coming year, Universal has estimated its volume requirements for these components and obtained price-break schedules from each vendor. (These are summarized as “all-units” discounts in the table below.) Universal’s engineers have also estimated each vendor’s maximum capacity for producing these components, based on available information about equipment in use and labor policies in effect. Finally, because of its limited history with Vendor A, Universal has adopted a policy that permits no more than 60% of its total unit purchases on these components to come from Vendor A.

Vendor A

Vendor B

Product

Requirement

Unit price

Volume required

Unit price

Volume required

1

500

$225

0–250

$224

0–300

$220

250–500

$214

300–500

2

1000

$124

0–600

$120

0–1000

$115

600–1000

(no discount)

3

2500

$60

0–1000

$54

0–1500

$56*

1000–2000

$52

1500–2500

$51

2000–2500

Total capacity (units)

2500

2000

*For example, if 1400 units are purchased from Vendor A, they cost $56 each, for a total of $78,400.

What is the minimum-cost purchase plan for Universal?

In: Operations Management

You are driving along straight road. You cover 200 miles in 4 hours? Does that mean...

You are driving along straight road. You cover 200 miles in 4 hours? Does that mean that your speedometer read 50 mph for your entire trip? Is is necessary that your speedometer register 50 mph at least once during the trip? Use math to explain your answer.

I understand that your speedometer would not be 50mph for the entire trip, but I am not sure how to explain it using math.

In: Civil Engineering

In MATLAB: (a) Insert a comment in your script that says Problem 1: (b) Below this...

In MATLAB:

(a) Insert a comment in your script that says Problem 1:

(b) Below this comment, generate a vector of values called x that starts at −10, ends at 8, and has a step size of 0.1 between points.

(c) Define the function f(x) = (x − 6)(x 2 − 1)(x + 8) in your script, then plot f(x) against x.

(d) Plot the x- and y-axes on the plot in part (c). Mark each of the x-intercepts on this plot (you will need the hold on command).

(e) Label the x- and y-axes (you will need the xlabel and ylabel commands).

In: Computer Science

C++ Build a struct with many data members inside (for example, a large array). Design any...

C++

Build a struct with many data members inside (for example, a large array). Design any function that processes the data inside the struct (e.g. adding a few values together and returning the sum.) Write two versions of this function, one that passes by value and one that passes a const reference. Measure the time required to call each function 10,000 times.

In: Computer Science