C++ How to Program (10th Edition)
C++ How to Program (10th Edition)
10th Edition
ISBN: 9780134448237
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
bartleby

Concept explainers

Question
Book Icon
Chapter 21, Problem 21.27MAD
Program Plan Intro

Program Plan:

  • Include header files.
  • Start "main()" function.
    • Make a string array "spam" containing 30 spam sample keywords.
    • Declare "spamscore" and "countword" variables to store count of spam words and total words respectively.
    • Accept "emailmsg".
    • Use stringstream "s" for breaking words of emailmsg.
    • Start while loop where words from stringstream "s" goes into string "word". Condition of executing loop is till we have words in stream "s".
    • Increment countword.
    • Use for loop for value i=1 to 30 for each word in array "spam".
    • If word is same as one of spam keywords increase spamscore.
    • end for loop
    • end while loop
    • Display Total Number of words in a message.
    • Display Total Number of spam words in a message.
    • Using type casting calculate "spampercent" as "((float)spamscore/(float)countword)*100;".
    • If "spampercent> 30" then display "It's a spam message".
    • else display "It's not a spam".
    • Return and exit "main()" function.

Blurred answer
Students have asked these similar questions
Spam (or junk e-mail) costs U.S. organizations billions of dollars a year in spam-prevention software, equipment, network resources, bandwidth, and lost productivity. Research online some of the most common spam e-mail messages and words, and check your own junk e-mail folder. Create a list of 30 words and phrases commonly found in spam messages. Write a program in which the user enters an e-mail message. Read the message into a large character array and ensure that the program does not attempt to insert characters past the end of the array. Then scan the message for each of the 30 keywords or phrases. For each occurrence of one of these within the message, add a point to the message’s “spam score.” Next, rate the likelihood that the message is spam, based on the number of points it received. (must be in ''C'' programming language.)
Entered Answer Preview Result Message correct (923,998) (923,998) (2398,2171) (2398, 2171) correct (2,808) (2,808) Your answer isn't a number incorrect (it looks like a list of numbers) At least one of the answers above is NOT correct. (1 point) Consider the elliptic curve group based on the equation y² = x + ax + b x3 mod p where a = 2440, b = 295, and p = 3391. We will use these values as the parameters for a session of Elliptic Curve Diffie-Hellman Key Exchange. We will use P = (2, 808) as a subgroup generator. You may want to use mathematical software to help with the computations, such as the Sage Cell Server (SCS). On the SCS you can construct this group as: G=Elliptic Curve (GF(3391), [2440,295]) Here is a working example. (Note that the output on SCS is in the form of homogeneous coordinates. If you do not care about the details simply ignore the 3rd coordinate of output.) Alice selects the private key 18 and Bob selects the private key 15. What is A, the public key of Alice?…
#!/bin/sh # Author : Name of Author # Copyright (c) information echo "what is your name?" read PERSON echo "Hello, $PERSON" With the code above as an example, write short notes on Shell scripting. 3:39 PM
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT