SlideShare a Scribd company logo
DEVRY CIS 170 C iLab 5 of 7 Arrays and Strings
Check this A+ tutorial guideline at
http://www.cis170entirecourse.com/cis-170/cis-
170-c-ilab-5-of-7-arrays-and-strings
For more classes visit
http://www.cis170entirecourse.com
www.cisl70entirecourse.com
CIS 170 C iLab 5 of 7 Arrays and Strings
Lab # CIS CIS170C-A5 Lab 5 of 7: Arrays and
Strings Lab Overview - Scenario/Summary You
will code, build, and execute two programs
requiring arrays and strings.
First program (Video Game Player Program):
Determine the average score for a group of
players and then determine who scored below
average.
Second program (Pig Latin): Convert words in a
phrase to pig latin.
Learning outcomes:
Be able to explain the need for arrays in a
program. Be able to determine the appropriate
array data type to use in a given program. Be
able to write a program that implements arrays.
Be able to explain the way memory is allocated
for arrays in a program. Be able to explain the
fact that arrays are objects in C++. Be able to
write a program that implements
strings.Deliverables
Section
Deliverable
www.cisl70eP
™*
Step 5: Program Listing and Output
20
Part B
Step 5: Program Listing and Output
25
Lab Steps Preparation:
If you are using the Citrix remote lab, follow the
login instructions located on the iLab tab in
Course
Home.
Locate the Visual Studio 2010 icon and launch
the
application.
Lab:
Part A: Video Game Player Program Step 1:
Requirements Write a program to do the
following:
In main, declare a PlayerName Array and a Score
Array. Declare the size of the arrays to be 100.
In the InputData function, input the player name
and score into the arrays for an unknown number
of players up to 100.
In the DisplayPlayerData function, display the
name and score of each player. Numberofplayers
In the CalculateAverageScore function, calculate
^^the average score and return it by value.
p y
In the DisplayBelowAverage function, display the
name and score for any player who scored below
the average. Do not use global variables. Number
of players Output from Program:
Enter Player Name (Q to quit): Bob Enter score for
Bob: 3245 Enter Player Name (Q to quit): Sue
Enter score for Sue: 1098 Enter Player Name (Q to
quit): Dave Enter score for Dave: 8219 Enter
Player Name (Q to quit): Pat
Enter score for Pat: 3217 Enter
Player Name (Q to quit): Q
Name Score Bob 3245 Sue 1098
Dave 8219 Pat 3217
Average Score: 3944.75 Players who scored below
average Name Score Bob 3245 Sue 1098 Pat 3217
www. cPr
?f any
p
key to cont
inu
e ■ ■ ■
Step 2: Processing Logic
Using the pseudocode below, write the code that
will meet the requirements.
Main Function
Declare the player name and score arrays, number
of players, and average score.
Call the InputData function Call the
DisplayPlayerData function Call the
CalculateAverageScore function and assign the
returned value in average score Call the
DisplayBelowAverage function InputData function
While the number of players is less than the length
of the array
Prompt for the player's name If the user entered
Q, break out of the loop Prompt the user for the
player's score Add 1 to the number of players End-
While
DisplayPlayerData function Display the name and
score of each player CalculateAverageScore
function Add up the scores and divide by the
number of scores to calculate the average score
Display the average score W W WRetu™ the
average score to main DisplayBelowAverage
function Display the names and scores of all
players who scored below the average score Step
3: Create a New Project Create a new project and
name it LAB5A. Write your code using the
Processing Logic in Part A, Step 2. Make sure you
save your program.
Step 4: Compile and Execute a) Compile your
program. Eliminate all syntax
errors.
b) Build your program and verify the results of the
program. Make corrections to the program logic if
necessary until the results of the program
execution are what you expect.
Step 5: Print Screen Shots and Program Capture a
screen print of your output. (Do a PRINT SCREEN
and paste into an MS Word document.) Copy your
code and paste it into the same MS Word
document that contains the screen print of your
output. Save the Word document as
Lab05A_LastName_FirstInitial.
END OF PART A Part B: Pig Latin Step 1:
Requirements
Write a program that will input a phrase and
convert it to pig latin. Put each word in a separate
element of a string array. Remove the first letter
from each word and concatenate it to the end of
the word followed by “ay.”
Sample Output from Program: *-T-*
**
* You will be prompted to enter a string of *
* words. The string will be converted into *
* Pig Latin and the results displayed. *
* Enter as many strings as you would like. **-T-* *-!-» «-!-» «-!-» ^T-* «-!-» «-!-» ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-*
^T-* *-!-*
5fC5f«5i<
Enter a group of words or ENTER to quit: Computer
Programming is fun to learn! Original words:
Computer Programming is fun to
learn!
New Words:
omputercayogrammingprayiswayunfayotayearnla
y!
Enter a group of words or ENTER to quit: Quit
Pig Latin Hint:
If a word begins with one or more consonants,
move the consonant or consonant cluster to the
end of the word. Add the letters "ay" to the end of
the word. So, "pig" would be "igpay," and “latin”
WWW.CI
Using the pseudocode below, write the code that
will meet the requirements.
Main function Display the heading While the
condition is true Prompt the user for group of
words or Enter to
quit
Display original words Call function
pigLatinString( )
End while
pigLatinString( ) function
Declare and initialize string variables len, counter,
start, begin, word and newString While condition
is true Call find() and pass a space and start as
parameters and return the returned value
to start
if start equals to string::npos jump outside the
loop permanently call substr() function display
the word update newString increment start by one
assign start to begin
www.cisl7CEn
1
d
s
Whil
'!
0
Update newString Return newString Step 3: Create
a New Project Create a new project and name it
LAB5B. Write your code using the Processing Logic
in Part B, Step 2. Make sure you save your
program.
Step 4: Compile and Execute a) Compile your
program. Eliminate all syntax
errors.
b) Build your program and verify the results of the
program. Make corrections to the program logic if
necessary until the results of the program
execution are what you expect.
Step 5: Print Screen Shots and Program Capture a
screen print of your output. (Do a PRINT SCREEN
and paste into an MS Word document.) Copy your
code and paste it into the same MS Word
document that contains the screen print of your
output. Save the Word document as
Lab05B_LastName_FirstInitial.
END OF LAB
www.cisl70entirecourse.com
necessary until the results of the program
execution are what you expect.
Step 5: Print Screen Shots and Program Capture a
screen print of your output. (Do a PRINT SCREEN
and paste into an MS Word document.) Copy your
code and paste it into the same MS Word
document that contains the screen print of your
output. Save the Word document as
Lab05B_LastName_FirstInitial.
END OF LAB
www.cisl70entirecourse.com

