SlideShare uma empresa Scribd logo
1 de 2
Baixar para ler offline
Problem statement: You are tasked to write a program that reads in a sentence or a paragraph
(max length 1023 letters) rom the user, store it as a string, and gives the user several options for
operations to perform on the text r quit. After performing an operation, the user should be
prompted to select another option until they choose to quit. The program must handle all types of
bad inputs from user and recover from the errors. Detailed requirements for each choice are listed
below: 1. Vowels vs. Consonants: Check if the number of vowels equals the number of
consonants. Ignore any nonletter characters. Example: User enters "banana"; program prints" #
vowels = # consonants." Example: User enters "ban ana 44!"; program prints" # vowels = #
consonants." Example: User enters "zip"; program prints "# vowels != # consonants." 2. Letter
swap: prompt the user for two valid letters, create a copy of the original string, and modify the copy
string by replacing all occurrences of the first letter with the second letter. Example: User enters
"Off we go, into the wild blue yonder!", then characters 'o' and 'i'. Program prints: Iff we gi, inti the
wild blue yinder! (Notice: capitalization is preserved) 3. Flip (reverse) the string: create a copy of
the original string, and then reverse it. Example: User enters "ban ana 54!"; program creates a
new string and outputs: " 45 ana nab" Example: User enters "zip"; program creates a new string
and outputs: "piz" 4. Palindrome Detector: Determine whether the input string is palindrome or not.
A palindrome is a word, phrase, or sequence that reads the same backwards as forward. E.g.,
racecar, madam. Examples of palindromes that your code needs to detect: User enters
"11Radar911", program outputs "This is a palindrome." (Ignore the numbers and case of letters)
User enters "top sports", program outputs "This is not a palindrome." User enters "Was it a car or
a cat I saw?", program outputs "This is a palindrome." (Ignore the space and special characters,
'?') 5. Words frequency: Prompt the user for N words that the user wants to search for in the input
string. For this assignment, assuming N is a positive integer less than or equal to 10. Use a string
array to store N words, and output the frequency of N given words in the input string. Example:
User enters "This is a test sentence, is this?", then 3 words, "this", "text", and "test". The program
outputs: this: 2 text: 0 test: 1 (Note: Case insensitive, meaning "word" and "WoRD" are the same;
All numbers and special characters in the string are ignored, meaning "wor32rd", "wo]]]rd343.34",
and "word" are the same)Suggested functions: a. bool is palindrome (string str); //return true if str
is palindrome, false otherwise b. string purge_string (string str); /laccepts a string, and returns a
version where all numbers, spaces, and special characters have been removed OR you may use
this: void purge_string (string str, string s str_new); /laccepts two c-strings, remove all spaces and
special characters in str, and store the new string into str_new For frequency of given words, the N
words must be entered at one time before searching to see if the words are in the
sentence/paragraph. In other words, you cannot ask for a word, search its frequency and then ask
for another word. You must ask for all words before searching for the words.Implementation
Requirements: - Your user interface must provide clear instructions for the user and information
about the data being presented - Use of references is required. - Use of 1D array is required -
Libraries allowed to use: >,< string >,< cstring >,< cstdlib >,< cmath >, , fstream > if doing extra
credit 1) - Your program should be properly decomposed into tasks and subtasks using functions.
To help you with this, use the following: Make each function do one thing and one thing only. - No
more than 15 lines inside the curly braces of any function, including main(). Whitespace, variable
declarations, single curly braces, vertical spacing, comments, and function headers do not count. -
Functions over 15 lines need justification in comments. - Do not put multiple statements into one
line. - You are encouraged to use the functions in assignment 4 to do error handling. - No global
variables allowed (those declared outside of any functions, global constants are allowed). - Make
sure you follow the style guidelines, have a program header and function headers with appropriate
comments, and be consistent.

Mais conteúdo relacionado

Semelhante a Problem statement You are tasked to write a program that re.pdf

