Write some software

sedang Berlangsung Dipasang 6 tahun yang lalu Dibayar saat pengiriman
sedang Berlangsung Dibayar saat pengiriman

I need you to develop some software for me. I would like this software to be developed for Linux using C or C++. Small homework projects. Jee-mail, a small email service provider, has been receiving complaints from customers claiming that their inboxes are clogged with the dozens of spam email messages they receive each day. Consequently, Jee-mail has contracted with the Fruggle Corporation to design and build a spam detection system. Of course, since Fruggle gets all of its labor by exploiting El Camino students, you'll be doing all of the [login to view URL] one or more email messages, your program will have to classify each one as either spam or legitimate. Jee-mail wants you to build a point-based anti-spam system. Your program is to look for certain suspicious features in the email, such as frequent use of exclamation points (!), use of words like FREE, or excessive use of uppercase letters. Each time such a suspicious feature is found, you increase a score that indicates how suspicious an email is. If an email's score exceeds 100 points, then it is classified as spam; otherwise, it is deemed legitimate. The detailed rules for scoring a message are in the Spam Rules section [login to view URL] TranscriptHere is a sample transcript of the program, with boldface text representing the user's [login to view URL] the subject line of the email: MAKE MONEY FAST XTFWAQQQ

Enter the body of the email. Press Enter on an empty line to finish.

THIS IS YOUR CHANCE TO MAKE lots of moolah!

CLICK ON [login to view URL] FOR MORE INFORMATION!

← the user just hit the enter key on this line

This email is classified as spam, because its spam score is 115.

Would you like to classify another email (y or n)? Quit

Please enter y or n.

Would you like to classify another email (y or n)? Y

Please enter y or n.

Would you like to classify another email (y or n)? y

Enter the subject line of the email: hi mom

Enter the body of the email. Press Enter on an empty line to finish.

Hi mom,

I hope you're doing OK. My CS class is great, but the instructor is WEIRD!

I love you!

← the user just hit the enter key on this line

This email is classified as legitimate, because its spam score is 0.

Would you like to classify another email (y or n)? n

Number of spam messages: 1

Number of legitimate messages: 1

Input and Output SpecificationThe first line that your program must print out is exactly this (with one space after the colon):Enter the subject line of the email:

Your program must then read the subject line the user types in. (It is not an error if the subject line is the empty string.) After that, your program must print out exactly this line:Enter the body of the email. Press Enter on an empty line to finish.

Your program must then read the message body lines the user types in. The message body consists of zero or more lines. After your program reads an empty line, which indicates the end of the message, it must print out exactly one of these two messages, depending on whether applying the spam rules classified the message as spam or not:This email is classified as spam, because its spam score is number.

orThis email is classified as legitimate, because its spam score is number.

In these messages, number is to be replaced by the appropriate spam score, such as 115, or 0, or [login to view URL] printing the classification message, your program must print exactly this (with one space after the question mark):Would you like to classify another email (y or n)?

Your program must then read the line the user types in. If the user types only a lowercase y, the program must process another email, starting with the step where it prints the prompt for the subject line of the email. If instead, the user types only a lowercase n, the program must print an empty line, then print the following two lines, then terminate:Number of spam messages: number

Number of legitimate messages: number

In these messages, the first number is the number of messages that were classified as spam, and the second is the number that were classified as [login to view URL] the user types anything other than a single lowercase y or n in response to the question, the program must print out exactly the line:Please enter y or n.

and repeat the prompt about classifying another email. It must repeatedly prompt the user until y or n is [login to view URL] RulesThe Jee-mail spam experts have come up with five rules, each of which can contribute some points to the spam score of a message. If the total spam score for the message is more than 100, the message is classified as spam; otherwise, it is considered a legitimate message. You must use only these five rules; do not improvise and make up your own. (Save that for when you start your own competing spam filter company.)First, some definitions: a word in a string is a contiguous sequence of letters delimited either by non-letter characters or by the start or the end of the string. A letter may be upper- or lowercase. As an example, the string It's like the old-fashioned 1980s! has these seven words: It s like the old fashioned s. A consonant is a letter other than one of these ten:[login to view URL] are the five rules. The first three relate to the subject line of the email, while the last two are concerned with the body of the [login to view URL] the subject line has at least one word, and more than 90% of the words in the subject line consist of only uppercase letters, then add 30 points to the spam score. For example, a subject line ofGET A DIPLOMA FREE!!