More Related Content

DOC
Devry cis 170 c i lab 5 of 7 arrays and strings
shyaminfo04
 
DOC
Cis 170 c ilab 5 of 7 arrays and strings
CIS321
 
PDF
Devry cis 170 c i lab 5 of 7 arrays and strings
jody zoll
 
PDF
A simple program C# program
Micheal Ogundero
 
PDF
DIG1108 Lesson 8
vc-dig1108-fall-2013
 
PDF
csharp repitition structures
Micheal Ogundero
 
DOC
Md university cmis 102 week 4 hands on lab new
eyavagal
 
DOC
Md university cmis 102 week 4 hands on lab new
scottbrownnn
 
Devry cis 170 c i lab 5 of 7 arrays and strings
shyaminfo04
 
Cis 170 c ilab 5 of 7 arrays and strings
CIS321
 
Devry cis 170 c i lab 5 of 7 arrays and strings
jody zoll
 
A simple program C# program
Micheal Ogundero
 
DIG1108 Lesson 8
vc-dig1108-fall-2013
 
csharp repitition structures
Micheal Ogundero
 
Md university cmis 102 week 4 hands on lab new
eyavagal
 
Md university cmis 102 week 4 hands on lab new
scottbrownnn
 

What's hot (18)

PPTX
Presentatie .NET 4/VS2010
Niels Vrolijk
 