Java: Primitive Data Types
Java: Primitive Data TypesJava: Primitive Data Types
Java: Primitive Data TypesTareq Hasan
 
Lab6: I/O and Arrays
Lab6: I/O and ArraysLab6: I/O and Arrays
Lab6: I/O and Arraysenidcruz
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming FundamentalsHassan293
 
classVI_Coding_Teacher_Presentation.pptx
classVI_Coding_Teacher_Presentation.pptxclassVI_Coding_Teacher_Presentation.pptx
classVI_Coding_Teacher_Presentation.pptxssusere336f4
 
INTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGE
INTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGEINTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGE
INTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGERathnaM16
 
Cis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programmingCis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programmingHamad Odhabi
 
3110003_PPS_GTU_Study_Material_Presentations_Unit-2_18122020041700AM (1).pptx
3110003_PPS_GTU_Study_Material_Presentations_Unit-2_18122020041700AM (1).pptx3110003_PPS_GTU_Study_Material_Presentations_Unit-2_18122020041700AM (1).pptx
3110003_PPS_GTU_Study_Material_Presentations_Unit-2_18122020041700AM (1).pptxLeenaChaudhari24
 
C language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageC language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageRakesh Roshan
 
Please write a code in JAVA to do line editor..Your program will b.pdf
Please write a code in JAVA to do line editor..Your program will b.pdfPlease write a code in JAVA to do line editor..Your program will b.pdf
Please write a code in JAVA to do line editor..Your program will b.pdffazilfootsteps
 
Western Oregon University Page 1 of 2 CS-161.docx
 Western Oregon University            Page 1 of 2 CS-161.docx Western Oregon University            Page 1 of 2 CS-161.docx
Western Oregon University Page 1 of 2 CS-161.docxaryan532920
 
C programming perso notes
C programming perso notesC programming perso notes
C programming perso notesMelanie Tsopze
 
Introduction To Programming with Python-1
Introduction To Programming with Python-1Introduction To Programming with Python-1
Introduction To Programming with Python-1Syed Farjad Zia Zaidi
 
C programming assignment presentation file
C programming assignment presentation fileC programming assignment presentation file
C programming assignment presentation filesantoshkumarhpu
 
Fundamentals of c language
Fundamentals of c languageFundamentals of c language
Fundamentals of c languageAkshhayPatel
 
Introduction to Python Part-1
Introduction to Python Part-1Introduction to Python Part-1
Introduction to Python Part-1Devashish Kumar
 

Semelhante a Problem statement You are tasked to write a program that re.pdf (20)

Feature Engineering in NLP.pdf
Feature Engineering in NLP.pdfFeature Engineering in NLP.pdf
Feature Engineering in NLP.pdf
 
Java: Primitive Data Types
Java: Primitive Data TypesJava: Primitive Data Types
Java: Primitive Data Types
 
Lab6: I/O and Arrays
Lab6: I/O and ArraysLab6: I/O and Arrays
Lab6: I/O and Arrays
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
Python Homework Help
Python Homework HelpPython Homework Help
Python Homework Help
 
classVI_Coding_Teacher_Presentation.pptx
classVI_Coding_Teacher_Presentation.pptxclassVI_Coding_Teacher_Presentation.pptx
classVI_Coding_Teacher_Presentation.pptx
 
INTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGE
INTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGEINTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGE
INTRODUCTION TO CODING-CLASS VI LEVEL-DESCRIPTION ABOUT SYNTAX LANGUAGE
 
Cis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programmingCis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programming
 
3110003_PPS_GTU_Study_Material_Presentations_Unit-2_18122020041700AM (1).pptx
3110003_PPS_GTU_Study_Material_Presentations_Unit-2_18122020041700AM (1).pptx3110003_PPS_GTU_Study_Material_Presentations_Unit-2_18122020041700AM (1).pptx
3110003_PPS_GTU_Study_Material_Presentations_Unit-2_18122020041700AM (1).pptx
 
C language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageC language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C language
 
