Questions
With the development of information technology, advertising is becoming more intrusive in our daily lives. Discuss...

With the development of information technology, advertising is becoming more intrusive in our daily lives.

Discuss the pros and cons of advertising of medical and pharmaceutical products? Should the government impose more restrictions on advertising on these products? If so, under what conditions?

In: Economics

Visitors at a science museum are invited to sit in a chair to the right of...

Visitors at a science museum are invited to sit in a chair to the right of a full-length diverging lens (f1 = -3.30 m) and observe a friend sitting in a second chair, 1.80 m to the left of the lens. The visitor then presses a button and a converging lens (f2 = +4.50 m) rises from the floor to a position 2.10 m to the right of the diverging lens, allowing the visitor to view the friend through both lenses at once. Find (a) the magnification of the friend when viewed through the diverging lens only and (b) the overall magnification of the friend when viewed through both lenses. Be sure to include the algebraic sign (+ or -) with your answers.

In: Physics

Please type MAX 2 sentences for each question. 1) Why did the US invade Iraq in...

Please type MAX 2 sentences for each question.

1) Why did the US invade Iraq in 2003?

2) Why was Hurricane Katrina a national issue in 2005?

3) What were the highlights of the George W. Bush administration?

4) What were the highlights of Barack Obama's administration?

5) What issues divided liberals from conservatives in the early 2000s?

In: Economics

Show that vertex cover is in NP.

Show that vertex cover is in NP.

In: Computer Science

A 0.30-kg ball is thrown with a speed of 7.0m/s at an upward angle of 23?....

A 0.30-kg ball is thrown with a speed of 7.0m/s at an upward angle of 23?. Use conservation of energy

Part A

What is its speed at its highest point?

Part B

How high does it go?

In: Physics

What are Malala's leadership qualities?

What are Malala's leadership qualities?

In: Other

Consider the following CFG with starting variable S and Σ = {1, 2, 3, 4, 5,...

Consider the following CFG with starting variable S and Σ = {1, 2, 3, 4, 5, 6, 7,

8, 9, 0}:

S → X Y Z

X → 1 | 2

Y → W | ε

Z → Z Z | W

W → 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0

a. [20 marks] Create a derivation tree for your student number. - 84521004

b. [20 marks] Is this grammar ambiguous or unambiguous? Briefly explain (Remember the string is 84521004)

why.

In: Computer Science

Please explain in detail how Theodore Roosevelt was influential in the preservation/conservation of US resources,land, and...

Please explain in detail how Theodore Roosevelt was influential in the preservation/conservation of US resources,land, and wildlife.

include laws he wrote/passed along with where his personal motivations came from

include the history of the "Teddy Bear" and Roosevelts connection with its creation

In: Economics

1.    Hank and Barry produce baseballs and bats. The daily production ability for each is specified...

1.    Hank and Barry produce baseballs and bats. The daily production ability for each is specified in the

        table below.

balls

bats

Hank

4

8

Barry

12

16

        Use the information to determine who has each of the following.

        [a] Absolute advantage in bats.

        [b] Comparative advantage in bats.

        [c]   Absolute advantage in balls.

        [d] Comparative advantage in balls.

In: Psychology

Catalase testing is one of several tests used to detect presence of an electron transport chain...

Catalase testing is one of several tests used to detect presence of an electron transport chain in a cell. Catalase is made by a cell to detoxify H2O2. How does presence of H2O2 relate to the presence of an electron transport chain?

In: Biology

Folds are possible at which of the following 5 plate boundaries? More than one answer is...

Folds are possible at which of the following 5 plate boundaries? More than one answer is possible!

Group of answer choices

A. C-C Divergent

B.O-C Convergent

C. O-O Transform

D. O-O convergent

E. C-C Convergent

In: Other

implement the above in c++, you will write a test program named create_and_test_hash.cc . Your programs...

implement the above in c++, you will write a test program named create_and_test_hash.cc . Your programs should run from the terminal like so:
./create_and_test_hash <words file name> <query words file name> <flag> <flag> should be “quadratic” for quadratic probing, “linear” for linear probing, and “double” for double hashing. For example, you can write on the terminal:
./create_and_test_hash words.txt query_words.txt quadratic You can use the provided makefile in order to compile and test your code. Resources have been posted on how to use makefiles. For double hashing, the format will be slightly different, namely as follows:
./create_and_test_hash words.txt query_words.txt double <R VALUE> The R value should be used in your implementation of the double hashing technique discussed in class and described in the textbook: hash2 (x) = R – (x mod R). Q1. Part 1 (15 points) Modify the code provided, for quadratic and linear probing and test create_and_test_hash. Do NOT write any functionality inside the main() function within create_and_test_hash.cc. Write all functionality inside the testWrapperFunction() within that file. We will be using our own main, directly calling testWrapperFunction().This wrapper function is passed all the command line arguments as you would normally have in a main. You will print the values mentioned in part A above, followed by queried words, whether they are found, and how many probes it took to determine so. Exact deliverables and output format are described at the end of the file. Q1. Part 2 (20 points) Write code to implement double_hashing.h, and test using create_and_test_hash. This will be a variation on quadratic probing. The difference will lie in the function FindPos(), that has to now provide probes using a different strategy. As the second hash function, use the one discussed in class and found in the textbook hash2 (x) = R – (x mod R). We will test your code with our own R values. Further, please specify which R values you used for testing your program inside your README. Remember to NOT have any functionality inside the main() of create_and_test_hash.cc
You will print the current R value, the values mentioned in part A above, followed by queried words, whether they are found, and how many probes it took to determine so. Exact deliverables and output format are described at the end of the file. Q1. Part 3 (35 points) Now you are ready to implement a spell checker by using a linear or quadratic or double hashing algorithm. Given a document, your program should output all of the correctly spelled words, labeled as such, and all of the misspelled words. For each misspelled word you should provide a list of candidate corrections from the dictionary, that can be formed by applying one of the following rules to the misspelled word: a) Adding one character in any possible position b) Removing one character from the word c) Swapping adjacent characters in the word Your program should run as follows: ./spell_check <document file> <dictionary file>