PDF
Session 5-exersice
Keroles karam khalil
 
PDF
Introduction to goodenuffR
MartinFrigaard
 
PDF
selection structures
Micheal Ogundero
 
PDF
escape sequences and substitution markers
Micheal Ogundero
 
PPTX
Infix-Postfix expression conversion
Rashmiranja625
 
PPTX
Introduction to SkyPat 2.0
Little Sky
 
PPT
05 control structures 2
Jomel Penalba
 
PPTX
My first program in c, hello world !
Rumman Ansari
 
PDF
[Question Paper] ASP.NET With C# (75:25 Pattern) [April / 2015]
Mumbai B.Sc.IT Study
 
PPT
Infix to Postfix Conversion Using Stack
Soumen Santra
 
PPTX
Infix postfixcoversion
Pdr Patnaik
 
DOCX
COMP 122 Entire Course NEW
shyamuopeight
 
PPTX
Python Programming Essentials - M28 - Debugging with pdb
P3 InfoTech Solutions Pvt. Ltd.
 
PDF
Metaprogramming
Mehmet Emin İNAÇ
 
PPT
Preprocessor in C
Prabhu Govind
 
PPTX
C program to write c program without using main function
Rumman Ansari
 
PDF
Lecture 1
Jehangir Khan
 
Presentatie .NET 4/VS2010
Niels Vrolijk
 
Session 5-exersice
Keroles karam khalil
 
Introduction to goodenuffR
MartinFrigaard
 
selection structures
Micheal Ogundero
 
escape sequences and substitution markers
Micheal Ogundero
 
Infix-Postfix expression conversion
Rashmiranja625
 
Introduction to SkyPat 2.0
Little Sky
 
05 control structures 2
Jomel Penalba
 
My first program in c, hello world !
Rumman Ansari
 
[Question Paper] ASP.NET With C# (75:25 Pattern) [April / 2015]
Mumbai B.Sc.IT Study
 
Infix to Postfix Conversion Using Stack
Soumen Santra
 
Infix postfixcoversion
Pdr Patnaik
 
COMP 122 Entire Course NEW
shyamuopeight
 
Python Programming Essentials - M28 - Debugging with pdb
P3 InfoTech Solutions Pvt. Ltd.
 
Metaprogramming
Mehmet Emin İNAÇ
 
Preprocessor in C
Prabhu Govind
 
C program to write c program without using main function
Rumman Ansari
 
Lecture 1
Jehangir Khan
 
Ad

Similar to Devry cis-170-c-i lab-5-of-7-arrays-and-strings (20)

DOC
Devry cis 170 c i lab 5 of 7 arrays and strings
ash52393
 
DOCX
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
donnajames55
 
DOCX
Gsp 215 Effective Communication / snaptutorial.com
HarrisGeorg21
 
DOC
Gsp 215 Believe Possibilities / snaptutorial.com
StokesCope20
 
PDF
ADLAB.pdf
ycpthalachira
 
DOC
Gsp 215 Enhance teaching-snaptutorial.com
robertleew18
 
DOC
GSP 215 Technology levels--snaptutorial.com
sholingarjosh136
 
DOC
Gsp 215 Massive Success / snaptutorial.com
NorrisMistryzo
 
DOC
Gsp 215 Enthusiastic Study / snaptutorial.com
Stephenson101
 
DOCX
GSP 215 RANK Education Counseling -- gsp215rank.com
kopiko85
 
DOCX
GSP 215 RANK Lessons in Excellence-- gsp215rank.com
RoelofMerwe102
 
DOCX
GSP 215 RANK Education Your Life--gsp215rank.com
thomashard64
 
DOCX
GSP 215 RANK Inspiring Innovation--gsp215rank.com
KeatonJennings102
 
DOCX
GSP 215 Education Organization - snaptutorial.com
donaldzs192
 