Please write a code in JAVA to do line editor..Your program will b.pdf
Please write a code in JAVA to do line editor..Your program will b.pdfPlease write a code in JAVA to do line editor..Your program will b.pdf
Please write a code in JAVA to do line editor..Your program will b.pdf
 
Western Oregon University Page 1 of 2 CS-161.docx
 Western Oregon University            Page 1 of 2 CS-161.docx Western Oregon University            Page 1 of 2 CS-161.docx
Western Oregon University Page 1 of 2 CS-161.docx
 
C programming perso notes
C programming perso notesC programming perso notes
C programming perso notes
 
Introduction To Programming with Python-1
Introduction To Programming with Python-1Introduction To Programming with Python-1
Introduction To Programming with Python-1
 
Java programlist (1)
Java programlist (1)Java programlist (1)
Java programlist (1)
 
C programming assignment presentation file
C programming assignment presentation fileC programming assignment presentation file
C programming assignment presentation file
 
Review Python
Review PythonReview Python
Review Python
 
Fundamentals of c language
Fundamentals of c languageFundamentals of c language
Fundamentals of c language
 
fundamentals of c
fundamentals of cfundamentals of c
fundamentals of c
 
Introduction to Python Part-1
Introduction to Python Part-1Introduction to Python Part-1
Introduction to Python Part-1
 

Mais de acecomputertcr

Review and analyze the following RFP below at httpswwwe.pdf
Review and analyze the following RFP below at httpswwwe.pdfReview and analyze the following RFP below at httpswwwe.pdf
Review and analyze the following RFP below at httpswwwe.pdfacecomputertcr
 
What is the worst choice of split ratio Training set Test .pdf
What is the worst choice of split ratio Training set  Test .pdfWhat is the worst choice of split ratio Training set  Test .pdf
What is the worst choice of split ratio Training set Test .pdfacecomputertcr
 
VAKA 32 Ufuk Danmanlk Patti Smith Horizon Consultingin .pdf
VAKA 32  Ufuk Danmanlk  Patti Smith Horizon Consultingin .pdfVAKA 32  Ufuk Danmanlk  Patti Smith Horizon Consultingin .pdf
VAKA 32 Ufuk Danmanlk Patti Smith Horizon Consultingin .pdfacecomputertcr
 
Turner Syndrome occurs when an individual inherits one X chr.pdf
Turner Syndrome occurs when an individual inherits one X chr.pdfTurner Syndrome occurs when an individual inherits one X chr.pdf
Turner Syndrome occurs when an individual inherits one X chr.pdfacecomputertcr
 
The random variable M has PMF PMmc41m0m0123else .pdf
The random variable M has PMF PMmc41m0m0123else .pdfThe random variable M has PMF PMmc41m0m0123else .pdf
The random variable M has PMF PMmc41m0m0123else .pdfacecomputertcr
 
Subject S1 has the clearance Secret C0C1C2C3 Which .pdf
Subject S1 has the clearance Secret C0C1C2C3 Which .pdfSubject S1 has the clearance Secret C0C1C2C3 Which .pdf
Subject S1 has the clearance Secret C0C1C2C3 Which .pdfacecomputertcr
 
The following utility function represents Roses preference .pdf
The following utility function represents Roses preference .pdfThe following utility function represents Roses preference .pdf
The following utility function represents Roses preference .pdfacecomputertcr
 
Nesmith Corporations outstanding bonds have a 1000 par va.pdf
Nesmith Corporations outstanding bonds have a 1000 par va.pdfNesmith Corporations outstanding bonds have a 1000 par va.pdf
Nesmith Corporations outstanding bonds have a 1000 par va.pdfacecomputertcr
 
Given the table below assuming that there are only 9 resour.pdf
Given the table below assuming that there are only 9 resour.pdfGiven the table below assuming that there are only 9 resour.pdf
Given the table below assuming that there are only 9 resour.pdfacecomputertcr
 