You will be provided with a small document named document1_short.txt, document_1.txt, and a dictionary file with approximately 100k words named wordsEN.txt. As an example, your spell checker should correct the following mistakes. comlete -> complete (case a) deciasion -> decision (case b) lwa -> law (case c)

Correct any word that does not exist in the dictionary file provided, (even if it is correct in the English language). Some hints: 1. Note that the dictionary we provide is a subset of the actual English dictionary, as long as your spell check is logical you will get the grade. For instance, the letter “i” is not in the dictionary and the correction could be “in”, “if” or even “hi”. This is an acceptable output. 2. Also, if “Editor’s” is corrected to “editors” that is ok. (case B, remove character) 3. We suggest all punctuation at the beginning and end be removed and for all words convert the letters to lower case (for e.g. Hello! is replaced with hello, before the spell checking itself).

Do NOT write any functionality inside the main() function within spell_check.cc. Write all functionality inside the testSpellingWrapper() within that file. We will be using our own main, directly calling testSpellingWrapper(). This wrapper function is passed all the command line arguments as you would normally have in a main

In: Computer Science

C# Only Create a class named Customer that implements IComparable interface. Create 3 Customer class fields:...

C# Only

Create a class named Customer that implements IComparable interface.

Create 3 Customer class fields: Customer number, customer name, and amount due. Create automatic accessors for each field.

Create an Customer class constructor that takes parameters for all of the class fields and assigns the passed values through the accessors.

Create a default, no-argument Customer class constructor that will take no parameters and will cause default values of (9, "ZZZ", 0) to be sent to the 3-argument constructor.

Create an (override) Equals() method that determines two Customers are equal if they have the same Customer number.

Create an (override) GetHashCode() method that returns the Customer number.

Create an (override) ToString() method that returns a string containing the general Customer information (eg: CreditCustomer 1 russell AmountDue is $4,311.00 Interest rate is 0.01). Display the dollar amounts in currency format.

Implement CompareTo to compare object customer numbers for >, <, == to implement sorting for the array of objects.

Create a CreditCustomer class that derives from Customer and implements IComparable interface.

Create a class variable named Rate using an automatic accessor.

Create an CreditCustomer class constructor that takes parameters for the Customer class fields customer number, name, amount, and rate percent that sets the Rate CreditCustomer variable to the rate percentage. Pass the id number, name and amount back to the base Customer class constructor.

Create a default, no-argument CreditCustomer class constructor that will take no parameters and will cause default values of (0, "", 0, 0) to be sent to the 4-argument CreditCustomer constructor.