PPT
Devry cis-170-c-i lab-1-of-7-getting-started
noahjamessss
 
PPT
Devry cis-170-c-i lab-1-of-7-getting-started
govendaagoovenda
 
DOC
Gsp 215 Exceptional Education / snaptutorial.com
Baileya55
 
DOCX
Cmis 102 Effective Communication / snaptutorial.com
HarrisGeorg12
 
PDF
GSP 215 RANK Introduction Education--gsp215rank.com
agathachristie281
 
PDF
GSP 215 RANK Education Counseling--gsp215rank.com
williamwordsworth40
 
Devry cis 170 c i lab 5 of 7 arrays and strings
ash52393
 
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
donnajames55
 
Gsp 215 Effective Communication / snaptutorial.com
HarrisGeorg21
 
Gsp 215 Believe Possibilities / snaptutorial.com
StokesCope20
 
ADLAB.pdf
ycpthalachira
 
Gsp 215 Enhance teaching-snaptutorial.com
robertleew18
 
GSP 215 Technology levels--snaptutorial.com
sholingarjosh136
 
Gsp 215 Massive Success / snaptutorial.com
NorrisMistryzo
 
Gsp 215 Enthusiastic Study / snaptutorial.com
Stephenson101
 
GSP 215 RANK Education Counseling -- gsp215rank.com
kopiko85
 
GSP 215 RANK Lessons in Excellence-- gsp215rank.com
RoelofMerwe102
 
GSP 215 RANK Education Your Life--gsp215rank.com
thomashard64
 
GSP 215 RANK Inspiring Innovation--gsp215rank.com
KeatonJennings102
 
GSP 215 Education Organization - snaptutorial.com
donaldzs192
 
Devry cis-170-c-i lab-1-of-7-getting-started
noahjamessss
 
Devry cis-170-c-i lab-1-of-7-getting-started
govendaagoovenda
 
Gsp 215 Exceptional Education / snaptutorial.com
Baileya55
 
Cmis 102 Effective Communication / snaptutorial.com
HarrisGeorg12
 
GSP 215 RANK Introduction Education--gsp215rank.com
agathachristie281
 
GSP 215 RANK Education Counseling--gsp215rank.com
williamwordsworth40
 
Ad

More from cskvsmi44 (13)

PPT
Cmgt 410-week-3-dq-2
cskvsmi44
 
PPT
Cmgt 410-week-1-dq-1
cskvsmi44
 
PPT
Strayer cis-273-week-7-lab-assignment-7-form-page-new
cskvsmi44
 
PPT
Strayer cis-273-week-6-lab-assignment-6-working-with-tables-new
cskvsmi44
 
PPT
Strayer cis-273-week-4-lab-assignment-5
cskvsmi44
 
PPT
Strayer cis-273-week-3-lab-assignment-4-nested-lists-and-cascading-style-shee...
cskvsmi44
 
PPT
Strayer cis-273-week-3-lab-assignment-3-storyboarding-new
cskvsmi44
 
PPT
Strayer cis-273-week-2-lab-assignment-2-three-web-pages-with-hyperlinks-new
cskvsmi44
 
PPT
Strayer cis-273-week-2-lab-assignment-1-beginning-html-new
cskvsmi44
 
PPT
Uop cis-207-week-3-individual-mobile-ordering-system-summary-new
cskvsmi44
 
PPT
Uop cis-207-week-1-individual-data
cskvsmi44
 
PPT
Devry cis-170-c-i lab-7-of-7-sequential-files
cskvsmi44
 
PPT
Devry cis-170-c-i lab-6-of-7-menu
cskvsmi44
 
Cmgt 410-week-3-dq-2
cskvsmi44
 
Cmgt 410-week-1-dq-1
cskvsmi44
 
Strayer cis-273-week-7-lab-assignment-7-form-page-new
cskvsmi44
 
Strayer cis-273-week-6-lab-assignment-6-working-with-tables-new
cskvsmi44
 
Strayer cis-273-week-4-lab-assignment-5
cskvsmi44
 