meets this [login to view URL] the last word of the subject line contains more than 3 consecutive consonants, then add 40 points to the spam score. Spammers often place random words at the end of a subject line to confuse some anti-spam software; this rules detects many of those random words. For example, this subject line earns the 40 point addition to the score:This stock is going up, up, up! mqafrpxo!

If the subject line contains 3 or more contiguous exclamation points, then add 20 points to the spam score. This subject line qualifies for the 20 points, for example:Make money fast!!! No experience necessary!!!!!

If the body of the message has at least one word, and more than 50% of the words making up the body of the email consist entirely of uppercase letters, then add 40 points to the score. For example, this email:Subject: Greetings from your good friend

Body:

THIS IS YOUR CHANCE TO MAKE lots of moolah!

GO TO [login to view URL] FOR MORE INFORMATION!

earns the 40 points because there are 17 words in the body of the email, 11 of which (64.7%) are entirely uppercase. Each time one of the following special words is found in the body of the email, add 5 points to the spam score for that message. The letters in these words may be in either case (e.g., SeX is the same as sex):buy

cheap

click

diploma

enlarge

free

lonely

money

now

offer

only

pills

sex

For example, this message would score 35 points, 5 for each of the words indicated in boldface:Subject: Looking for cheap tickets?

Body:

You can find cheap! tickets ONLY on our website. Save money with this

great OfFeR!! Don't be a cheapskate. Click now for this offer!

Notice that the "cheap" in the subject line is ignored by this rule, as is the word "cheapskate" in the second line of the [login to view URL] You Must WriteWe know that this will be the most complex program that many of you will have written in your programming careers to date, so we will make it easier for you by decomposing the problem for [login to view URL] get full credit for this project, you must implement all of the following functions, using the exact function names, parameters types, and return types shown in this specification. The functions must not use any global variables whose values may change. (Global constants are all right.) In addition to testing your program as a whole, we will also test each of the following functions separately. That way, if your program doesn't work overall but you correctly implemented some of the functions, you'll still get some [login to view URL] functions you must implement are getFirstWord

getLastWord

extractWord

isUppercase

makeUppercase

hasMultipleExclamations

isGibberishWord

Your solution should use these functions where appropriate (although you might not use every one of them). One reason is to help you get partial credit in the case where most of your program is correct, but a few of the function implementations are [login to view URL] help you implement these functions, you might choose to write additional functions as well. While we won't test those additional functions separately, using them may help you structure your program more readably. If you find it helpful, you might have some of these seven required functions call other functions in that [login to view URL] you turn in your solution, none of these seven required functions, nor any functions that they call, may read any input from cin or write any output to cout. (Of course, during development, you may have them write whatever you like to help you debug.) If you want to print things out for debugging purposes, write to cerr instead of cout.  cerr is the standard error destination; items written to it by default go to the screen. When we test your program, we will cause everything written to cerr to be discarded instead — we will never see that output, so you may leave those debugging output statements in your program if you [login to view URL] getFirstWord(string text)This function returns the first word in the string variable text. If text has no words, this function returns the empty string (i.e. ""). Here is an incomplete test driver for this function: void test()

{

// This writes "Hello"

cerr << getFirstWord("!!Hello, Fred") << endl;

// This writes "greetings 9"

string msg = "greetings, mom, how are you?";

string result = getFirstWord(msg);

cerr << result << " " << [login to view URL]() << endl;

// This writes "0"

string s = getFirstWord(" $@#%!!");

cerr << [login to view URL]() << endl;

}

Hint: The string substr function may be of use in the implementation of this [login to view URL] getLastWord(string text)This function returns the last word in the string variable text. If text has no words, this function returns the empty string (i.e. ""). As an example, getLastWord("MAKE MONEY FAST!!") returns "FAST".Hint: The string substr function may be of use in the implementation of this [login to view URL] extractWord(string& text)This function returns the first word in the string that text is a reference to. If that string has no words, this function returns the empty [login to view URL] function also modifies the string that text refers to. If that string has no words, then this function sets text to the empty string. Otherwise, it removes from text the first word of textand all non-letters preceding that first word. Here is an incomplete test driver: void test()

