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 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 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 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 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 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: 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
In: Accounting
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
*Please answer all three parts
Three Part Question: X. (A) NASA Atmospheric Mission balloons use helium that expands to almost 1 million cubic meter at the top of the atmosphere where pressure is 0.003 atm only. Even though it takes about 2.5 hours to get to this altitude, it is assumed that the rise is fast enough to be considered as adiabatic. Find the initial volume of the helium at the ground level. (Helium is a mono-atomic gas). (B) If the initial temperature of the gas was 15 degree celsius what is the temperature of the gas at the top? Ignore real atmospheric temperature changes. (C) What is the change in internal energy of the gas?
*Please provide steps, explanations, and formulas.
*Explain to me as if I know nothing
*I am genuinly trying to learn and understand. Please and thank you.
In: Physics
3. Job design (Connect/Perform)
Select the best answer based on your knowledge of different approaches to job design.
An online clothing retailer wants to provide superior customer service in its call centers. Based on an analysis of customer satisfaction surveys, the company decided to give customer service representatives as much discretion as possible in terms of taking appropriate actions to delight customers. This included making exceptions to policies on returns and refunds among other things. This is an example of which job design approach?
A. Specialization
B. Empowerment
C. Industrial engineering
D. Ergonomics
Select the best answer based on your knowledge of different approaches to job design.
The manager of a social media specialist at a public relations firm wants to redesign the job so that it contains a much wider range of job duties. Which approach to job design should the manager use in this situation?
A. Job enrichment
B. Job rotation
C. Job crafting
D. Job enlargement
Select the best answer based on your knowledge of the job characteristics model.
The new car sales professional’s job at a major car dealer network does not motivate many of the individuals who hold this job because they feel that the scope of the job is too narrow. Specifically, current and past sales professionals have said that while they are able to show customers various options for vehicles, they cannot be involved in negotiating the final selling price of the vehicle, nor can they handle the business side of the transaction in terms of getting loan approvals, completing the final paperwork for the sale, etc. Based on the job characteristics model, what would you do to address these issues if you were the manager?
A. Increase skill variety
B. Decrease autonomy
C. Increase task identity
D. Increase feedback
In: Operations Management
The college IT department manager no longer wants to use spreadsheets to calculate grades. The manager has asked you to create a program that will input the teachers' files and output the students' grades.
Write a Ruby program named format file.rb, which can be run by typing ruby widgets.rb.
In your Ruby environment, the program must read an input file formatted in CSV format, named input.csv. Each record contains data about a student and their corresponding grades.
The data will look similar to the following:
Student Name, assignment 1, assignment 2, assignment 3, assignment 4
John Adams, 90, 91, 99, 98
Paul Newman, 90, 92, 93, 94
Mary Smith, 95, 96, 99
Be careful to follow the output format exactly, including spacing. The output of your program must look like the following:
Student Assignment Average
John Adams 94.5
In: Computer Science
THIS IS IN PYTHON 3.0
Let's call the first function power(a,b). Use the built-in power function a**b in python to write a second function called testing(c) that tests if the first function is working or not.
I already have the function power(a,b), which is as follows:
def power(a, b):
if (b == 0): return 1
elif (int(b % 2) == 0):
return (power(a, int(b / 2)) *
power(a, int(b / 2)))
else:
return (a * power(a, int(a / 2)) *
power(a, int(b / 2)))
In: Computer Science
1.) What is the absolute pressure of the air in your car's tires, in psi, when your pressure gauge indicates they are inflated to 35.0psi ? Assume you are at sea level.
2.)A Jaguar XK8 convertible has an eight-cylinder engine. At the beginning of its compression stroke, one of the cylinders contains 499 cm3 of air at atmospheric pressure
(1.01
In: Physics
Succinyl-CoA inhibits both citrate synthase and α-ketoglutarate dehydrogenase. How is succinyl-CoA able to inhibit both enzymes?
In: Biology