SlideShare a Scribd company logo
DEVRY CIS 170 C iLab 5 of 7 Arrays
and Strings
Check this A+ tutorial guideline at
http://www.homeworkrank.com/cis-
170/cis-170-c-ilab-5-of-7-arrays-and-
strings
For more classes visit
http://www.homeworkrank.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
Points
Part A
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. numberofplayers
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
Press any key to continue . . .
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
Return 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:
*****************************************************
* 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. *
******************************************************
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: omputercayogrammingprayiswayunfayotayearnlay!
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” would
be “atinlay.”
Step 2: Processing Logic
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
End While
Call substr()
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

More Related Content

What's hot (17)

PDF
Basic c# cheat sheet
Ahmed Elshal
 
PDF
Preprocessor directives
Vikash Dhal
 
PPTX
Fun with lambda expressions
Mike Melusky
 
PDF
CYB 130 RANK Achievement Education--cyb130rank.com
agathachristie198
 
PDF
CYB 130 RANK Education Begins--cyb130rank.com
agathachristie237
 
DOCX
C language function
Rajamohan Sangaramoorthy
 
PPT
Preprocessor in C
Prabhu Govind
 
PPTX
Fun with lambda expressions
Mike Melusky
 
PPT
Savitch Ch 04
Terry Yoast
 
PPTX
Introduction To Programming with Python-1
Syed Farjad Zia Zaidi
 
PDF
csharp repitition structures
Micheal Ogundero
 
DOCX
C Programming
Rumman Ansari
 
PPT
Lecture 7 Templates, Friend Classes
bunnykhan
 
PDF
[4DEV] Bartosz Sokół - Functional developer in object oriented world - how F#...
PROIDEA
 
PPT
Introduction to Procedural Programming in C++
Salahaddin University-Erbil
 
PPT
Preprocessors
Gourav Arora
 
Basic c# cheat sheet
Ahmed Elshal
 
Preprocessor directives
Vikash Dhal
 
Fun with lambda expressions
Mike Melusky
 
CYB 130 RANK Achievement Education--cyb130rank.com
agathachristie198
 
CYB 130 RANK Education Begins--cyb130rank.com
agathachristie237
 
C language function
Rajamohan Sangaramoorthy
 
Preprocessor in C
Prabhu Govind
 
Fun with lambda expressions
Mike Melusky
 
Savitch Ch 04
Terry Yoast
 
Introduction To Programming with Python-1
Syed Farjad Zia Zaidi
 
csharp repitition structures
Micheal Ogundero
 
C Programming
Rumman Ansari
 
Lecture 7 Templates, Friend Classes
bunnykhan
 
[4DEV] Bartosz Sokół - Functional developer in object oriented world - how F#...
PROIDEA
 
Introduction to Procedural Programming in C++
Salahaddin University-Erbil
 
Preprocessors
Gourav Arora
 

Viewers also liked (17)

PDF
Makalah Firkan Maulana_Dari Konfrontatif ke Kooperatif
Firkan Maulana
 
PDF
Empowering All Israelis
Jennifer R. Berman
 
PDF
STUDY OF ABSORPTION IN CARBON NANOTUBE COMPOSITES FROM 1HZ TO 40GHZ
jmicro
 
PDF
Energias eléctricas en España
lota_harrison
 
PDF
Advanced phishing the art of stealing
prj_publication
 
PDF
A BRIEF PROGRAM ROBUSTNESS SURVEY
ijseajournal
 
DOC
Theresa Resume August 2016
Theresa Rowlson
 
DOC
Farmacología en la gestación, niñez y vejez cuestionario
Álvaro Miguel Carranza Montalvo
 