{

string s = "***AMAZING!*** Do it, now!!";

string w = extractWord(s);

// This writes "AMAZING" and "!*** Do it, now!!"

cerr << w << endl << s << endl;

w = extractWord(s);

// This writes "Do" and " it, now!!" (space before "it")

cerr << w << endl << s << endl;

w = extractWord(s);

// This writes "it" and ", now!!"

cerr << w << endl << s << endl;

w = extractWord(s);

// This writes "now" and "!!"

cerr << w << endl << s << endl;

w = extractWord(s);

// This writes "" and "" (both empty strings)

cerr << w << endl << s << endl;

}

Hint: The string substr function may be of use in the implementation of this [login to view URL] isUppercase(string text)This function returns true if and only if every letter in the string text is uppercase. (For a string with no letters, this means the function returns true.) Non-letter characters in the string text, if any, have no effect on the result of this [login to view URL] makeUppercase(string text)This function returns a new string identical to the value of the string text, except that each lowercase letter of text appears as its uppercase equivalent in the result string. For example,makeUppercase("Earn *big* MONEY at home!!") returns "EARN *BIG* MONEY AT HOME!!".bool hasMultipleExclamations(string text)This function returns true if and only if the string text contains three consecutive exclamation marks. For example, it returns true for the strings "Wow!!!" and "Congrats!!!! Good luck", and false for the strings "W!I!N!" and "!! !".bool isGibberishWord(string text)This function returns true if and only if the string text contains more than three consecutive consonants. For example, it returns true for the strings "AGPQrxab" and "xxxxozzzz", and false for the strings "mortgage" and "discount prescriptions".Programming GuidelinesThe correctness of your program must not depend on undefined program behavior. Your program must never access out of range positions in a [login to view URL] must use your best programming style, including commenting where appropriate. Be sure that your program builds successfully, and try to ensure that your functions do something reasonable for at least a few test cases. That way, you can get some partial credit for a solution that does not meet the entire specification. To test your program effectively, you should unit testeach of your functions individually, and system test your entire program to ensure that all of the functions work together as [login to view URL] way to organize your program so that you can easily switch between testing individual functions and running the whole program normally is to do something like this: const bool unitTesting = true;

int main()

{

if (unitTesting)

{

doUnitsTests();

return 0;

}

… // code for the normal behavior goes here

}

The doUnitTests function does all your unit tests. To test the whole program normally, just change the value of the unitTesting variable from true to false (and make sure it's falsewhen you turn in the program).There are a number of ways you might write doUnitTests. One way is to interactively accept test strings: void doUnitTests()

{

string s;

for (;;)

{

cerr << "Enter text: ";

getline(cin, s);

if (s == "quit")

break;

cerr << "isUppercase returns ";

if (isUppercase(s))

cerr << "true" << endl;

else

cerr << "false" << endl;

cerr << "getFirstWord returns ";

cerr << getFirstWord(s) << endl;

}

}

While this is flexible, you run the risk of not being able to reproduce all your test cases if you make a change to your code and want to test that you didn't break anything that used to [login to view URL] way is to hard-code various tests and report which ones the program passes: void doUnitTests()

{

if (getFirstWord("hello there") == "hello")

cerr << "Passed test 1: getFirstWord(\"hello there\") == \"hello\")" << endl;

if (!isUppercase("WoW"))

cerr << "Passed test 2: !isUppercase(\"WoW\")" << endl;

}

This can get rather tedious. Fortunately, the library has a facility to make this easier: assert. If you include the header <cassert> you can call assert in the following manner: assert(some boolean expression);

During execution, if the expression is true, nothing happens and execution continues normally; if it is false, a diagnostic message is written telling you the text and location of the failed assertion, and the program is terminated. As an example, here's a very incomplete set of tests: #include <cassert>

void doUnitTests()

{

assert(getFirstWord("hello there") == "hello");

assert( isUppercase("WOW!!") );

assert( !isUppercase("WoW!!") );

string s = "***hello there";

assert( extractWord(s) == "hello" && s == " there" );

assert( extractWord(s) == "there" && s == "" );

assert( extractWord(s) == "" && s == "" );

cerr << "All tests succeeded" << endl;

}

The reason for writing one line of output at the end is to ensure that you can distinguish the situation of all tests succeeding from the case where one function you're testing silently crashes the [login to view URL] a program that manipulates a string entered by the user.

The program should start by asking the user to enter a word, a sentence, or a string of numbers. Store whatever the user enters into a C++ string.

The program should then display the following menu:

USE THIS MENU TO MANIPULATE YOUR STRING

----------------------------------------

1) Inverse String

2) Reverse String