Strayer cis-273-week-3-lab-assignment-4-nested-lists-and-cascading-style-shee...
cskvsmi44
 
Strayer cis-273-week-3-lab-assignment-3-storyboarding-new
cskvsmi44
 
Strayer cis-273-week-2-lab-assignment-2-three-web-pages-with-hyperlinks-new
cskvsmi44
 
Strayer cis-273-week-2-lab-assignment-1-beginning-html-new
cskvsmi44
 
Uop cis-207-week-3-individual-mobile-ordering-system-summary-new
cskvsmi44
 
Uop cis-207-week-1-individual-data
cskvsmi44
 
Devry cis-170-c-i lab-7-of-7-sequential-files
cskvsmi44
 
Devry cis-170-c-i lab-6-of-7-menu
cskvsmi44
 

Recently uploaded (20)

PPTX
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
PPTX
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
PPTX
Virus sequence retrieval from NCBI database
yamunaK13
 
PPTX
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
PDF
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PDF
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
DOCX
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
DOCX
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
PDF
Virat Kohli- the Pride of Indian cricket
kushpar147
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PPTX
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
PPTX
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
PPTX
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
PPTX
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
PPTX
How to Apply for a Job From Odoo 18 Website
Celine George
 
PPTX
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
PPTX
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
Virus sequence retrieval from NCBI database
yamunaK13
 
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
Virat Kohli- the Pride of Indian cricket
kushpar147
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
How to Apply for a Job From Odoo 18 Website
Celine George
 
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 

