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
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?…
Task3: Program an encryption tool that uses XOR operation to encrypt the message. (Note: the key should be numerical) Hint': you must encrypt all letters of the "plaintext" variable. Hint?: you have to iterate through all letters to encrypt them. Hints: you can use ord() method, to receive each character Unicode https://careerkarma.com/blog/python-ord/ "The text to be encrypted" plainTxt key = "432457" %3D Here's the output: [W@VJAG]VVPZPOL[CFPP plainTxt = "The text to be encrypted" key "theKey" %3D The key must be numbers
Please provide answer in C#:   Slot Machine Simulation A slot machine is a gambling device into which the user inserts money and then pulls a lever (or presses a button). The slot machine then displays a set of random images. If two or more of the images match, the user wins an amount of money that the slot machine dispenses back to the user. Create an application that simulates a slot machine. Figure 8-23 (on page 539 of your book) shows an example of how the form should look. The application should let the user enter into a TextBox the amount of money he or she is inserting into the machine. When the user clicks the Spin button, the application should display three randomly selected symbols. (Slot machines traditionally display fruit symbols. You will find a set of fruit symbols attached to this dropbox for your use - from the Student Sample Programs provided by the book author.) If none of the randomly displayed images match, the program should inform the user that he or she has won…
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