Practice Questions PV and FV Formulae YOU MAY USE A FIN.pdf
Practice Questions PV and FV   Formulae   YOU MAY USE A FIN.pdfPractice Questions PV and FV   Formulae   YOU MAY USE A FIN.pdf
Practice Questions PV and FV Formulae YOU MAY USE A FIN.pdfacecomputertcr
 
please explain and list every step using commands from ste.pdf
please explain and list every step using commands from ste.pdfplease explain and list every step using commands from ste.pdf
please explain and list every step using commands from ste.pdfacecomputertcr
 
Each student is required to post a response to problem CP12.pdf
Each student is required to post a response to problem CP12.pdfEach student is required to post a response to problem CP12.pdf
Each student is required to post a response to problem CP12.pdfacecomputertcr
 
During the year the following transactions occurred Feb 1.pdf
During the year the following transactions occurred Feb 1.pdfDuring the year the following transactions occurred Feb 1.pdf
During the year the following transactions occurred Feb 1.pdfacecomputertcr
 
Oilpartz Ltdnin sahibi Dave McDonald ceketini kard ve masa.pdf
Oilpartz Ltdnin sahibi Dave McDonald ceketini kard ve masa.pdfOilpartz Ltdnin sahibi Dave McDonald ceketini kard ve masa.pdf
Oilpartz Ltdnin sahibi Dave McDonald ceketini kard ve masa.pdfacecomputertcr
 
Match Perverse incentives that encourage risky behavior by .pdf
Match Perverse incentives that encourage risky behavior by .pdfMatch Perverse incentives that encourage risky behavior by .pdf
Match Perverse incentives that encourage risky behavior by .pdfacecomputertcr
 
Let E and F be two events in a sample space Which of the fo.pdf
Let E and F be two events in a sample space Which of the fo.pdfLet E and F be two events in a sample space Which of the fo.pdf
Let E and F be two events in a sample space Which of the fo.pdfacecomputertcr
 
Escenarios Escenario bsico 4 Mark y Sue Malone Notas de la.pdf
Escenarios Escenario bsico 4 Mark y Sue Malone Notas de la.pdfEscenarios Escenario bsico 4 Mark y Sue Malone Notas de la.pdf
Escenarios Escenario bsico 4 Mark y Sue Malone Notas de la.pdfacecomputertcr
 
Find the mixed strategy Nash equilibrium of this game In it.pdf
Find the mixed strategy Nash equilibrium of this game In it.pdfFind the mixed strategy Nash equilibrium of this game In it.pdf
Find the mixed strategy Nash equilibrium of this game In it.pdfacecomputertcr
 
In business research the relationship between the researche.pdf
In business research the relationship between the researche.pdfIn business research the relationship between the researche.pdf
In business research the relationship between the researche.pdfacecomputertcr
 
I am asked to provide the testing cases for the following co.pdf
I am asked to provide the testing cases for the following co.pdfI am asked to provide the testing cases for the following co.pdf
I am asked to provide the testing cases for the following co.pdfacecomputertcr
 

Mais de acecomputertcr (20)

Review and analyze the following RFP below at httpswwwe.pdf
Review and analyze the following RFP below at httpswwwe.pdfReview and analyze the following RFP below at httpswwwe.pdf
Review and analyze the following RFP below at httpswwwe.pdf
 
What is the worst choice of split ratio Training set Test .pdf
What is the worst choice of split ratio Training set  Test .pdfWhat is the worst choice of split ratio Training set  Test .pdf
What is the worst choice of split ratio Training set Test .pdf
 
VAKA 32 Ufuk Danmanlk Patti Smith Horizon Consultingin .pdf
VAKA 32  Ufuk Danmanlk  Patti Smith Horizon Consultingin .pdfVAKA 32  Ufuk Danmanlk  Patti Smith Horizon Consultingin .pdf
VAKA 32 Ufuk Danmanlk Patti Smith Horizon Consultingin .pdf
 
Turner Syndrome occurs when an individual inherits one X chr.pdf
Turner Syndrome occurs when an individual inherits one X chr.pdfTurner Syndrome occurs when an individual inherits one X chr.pdf
Turner Syndrome occurs when an individual inherits one X chr.pdf
 