3) To Uppercase

4) Jumble String 4-1 Sample Run

5) Count Number Words

6) Count Consonants

7) Enter a Different String

8) Print the String

Q) Quit¨      If the user selects 1:  Inverse the upper and lower case letters of the string.  If the string contains numeric characters or special characters do not change them.  NOTE:  This option should actually change the string to its inverse.  Note this option does not display the changed string.  If a user wanted to inverse the string and then display the string’s inverse they would select option 1 and then they would select option 8.            Example:  If the string is:  My name is John and I am 20 years old.                        The inverse would be:  mY NAME IS jOHN AND i AM 20 YEARS OLD. ¨      If the user selects 2: – Reverse the order of the characters in the string.  NOTE:  This option should actually change the string to its reverse.  Note this option does not display the changed string.  If a user wanted to reverse the string and then display the string’s reverse they would select option 2 and then they would select option 8. Example:  If the string is:  2015                        The reverse would be:  5102  ¨      If the user selects 3:  Convert all of the characters in the string to uppercase.  If the String contains numeric characters or special characters do not change them.  NOTE:  This option should actually change the string to all uppercase letters.  Note this option does not display the changed string.  If a user wanted to change the string to uppercase and then display the new string (in all uppercase) they would select option 3 and then they would select option 8. ¨      If the user selects 4:– Call a function named jumbleString.  The jumbleString function takes a string as input and displays a jumbled version of that string.   The jumbleString function should be called using current version of the string an argument (input) to the function.  Example:  If the string passed to the jumbleString function is: hello                 A jumbled version of the word would be:  elhlo Note 1: there are many different jumbled versions of each word that the jumbleString function could display.  So elhlo is not the only correct output for the above example. Note 2:  Notice that this option does not actually change the string like the first two menu selections do, the jumbleString function just displays a jumbled version of the string rather than actually changing the string   ¨      If the user selects 5: Call a function named countWords that counts the number of words in the current string and displays a message stating how many words are in the string Examples:    The string “2015” has one word                     The string “Hello World” has two words                     The string “  I     am     Woman     ” has 3 words ¨      If the user selects 6:  Call a function named countConsonants that counts the number of consonants in the current string and displays a message indicating how many consonants the string contains.  Consonants are letters that aren’t vowels. Example:  If the string is:  Hello                                    The number of consonants is: 3                        So display:  “The number of consonants in the string is 3.” ¨      If the user selects 7:  Let the user enter another string for processing.  (This should just change the string stored in the original string variable you created at the beginning of the program) ¨      If the user selects 8:  Print the Stringo   So if the original string was “Hello” and the user processed the string with option 3 followed by option 2, followed by option 8, the string would print out as “OLLEH” (This is hello first converted to uppercase and then reversed). ¨      If the user selects ‘Q’ or ‘q’: Quit the program ¨      Allow the user to continue processing strings (using the menu) until they select ‘Q’ or ‘q’ to quit ¨      If the user makes an invalid menu selection, print an error message to the screen  Your program must include the following three functions (you can include more if you want):1.      countWords:  A function that takes a string as an argument and counts the number of words in it  (this function should return an int which is the number of words in the string)2.      countConsonants:  A function that takes a string as an argument and counts the number of consonants in it  (this function should return an intwhich is the number of consonants in the string)3.      jumbleString:  A function that take a string as an argument and displays a jumbled version of the original string.

Pemrograman C Pemrograman C++ Linux Perancangan Perangkat Lunak

ID Proyek: #14864151

Tentang proyek

5 proposal Proyek online Aktif 6 tahun yang lalu

Diberikan kepada:

wangbeizou

Hello. How are you today. I have read and understood this task. Relevant Skills and Experience I have strong knowledge in Data structures, Algorithms Design, Computer Architecture, And I'm expert in C Proposed Mi Lebih banyak

$40 USD dalam 2 hari
(206 Ulasan)
6.6

5 freelancer rata-rata menawar $32 untuk pekerjaan ini

liangjongai

Hi! I'm interesting your project very well. I am mastering c++ and I'm a good Mathematician. And also I have many experience and good skill about web and android development. Let's go ahead with me Stay tuned, I'm s Lebih banyak

$50 USD dalam 1 hari
(284 Ulasan)
7.9
sumithgkonly

Depend on the project I'll give you 24 hrs to develop the software

$25 USD dalam 1 hari
(0 Ulasan)
0.0