Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Implement the scoreTypo function in the following program: #include #include #include using namespace std; int scoreTypo(const string dictionary[], int n, string word) { Replace this line with your...

1 answer below »
Implement the scoreTypo function in the following program:
#include #include #include using namespace std;
int scoreTypo(const string dictionary[], int n, string word)
{
Replace this line with your implementation
}
int main()
{

Here are some tests. You may add more if you wish.
string dict1[6] = { "fe
uary", "pointer", "country", "forty", "conversation", "minuscule" };
assert(scoreTypo(dict1, 0, "forty") == -1);
assert(scoreTypo(dict1, 6, "forty") == 0);
assert(scoreTypo(dict1, 6, "fourty") == 1);
assert(scoreTypo(dict1, 6, "febuary") == 1);
assert(scoreTypo(dict1, 6, "miniscule") == 1);
assert(scoreTypo(dict1, 6, "poitner") == 1);
assert(scoreTypo(dict1, 6, "conservation") == 2);
cout
"All tests succeeded"
endl;
}
The scoreTypo function considers only the first n elements of the a
ay passed to dictionary. You may assume that word and that every string in dictionary consists of at least one lower case letter and contains no character that is not a lower case letter. (So we promise that we will not pass strings like "", "eBay", "half-wit", "be at", or "hen3ry" to this function.) If n is not positive, scoreTypo returns −1; otherwise, it returns the smallest typo score among all the typo scores between word and each string in dictionary.
Let's define a simple typo of a string as one of the following:
· adding exactly one character to the string (e.g., adding one character to forty to produce fourty)
· removing exactly one character from the string (e.g., removing a character from fe
uary to produce febuary)
· replacing exactly one character in the string (e.g., replacing a character in minuscule to produce miniscule)
· swapping two adjacent characters in the string (e.g., swapping two adjacent characters of pointer to produce poitner)
The typo score between two strings is defined to be
· 0 if the strings are identical
· 1 if exactly one simple typo would transform one string to the othe
· 2 if neither of the above two conditions hold
For example, the typo score between country and fourty is 2, while the typo score between forty and fourty is 1. In the example program above, 1 is the smallest typo score among all the typo scores between fourty and each word in dict1.
The source file named typo.cpp that you turn in will contain the entire program above. You can actually have the main routine do whatever you want, because we will rename it to something harmless, never call it, and append our own main routine to your file. Our main routine will thoroughly test your function. You'll probably want your main routine to do the same. If you wish, you may add helper functions that your implementation of scoreTypo calls.
The program you turn in must build successfully, and during execution, no function (other than main) may read anything from cin or write anything to cout. If you want to print things out for debugging purposes, write to ce
 instead of cout. When we test your program, we will cause everything written to ce
 to be discarded instead — we will never see that output, so you may leave those debugging output statements in your program if you wish.
Although our test routine will call your function passing values for n that are less than or equal to the number of elements in the a
ay passed as dictionary, we will never pass a value for n than is greater than the number of elements in the a
ay passed as dictionary.

XXXXXXXXXXHWC MATHS XXXXXXXXXXSPRING 2021
XXXXXXXXXXMIDTERM TEST
NAME__________________________
1. A bank offers a 10-year CD that earns 2.45% compounded continuously.
- If $ 6000 is invested in this CD, how much will it worth in 10 years?
-How long will it take for the account to be worth $9000?
2. Find the equation of the line tangent to the graph of
F(x) = 2 + Lnx XXXXXXXXXXat the point X=1:
3. Find the derivative of: F(x) = (2x+1)(x2 – 3x)
4. Find dF/dx of F(x) =(3x + 5)/(x2 + 3)
5. Find the derivative of: F(x) = Ln(x4 +1)
6. Find y’ when y = 5(x2 – 3)2
7. Find F’(x) of F(x) = x2(X – 5)3 and find the values of x where the tangent line is horizontal.
8. Use implicit differentiation to find y’ and to evaluate Y’ at the point
(-1, 1) when y2 + 2y +3x = 0
9. Assume that x= x(t) and y= y(t), find the rate of change of
y = x3 +2 when x’ = 4 and x= 5
10. Use a graphing calculator to graph F(x) = 2x 3 -- 3x 2 -- 36x XXXXXXXXXXDetermine the intervals on which F(x) is:
Increasing
Decreasing
Concave upward
Concave downward
----------------------------------------
The local minimum
The local maximum
The point of inflection
11. Find the second derivative for F(x) = 2x3 – 4x2 + 5x -- 6
F’(x) =
The critical values F’(x) = 0
x = ___ f(x) =___
The points of inflection
F’’(x) = 0 XXXXXXXXXXx = ___ f(x) = __
12. If it’s necessary, use the Hopital’s rule to find:
Lim (5X)/ (ex – 1)
X (0
13. If it’s necessary, use the Hopital’s rule to find:
Lim (x2 – 9)/(x + 3)
x(-- 3
14. For F(x) = x3 – 6x2 + 9x – 6 in the interval [- 1, 5] find alge
aically:
F’(x) =
F’(x) = 0
F’(-1) =
F”( x ) =
F”(x) = 0
F”( 5 ) =
Absolute maximum( , XXXXXXXXXXAbsolute minimum( , )
PAGE
4

Assignment 1_ISYS350_Summer2021
1. Sales Tax
Write a program that will ask the user to enter the amount of a purchase. The
program should then compute the state and county sales tax. Assume the state
tax is 8 percent and county tax is 3.5 percent. The program should display the
amount of the purchase, the state sales tax and the county sales tax, total sales
tax, and the total of the sale (which is the sum of the amount purchase plus total
sales tax).
2. Celsius to Fahrenheit Temperature Converter
Write a program that converts Celsius temperatures to Fahrenheit temperatures.
The formula is as follows:
F = (9/5)*C +32
The program should ask the user to enter a temperature in Celsius, then display
the temperature converted to Fahrenheit.
3. Book Club Points
Serendipity Booksellers has a book club that awards points to its customers based
on the number of books purchased each month. The points are awarded as
follows:
• If a customer purchases 0 books, he or she earns 0 points.
• If a customer purchases 1 book, he or she earns 6 points. • If a customer
purchases 2 books, he or she earns 16 points.
• If a customer purchases 3 books, he or she earns 32 points.
• If a customer purchases 4 or more books, he or she earns 60 points. Write a
program that asks the user to enter the number of books that he or she has
purchased this month and displays the number of points awarded.
Answered 8 days After Aug 17, 2021

Solution

Mohit answered on Aug 25 2021
140 Votes
Assignment 1_ISYS350_Summer2021
1. Sales Tax Write a program that will ask the user to enter the amount of a purchase. The program should then compute the state and county sales tax. Assume the state tax is 8 percent and county tax is 3.5 percent. The program should display the amount of the purchase, the state sales tax and the county sales tax, total sales tax, and the total of the sale (which is the sum of the amount purchase plus total sales tax).
2. Celsius to Fahrenheit Temperature Converter Write a program that converts Celsius temperatures to Fahrenheit temperatures. The formula is as follows: F = (9/5)*C +32 The program should ask the user to enter a temperature in Celsius, then display the temperature converted to Fahrenheit.
3. Book Club Points Serendipity Booksellers has a book club that awards points to its customers based on the number of books purchased each month. The points...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here