Devry cis-170-c-i lab-5-of-7-arrays-and-strings

  • 1. DEVRY CIS 170 C iLab 5 of 7 Arrays and Strings Check this A+ tutorial guideline at http://www.cis170entirecourse.com/cis-170/cis- 170-c-ilab-5-of-7-arrays-and-strings For more classes visit http://www.cis170entirecourse.com www.cisl70entirecourse.com CIS 170 C iLab 5 of 7 Arrays and Strings Lab # CIS CIS170C-A5 Lab 5 of 7: Arrays and Strings Lab Overview - Scenario/Summary You will code, build, and execute two programs requiring arrays and strings. First program (Video Game Player Program): Determine the average score for a group of players and then determine who scored below average.
  • 2. Second program (Pig Latin): Convert words in a phrase to pig latin. Learning outcomes: Be able to explain the need for arrays in a program. Be able to determine the appropriate array data type to use in a given program. Be able to write a program that implements arrays. Be able to explain the way memory is allocated for arrays in a program. Be able to explain the fact that arrays are objects in C++. Be able to write a program that implements strings.Deliverables Section Deliverable www.cisl70eP ™* Step 5: Program Listing and Output 20 Part B Step 5: Program Listing and Output 25 Lab Steps Preparation: If you are using the Citrix remote lab, follow the login instructions located on the iLab tab in Course Home. Locate the Visual Studio 2010 icon and launch the application.
  • 3. Lab: Part A: Video Game Player Program Step 1: Requirements Write a program to do the following: In main, declare a PlayerName Array and a Score Array. Declare the size of the arrays to be 100. In the InputData function, input the player name and score into the arrays for an unknown number of players up to 100. In the DisplayPlayerData function, display the name and score of each player. Numberofplayers In the CalculateAverageScore function, calculate ^^the average score and return it by value. p y In the DisplayBelowAverage function, display the name and score for any player who scored below the average. Do not use global variables. Number of players Output from Program: Enter Player Name (Q to quit): Bob Enter score for Bob: 3245 Enter Player Name (Q to quit): Sue Enter score for Sue: 1098 Enter Player Name (Q to quit): Dave Enter score for Dave: 8219 Enter Player Name (Q to quit): Pat
  • 4. Enter score for Pat: 3217 Enter Player Name (Q to quit): Q Name Score Bob 3245 Sue 1098 Dave 8219 Pat 3217 Average Score: 3944.75 Players who scored below average Name Score Bob 3245 Sue 1098 Pat 3217 www. cPr ?f any p key to cont inu e ■ ■ ■ Step 2: Processing Logic Using the pseudocode below, write the code that will meet the requirements. Main Function Declare the player name and score arrays, number of players, and average score. Call the InputData function Call the DisplayPlayerData function Call the CalculateAverageScore function and assign the returned value in average score Call the DisplayBelowAverage function InputData function
  • 5. While the number of players is less than the length of the array Prompt for the player's name If the user entered Q, break out of the loop Prompt the user for the player's score Add 1 to the number of players End- While DisplayPlayerData function Display the name and score of each player CalculateAverageScore function Add up the scores and divide by the number of scores to calculate the average score Display the average score W W WRetu™ the average score to main DisplayBelowAverage function Display the names and scores of all players who scored below the average score Step 3: Create a New Project Create a new project and name it LAB5A. Write your code using the Processing Logic in Part A, Step 2. Make sure you save your program. Step 4: Compile and Execute a) Compile your program. Eliminate all syntax errors. b) Build your program and verify the results of the program. Make corrections to the program logic if
  • 6. necessary until the results of the program execution are what you expect. Step 5: Print Screen Shots and Program Capture a screen print of your output. (Do a PRINT SCREEN and paste into an MS Word document.) Copy your code and paste it into the same MS Word document that contains the screen print of your output. Save the Word document as Lab05A_LastName_FirstInitial. END OF PART A Part B: Pig Latin Step 1: Requirements Write a program that will input a phrase and convert it to pig latin. Put each word in a separate element of a string array. Remove the first letter from each word and concatenate it to the end of the word followed by “ay.” Sample Output from Program: *-T-* ** * You will be prompted to enter a string of * * words. The string will be converted into * * Pig Latin and the results displayed. * * Enter as many strings as you would like. **-T-* *-!-» «-!-» «-!-» ^T-* «-!-» «-!-» ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* ^T-* *-!-* 5fC5f«5i<
  • 7. Enter a group of words or ENTER to quit: Computer Programming is fun to learn! Original words: Computer Programming is fun to learn! New Words: omputercayogrammingprayiswayunfayotayearnla y! Enter a group of words or ENTER to quit: Quit Pig Latin Hint: If a word begins with one or more consonants, move the consonant or consonant cluster to the end of the word. Add the letters "ay" to the end of the word. So, "pig" would be "igpay," and “latin” WWW.CI Using the pseudocode below, write the code that will meet the requirements. Main function Display the heading While the condition is true Prompt the user for group of words or Enter to quit Display original words Call function pigLatinString( ) End while pigLatinString( ) function
  • 8. Declare and initialize string variables len, counter, start, begin, word and newString While condition is true Call find() and pass a space and start as parameters and return the returned value to start if start equals to string::npos jump outside the loop permanently call substr() function display the word update newString increment start by one assign start to begin www.cisl7CEn 1 d s Whil '! 0 Update newString Return newString Step 3: Create a New Project Create a new project and name it LAB5B. Write your code using the Processing Logic in Part B, Step 2. Make sure you save your program. Step 4: Compile and Execute a) Compile your program. Eliminate all syntax errors. b) Build your program and verify the results of the program. Make corrections to the program logic if
  • 9. necessary until the results of the program execution are what you expect. Step 5: Print Screen Shots and Program Capture a screen print of your output. (Do a PRINT SCREEN and paste into an MS Word document.) Copy your code and paste it into the same MS Word document that contains the screen print of your output. Save the Word document as Lab05B_LastName_FirstInitial. END OF LAB www.cisl70entirecourse.com
  • 10. necessary until the results of the program execution are what you expect. Step 5: Print Screen Shots and Program Capture a screen print of your output. (Do a PRINT SCREEN and paste into an MS Word document.) Copy your code and paste it into the same MS Word document that contains the screen print of your output. Save the Word document as Lab05B_LastName_FirstInitial. END OF LAB www.cisl70entirecourse.com