The random variable M has PMF PMmc41m0m0123else .pdf
The random variable M has PMF PMmc41m0m0123else .pdfThe random variable M has PMF PMmc41m0m0123else .pdf
The random variable M has PMF PMmc41m0m0123else .pdf
 
Subject S1 has the clearance Secret C0C1C2C3 Which .pdf
Subject S1 has the clearance Secret C0C1C2C3 Which .pdfSubject S1 has the clearance Secret C0C1C2C3 Which .pdf
Subject S1 has the clearance Secret C0C1C2C3 Which .pdf
 
The following utility function represents Roses preference .pdf
The following utility function represents Roses preference .pdfThe following utility function represents Roses preference .pdf
The following utility function represents Roses preference .pdf
 
Nesmith Corporations outstanding bonds have a 1000 par va.pdf
Nesmith Corporations outstanding bonds have a 1000 par va.pdfNesmith Corporations outstanding bonds have a 1000 par va.pdf
Nesmith Corporations outstanding bonds have a 1000 par va.pdf
 
Given the table below assuming that there are only 9 resour.pdf
Given the table below assuming that there are only 9 resour.pdfGiven the table below assuming that there are only 9 resour.pdf
Given the table below assuming that there are only 9 resour.pdf
 
Practice Questions PV and FV Formulae YOU MAY USE A FIN.pdf
Practice Questions PV and FV   Formulae   YOU MAY USE A FIN.pdfPractice Questions PV and FV   Formulae   YOU MAY USE A FIN.pdf
Practice Questions PV and FV Formulae YOU MAY USE A FIN.pdf
 
please explain and list every step using commands from ste.pdf
please explain and list every step using commands from ste.pdfplease explain and list every step using commands from ste.pdf
please explain and list every step using commands from ste.pdf
 
Each student is required to post a response to problem CP12.pdf
Each student is required to post a response to problem CP12.pdfEach student is required to post a response to problem CP12.pdf
Each student is required to post a response to problem CP12.pdf
 
During the year the following transactions occurred Feb 1.pdf
During the year the following transactions occurred Feb 1.pdfDuring the year the following transactions occurred Feb 1.pdf
During the year the following transactions occurred Feb 1.pdf
 
Oilpartz Ltdnin sahibi Dave McDonald ceketini kard ve masa.pdf
Oilpartz Ltdnin sahibi Dave McDonald ceketini kard ve masa.pdfOilpartz Ltdnin sahibi Dave McDonald ceketini kard ve masa.pdf
Oilpartz Ltdnin sahibi Dave McDonald ceketini kard ve masa.pdf
 
Match Perverse incentives that encourage risky behavior by .pdf
Match Perverse incentives that encourage risky behavior by .pdfMatch Perverse incentives that encourage risky behavior by .pdf
Match Perverse incentives that encourage risky behavior by .pdf
 
Let E and F be two events in a sample space Which of the fo.pdf
Let E and F be two events in a sample space Which of the fo.pdfLet E and F be two events in a sample space Which of the fo.pdf
Let E and F be two events in a sample space Which of the fo.pdf
 
Escenarios Escenario bsico 4 Mark y Sue Malone Notas de la.pdf
Escenarios Escenario bsico 4 Mark y Sue Malone Notas de la.pdfEscenarios Escenario bsico 4 Mark y Sue Malone Notas de la.pdf
Escenarios Escenario bsico 4 Mark y Sue Malone Notas de la.pdf
 
Find the mixed strategy Nash equilibrium of this game In it.pdf
Find the mixed strategy Nash equilibrium of this game In it.pdfFind the mixed strategy Nash equilibrium of this game In it.pdf
Find the mixed strategy Nash equilibrium of this game In it.pdf
 
In business research the relationship between the researche.pdf
In business research the relationship between the researche.pdfIn business research the relationship between the researche.pdf
In business research the relationship between the researche.pdf
 
