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
Don't copy again same code. Strict warning: do asap.
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.)
C# (Login User Control) Create a UserControl called LoginPasswordUserControl that contains a Label (loginLabel) that displays string "Login:", a TextBox (loginTextBox), where the user inputs a login name, a Label (passwordLabel) that displays the string "Password:" and, finally, a TextBox (passwordTextBox), where a user inputs a password (set property PasswordChar to "*" in the TextBox’s Properties window). LoginPasswordUserControl must provide public read-only properties Login and Password that allow an app to retrieve the user input from loginTextBox and passwordTextBox. The UserControl must be exported to an app that displays the values input by the user in LoginPasswordUserControl.
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
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education