PPT
Una mirada a ELRN2010 (Mayo '10)
Diego Leal
 
PPTX
Laporan Prakerin Ressa Nurapiah (Power Point)
Ressa Nurafiah
 
PPTX
Ingenieria y sociedad
Luis Gonzalez
 
ODP
Presentacion2 javier fernandez_vallejo
javier fernandez vallejo
 
PDF
Study the different
prj_publication
 
PDF
Biodiesel development from cebia pentandra seed oil
prj_publication
 
PDF
LEVERAGING CLOUD BASED BIG DATA ANALYTICS IN KNOWLEDGE MANAGEMENT FOR ENHANCE...
ijdpsjournal
 
PDF
Lattes tutorial de preenchimento
Kelly de Souza
 
DOCX
Resume
Rajkumar tiwari
 
Makalah Firkan Maulana_Dari Konfrontatif ke Kooperatif
Firkan Maulana
 
Empowering All Israelis
Jennifer R. Berman
 
STUDY OF ABSORPTION IN CARBON NANOTUBE COMPOSITES FROM 1HZ TO 40GHZ
jmicro
 
Energias eléctricas en España
lota_harrison
 
Advanced phishing the art of stealing
prj_publication
 
A BRIEF PROGRAM ROBUSTNESS SURVEY
ijseajournal
 
Theresa Resume August 2016
Theresa Rowlson
 
Farmacología en la gestación, niñez y vejez cuestionario
Álvaro Miguel Carranza Montalvo
 
Una mirada a ELRN2010 (Mayo '10)
Diego Leal
 
Laporan Prakerin Ressa Nurapiah (Power Point)
Ressa Nurafiah
 
Ingenieria y sociedad
Luis Gonzalez
 
Presentacion2 javier fernandez_vallejo
javier fernandez vallejo
 
Study the different
prj_publication
 
Biodiesel development from cebia pentandra seed oil
prj_publication
 
LEVERAGING CLOUD BASED BIG DATA ANALYTICS IN KNOWLEDGE MANAGEMENT FOR ENHANCE...
ijdpsjournal
 
Lattes tutorial de preenchimento
Kelly de Souza
 
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
 
PPT
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
cskvsmi44
 
DOCX
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
donnajames55
 
DOC
Gsp 215 Believe Possibilities / snaptutorial.com
StokesCope20
 
PPT
Devry cis-170-c-i lab-1-of-7-getting-started
govendaagoovenda
 
PPT
Devry cis-170-c-i lab-1-of-7-getting-started
noahjamessss
 
DOCX
Gsp 215 Effective Communication / snaptutorial.com
HarrisGeorg21
 
DOC
CIS 170 Focus Dreams/newtonhelp.com
bellflower82
 
PDF
ADLAB.pdf
ycpthalachira
 
DOC
Gsp 215 Enhance teaching-snaptutorial.com
robertleew18
 
DOC
Cis 247 all i labs
ccis224477
 
DOCX
GSP 215 RANK Education Counseling -- gsp215rank.com
kopiko85
 
DOC
CIS 170 Imagine Your Future/newtonhelp.com   
bellflower42
 
DOC
CIS 170 Life of the Mind/newtonhelp.com   
llflowe
 
PDF
CIS 170 Effective Communication - tutorialrank.com
Bartholomew19
 
DOCX
Cis 170 Extraordinary Success/newtonhelp.com
amaranthbeg143
 
DOCX
PT1420 Decision Structures in Pseudocode and Visual Basic .docx
amrit47
 
DOCX
GSP 215 RANK Inspiring Innovation--gsp215rank.com
KeatonJennings102
 
DOCX
GSP 215 RANK Education Your Life--gsp215rank.com
thomashard64
 
DOCX
GSP 215 RANK Lessons in Excellence-- gsp215rank.com
RoelofMerwe102
 
Devry cis 170 c i lab 5 of 7 arrays and strings
ash52393
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
cskvsmi44
 
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
donnajames55
 
Gsp 215 Believe Possibilities / snaptutorial.com
StokesCope20
 
Devry cis-170-c-i lab-1-of-7-getting-started
govendaagoovenda
 
Devry cis-170-c-i lab-1-of-7-getting-started
noahjamessss
 
Gsp 215 Effective Communication / snaptutorial.com
HarrisGeorg21
 
CIS 170 Focus Dreams/newtonhelp.com
bellflower82
 
ADLAB.pdf
ycpthalachira
 
Gsp 215 Enhance teaching-snaptutorial.com
robertleew18
 
Cis 247 all i labs
ccis224477
 
GSP 215 RANK Education Counseling -- gsp215rank.com
kopiko85
 
CIS 170 Imagine Your Future/newtonhelp.com   
bellflower42
 
CIS 170 Life of the Mind/newtonhelp.com   
llflowe
 
CIS 170 Effective Communication - tutorialrank.com
Bartholomew19
 
Cis 170 Extraordinary Success/newtonhelp.com
amaranthbeg143
 
PT1420 Decision Structures in Pseudocode and Visual Basic .docx
amrit47
 
GSP 215 RANK Inspiring Innovation--gsp215rank.com
KeatonJennings102
 
GSP 215 RANK Education Your Life--gsp215rank.com
thomashard64
 
GSP 215 RANK Lessons in Excellence-- gsp215rank.com
RoelofMerwe102
 
Ad

More from jody zoll (20)

PDF
Devry acct 216 week 6 homework a
jody zoll
 
PDF
Devry acct 216 week 2 homework
jody zoll
 
PDF
Devry acct 216 week 1 homework (v 2)
jody zoll
 
PDF
Devry acct 216 week 1 homework
jody zoll
 
PDF
Devry acct 251 final exam
jody zoll
 
PDF
Devry acct 251 project and progress report
jody zoll
 
PDF
Devry acct 251 week 3 quiz
jody zoll
 
PDF
Devry acct 251 week 6 quiz
jody zoll
 
PDF
Ash edu 644 week 1 dq 1 what it means to be at
jody zoll
 
PDF
Ash edu 644 week 2 assignment supporting families at risk
jody zoll
 
PDF
Ash edu 644 week 2 dq 2 role
jody zoll
 
PDF
Ash edu 644 week 3 assignment child maltreatment policies brochure
jody zoll
 
PDF
Ash edu 644 week 3 dq 2 tale of two cities and homelessness
jody zoll
 
PDF
Ash edu 644 week 4 assignment school
jody zoll
 
PDF
Ash edu 644 week 4 dq 2 school district and school building supports
jody zoll
 
PDF
Ash edu 644 week 4 dq 1 making a difference
jody zoll
 
PDF
Ash edu 644 week 5 assignment group at
jody zoll
 
PDF
Ash edu 644 week 6 final creating a web
jody zoll
 
PDF
Ash info 103 week 3 assignment using microsoft excel
jody zoll
 
PDF
Devry acct 550 final exam
jody zoll
 
Devry acct 216 week 6 homework a
jody zoll
 
Devry acct 216 week 2 homework
jody zoll
 
Devry acct 216 week 1 homework (v 2)
jody zoll
 
Devry acct 216 week 1 homework
jody zoll
 
Devry acct 251 final exam
jody zoll
 
Devry acct 251 project and progress report
jody zoll
 
Devry acct 251 week 3 quiz
jody zoll
 
Devry acct 251 week 6 quiz
jody zoll
 
Ash edu 644 week 1 dq 1 what it means to be at
jody zoll
 
Ash edu 644 week 2 assignment supporting families at risk
jody zoll
 
Ash edu 644 week 2 dq 2 role
jody zoll
 
Ash edu 644 week 3 assignment child maltreatment policies brochure
jody zoll
 
Ash edu 644 week 3 dq 2 tale of two cities and homelessness
jody zoll
 
Ash edu 644 week 4 assignment school
jody zoll
 
Ash edu 644 week 4 dq 2 school district and school building supports
jody zoll
 
Ash edu 644 week 4 dq 1 making a difference
jody zoll
 
Ash edu 644 week 5 assignment group at
jody zoll
 
Ash edu 644 week 6 final creating a web
jody zoll
 
Ash info 103 week 3 assignment using microsoft excel
jody zoll
 
Devry acct 550 final exam
jody zoll
 

Recently uploaded (20)

PDF
Geographical Diversity of India 100 Mcq.pdf/ 7th class new ncert /Social/Samy...
Sandeep Swamy
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
GRADE-3-PPT-EVE-2025-ENG-Q1-LESSON-1.pptx
EveOdrapngimapNarido
 
PDF
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PPTX
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PPTX
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PDF
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
Geographical Diversity of India 100 Mcq.pdf/ 7th class new ncert /Social/Samy...
Sandeep Swamy
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
GRADE-3-PPT-EVE-2025-ENG-Q1-LESSON-1.pptx
EveOdrapngimapNarido
 
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 

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.homeworkrank.com/cis- 170/cis-170-c-ilab-5-of-7-arrays-and- strings For more classes visit http://www.homeworkrank.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.
  • 2. Be able to explain the fact that arrays are objects in C++. Be able to write a program that implements strings.Deliverables Section Deliverable Points Part A 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. numberofplayers 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
  • 3. Dave 8219 Pat 3217 Average Score: 3944.75 Players who scored below average Name Score Bob 3245 Sue 1098 Pat 3217 Press any key to continue . . . 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 Return 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.
  • 4. 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: ***************************************************** * 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. * ****************************************************** 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: omputercayogrammingprayiswayunfayotayearnlay! 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” would be “atinlay.” Step 2: Processing Logic 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
  • 5. 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 End While Call substr() 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