I am asked to provide the testing cases for the following co.pdf
I am asked to provide the testing cases for the following co.pdfI am asked to provide the testing cases for the following co.pdf
I am asked to provide the testing cases for the following co.pdf
 

Último

HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 

Último (20)

HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 

Problem statement You are tasked to write a program that re.pdf

  • 1. Problem statement: You are tasked to write a program that reads in a sentence or a paragraph (max length 1023 letters) rom the user, store it as a string, and gives the user several options for operations to perform on the text r quit. After performing an operation, the user should be prompted to select another option until they choose to quit. The program must handle all types of bad inputs from user and recover from the errors. Detailed requirements for each choice are listed below: 1. Vowels vs. Consonants: Check if the number of vowels equals the number of consonants. Ignore any nonletter characters. Example: User enters "banana"; program prints" # vowels = # consonants." Example: User enters "ban ana 44!"; program prints" # vowels = # consonants." Example: User enters "zip"; program prints "# vowels != # consonants." 2. Letter swap: prompt the user for two valid letters, create a copy of the original string, and modify the copy string by replacing all occurrences of the first letter with the second letter. Example: User enters "Off we go, into the wild blue yonder!", then characters 'o' and 'i'. Program prints: Iff we gi, inti the wild blue yinder! (Notice: capitalization is preserved) 3. Flip (reverse) the string: create a copy of the original string, and then reverse it. Example: User enters "ban ana 54!"; program creates a new string and outputs: " 45 ana nab" Example: User enters "zip"; program creates a new string and outputs: "piz" 4. Palindrome Detector: Determine whether the input string is palindrome or not. A palindrome is a word, phrase, or sequence that reads the same backwards as forward. E.g., racecar, madam. Examples of palindromes that your code needs to detect: User enters "11Radar911", program outputs "This is a palindrome." (Ignore the numbers and case of letters) User enters "top sports", program outputs "This is not a palindrome." User enters "Was it a car or a cat I saw?", program outputs "This is a palindrome." (Ignore the space and special characters, '?') 5. Words frequency: Prompt the user for N words that the user wants to search for in the input string. For this assignment, assuming N is a positive integer less than or equal to 10. Use a string array to store N words, and output the frequency of N given words in the input string. Example: User enters "This is a test sentence, is this?", then 3 words, "this", "text", and "test". The program outputs: this: 2 text: 0 test: 1 (Note: Case insensitive, meaning "word" and "WoRD" are the same; All numbers and special characters in the string are ignored, meaning "wor32rd", "wo]]]rd343.34", and "word" are the same)Suggested functions: a. bool is palindrome (string str); //return true if str is palindrome, false otherwise b. string purge_string (string str); /laccepts a string, and returns a version where all numbers, spaces, and special characters have been removed OR you may use this: void purge_string (string str, string s str_new); /laccepts two c-strings, remove all spaces and special characters in str, and store the new string into str_new For frequency of given words, the N words must be entered at one time before searching to see if the words are in the sentence/paragraph. In other words, you cannot ask for a word, search its frequency and then ask for another word. You must ask for all words before searching for the words.Implementation Requirements: - Your user interface must provide clear instructions for the user and information about the data being presented - Use of references is required. - Use of 1D array is required - Libraries allowed to use: >,< string >,< cstring >,< cstdlib >,< cmath >, , fstream > if doing extra credit 1) - Your program should be properly decomposed into tasks and subtasks using functions. To help you with this, use the following: Make each function do one thing and one thing only. - No more than 15 lines inside the curly braces of any function, including main(). Whitespace, variable declarations, single curly braces, vertical spacing, comments, and function headers do not count. -
  • 2. Functions over 15 lines need justification in comments. - Do not put multiple statements into one line. - You are encouraged to use the functions in assignment 4 to do error handling. - No global variables allowed (those declared outside of any functions, global constants are allowed). - Make sure you follow the style guidelines, have a program header and function headers with appropriate comments, and be consistent.