Create an (override) ToString() method that returns a string containing the general Customer information (eg: CreditCustomer 1 russell AmountDue is $4,311.00 Interest rate is 0.01 Monthly payment is $179.63). Display the dollar amounts in currency format.

Implement CompareTo to compare CreditCustomer objects based on customer numbers for >, <, == to implement sorting for the array of objects.

In Main:

Create an array of five CreditCustomer objects.

Prompt the user for values for each of the five Customer object; do NOT allow duplicate Customer numbers and force the user to reenter the Customer when a duplicate Customer number is entered.

CreditCustomer objects should be sorted by Customer number before they are displayed.

When the five valid Customers have been entered, display them all, display a total amount due for all Customers, display the same information again with the monthly payment for each customer. See the input/output example shown below.

Create a static GetPaymentAmounts method that will have the current Credit customer object as a parameter and returns a double value type. Each CreditCustomer monthly payment will be 1/24 of the balance (amount due). The computed monthly individual customer payment will be returned for each CreditCustomer object in the object array.

Internal Documentation.

Note that you will be overriding three object methods in the Customer class and one in the CreditCustomer class. Don't forget about IComparable.

An example of program output might look like this:

Enter customer number 3
Enter name johnson
Enter amount due 1244.50
Enter interest rate .10
Enter customer number 2
Enter name jensen
Enter amount due 543.21
Enter interest rate .15
Enter customer number 2
Sorry, the customer number 2 is a duplicate.
Please reenter
5
Enter name swenson
Enter amount due 6454.00
Enter interest rate .11
Enter customer number 1
Enter name olson
Enter amount due 435.44
Enter interest rate .20
Enter customer number 4
Enter name olafson
Enter amount due 583.88
Enter interest rate .25

Summary:

CreditCustomer 1 olson AmountDue is $435.44 Interest rate is 0.2
CreditCustomer 2 jensen AmountDue is $543.21 Interest rate is 0.15
CreditCustomer 3 johnson AmountDue is $1,244.50 Interest rate is 0.1
CreditCustomer 4 olafson AmountDue is $583.88 Interest rate is 0.25
CreditCustomer 5 swenson AmountDue is $6,454.00 Interest rate is 0.11

AmountDue for all Customers is $9,261.03

Payment Information:

CreditCustomer 1 olson AmountDue is $435.44 Interest rate is 0.2
Monthly payment is $18.14
CreditCustomer 2 jensen AmountDue is $543.21 Interest rate is 0.15
Monthly payment is $22.63
CreditCustomer 3 johnson AmountDue is $1,244.50 Interest rate is 0.1
Monthly payment is $51.85
CreditCustomer 4 olafson AmountDue is $583.88 Interest rate is 0.25
Monthly payment is $24.33
CreditCustomer 5 swenson AmountDue is $6,454.00 Interest rate is 0.11
Monthly payment is $268.92
Press any key to continue . . .


Declaring a child class:

public class Fiction : Book //for extending classes, you must use a single colon between the derived class name and its base class name
{
private:
//put your private data members here!
public:
//put your public methods here!
}

NOTE: when you instantiate an object of Fiction child class, you will inherit all the data members and methods of the Book class

In: Computer Science

Describe why worksheets are required for accounting transactions. What is the purpose of adjusting entries?

Describe why worksheets are required for accounting transactions. What is the purpose of adjusting entries?

In: Accounting

The following questions are to be done in JAVA. 1) If an array is not considered...

The following questions are to be done in JAVA.

1) If an array is not considered circular, the text suggests that each remove operation must shift down every remaining element of the queue. An alternative method is to postpone shifting until rear equals the last index of the array. When that situation occurs and an attempt is made to insert an element into the queue, the entire queue is shifted down so that the first element of the queue is in the first position of the array. What are the advantages of this method over performing a shift at each remove operation? What are the disadvantages?

2) what does the following code fragment do to the queue q?

ObjectStack s = new ObjuectStack();

while (!q.isEmpty())

s.push(q.remove());

while (!s.isEmpty())

q.insert(s.pop());

3)Describe how you might implement a queue using two stacks. Hint: If you push elements onto a stack and then pop them all, they appear in reverse order. If you repeat this process, they're now back in order.

Thank you for all the help.

In: Computer Science