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
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
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

Earthworm Platformer Package( Unity Asset Store )
Earthworm Platformer Package( Unity Asset Store )Earthworm Platformer Package( Unity Asset Store )
Earthworm Platformer Package( Unity Asset Store )
Oh DongReol
 
Comp 122 lab 4 lab report and source code
Comp 122 lab 4 lab report and source codeComp 122 lab 4 lab report and source code
Comp 122 lab 4 lab report and source code
pradesigali1
 
Do you have a #bug? Your unit tests are not well planned
Do you have a #bug? Your unit tests are not well plannedDo you have a #bug? Your unit tests are not well planned
Do you have a #bug? Your unit tests are not well planned
José San Román A. de Lara
 
A simple program C# program
A simple program C# programA simple program C# program
A simple program C# program
Micheal Ogundero
 
Programing Fundamental
Programing FundamentalPrograming Fundamental
Programing Fundamental
Qazi Shahzad Ali
 
javabasics_ programming development chapter01
javabasics_ programming development chapter01javabasics_ programming development chapter01
javabasics_ programming development chapter01
Udeshg90
 
Reverse algorithm how_to_guide
Reverse algorithm how_to_guideReverse algorithm how_to_guide
Reverse algorithm how_to_guide
Lekh Raj Lalka
 
csharp repitition structures
csharp repitition structurescsharp repitition structures
csharp repitition structures
Micheal Ogundero
 
Refactoring to Testable Code
Refactoring to Testable CodeRefactoring to Testable Code
Refactoring to Testable Code
Richard Taylor
 
Code quality
Code qualityCode quality
Code quality
44ue
 
Python Programming Essentials - M37 - Brief Overview of Misc Concepts
Python Programming Essentials - M37 - Brief Overview of Misc ConceptsPython Programming Essentials - M37 - Brief Overview of Misc Concepts
Python Programming Essentials - M37 - Brief Overview of Misc Concepts
P3 InfoTech Solutions Pvt. Ltd.
 
Refactoring
RefactoringRefactoring
Refactoring
Herez Moise Kattan
 
Fundamentals of programming)
Fundamentals of programming)Fundamentals of programming)
Fundamentals of programming)
jakejakejake2
 
Pseudocode
PseudocodePseudocode
Pseudocode
Harsha Madushanka
 

What's hot (16)

Earthworm Platformer Package( Unity Asset Store )
Earthworm Platformer Package( Unity Asset Store )Earthworm Platformer Package( Unity Asset Store )
Earthworm Platformer Package( Unity Asset Store )
 
Comp 122 lab 4 lab report and source code
Comp 122 lab 4 lab report and source codeComp 122 lab 4 lab report and source code
Comp 122 lab 4 lab report and source code
 
Review of an open source unit test tool- Cucumber_Presentation
Review of an open source unit test tool- Cucumber_PresentationReview of an open source unit test tool- Cucumber_Presentation
Review of an open source unit test tool- Cucumber_Presentation
 
Do you have a #bug? Your unit tests are not well planned
Do you have a #bug? Your unit tests are not well plannedDo you have a #bug? Your unit tests are not well planned
Do you have a #bug? Your unit tests are not well planned
 
A simple program C# program
A simple program C# programA simple program C# program
A simple program C# program
 
Programing Fundamental
Programing FundamentalPrograming Fundamental
Programing Fundamental
 
javabasics_ programming development chapter01
javabasics_ programming development chapter01javabasics_ programming development chapter01
javabasics_ programming development chapter01
 
Reverse algorithm how_to_guide
Reverse algorithm how_to_guideReverse algorithm how_to_guide
Reverse algorithm how_to_guide
 
csharp repitition structures
csharp repitition structurescsharp repitition structures
csharp repitition structures
 
Refactoring to Testable Code
Refactoring to Testable CodeRefactoring to Testable Code
Refactoring to Testable Code
 
Code quality
Code qualityCode quality
Code quality
 
Ppt lesson 06
Ppt lesson 06Ppt lesson 06
Ppt lesson 06
 
Python Programming Essentials - M37 - Brief Overview of Misc Concepts
Python Programming Essentials - M37 - Brief Overview of Misc ConceptsPython Programming Essentials - M37 - Brief Overview of Misc Concepts
Python Programming Essentials - M37 - Brief Overview of Misc Concepts
 
Refactoring
RefactoringRefactoring
Refactoring
 
Fundamentals of programming)
Fundamentals of programming)Fundamentals of programming)
Fundamentals of programming)
 
Pseudocode
PseudocodePseudocode
Pseudocode
 

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

Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
cskvsmi44
 
ADLAB.pdf
ADLAB.pdfADLAB.pdf
ADLAB.pdf
ycpthalachira
 
CIS 170 Focus Dreams/newtonhelp.com
CIS 170 Focus Dreams/newtonhelp.comCIS 170 Focus Dreams/newtonhelp.com
CIS 170 Focus Dreams/newtonhelp.com
bellflower82
 
CIS 170 Life of the Mind/newtonhelp.com   
CIS 170 Life of the Mind/newtonhelp.com   CIS 170 Life of the Mind/newtonhelp.com   
CIS 170 Life of the Mind/newtonhelp.com   
llflowe
 
CIS 170 Imagine Your Future/newtonhelp.com   
CIS 170 Imagine Your Future/newtonhelp.com   CIS 170 Imagine Your Future/newtonhelp.com   
CIS 170 Imagine Your Future/newtonhelp.com   
bellflower42
 
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docxCOMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
donnajames55
 
Cis 170 Extraordinary Success/newtonhelp.com
Cis 170 Extraordinary Success/newtonhelp.com  Cis 170 Extraordinary Success/newtonhelp.com
Cis 170 Extraordinary Success/newtonhelp.com
amaranthbeg143
 
CIS 170 Effective Communication - tutorialrank.com
CIS 170 Effective Communication - tutorialrank.comCIS 170 Effective Communication - tutorialrank.com
CIS 170 Effective Communication - tutorialrank.com
Bartholomew19
 
Devry cis-170-c-i lab-1-of-7-getting-started
Devry cis-170-c-i lab-1-of-7-getting-startedDevry cis-170-c-i lab-1-of-7-getting-started
Devry cis-170-c-i lab-1-of-7-getting-started
govendaagoovenda
 
Devry cis-170-c-i lab-1-of-7-getting-started
Devry cis-170-c-i lab-1-of-7-getting-startedDevry cis-170-c-i lab-1-of-7-getting-started
Devry cis-170-c-i lab-1-of-7-getting-started
noahjamessss
 
CIS 170 Inspiring Innovation/tutorialrank.com
 CIS 170 Inspiring Innovation/tutorialrank.com CIS 170 Inspiring Innovation/tutorialrank.com
CIS 170 Inspiring Innovation/tutorialrank.com
jonhson110
 
Cis 170 ilab 1 of 7
Cis 170 ilab 1 of 7Cis 170 ilab 1 of 7
Cis 170 ilab 1 of 7comp274
 
PT1420 Decision Structures in Pseudocode and Visual Basic .docx
PT1420 Decision Structures in Pseudocode and Visual Basic .docxPT1420 Decision Structures in Pseudocode and Visual Basic .docx
PT1420 Decision Structures in Pseudocode and Visual Basic .docx
amrit47
 
Cmis 102 Success Begins / snaptutorial.com
Cmis 102 Success Begins / snaptutorial.comCmis 102 Success Begins / snaptutorial.com
Cmis 102 Success Begins / snaptutorial.com
WilliamsTaylorza48
 
Gsp 215 Believe Possibilities / snaptutorial.com
Gsp 215  Believe Possibilities / snaptutorial.comGsp 215  Believe Possibilities / snaptutorial.com
Gsp 215 Believe Possibilities / snaptutorial.com
StokesCope20
 
Devry cis-170-c-i lab-6-of-7-menu
Devry cis-170-c-i lab-6-of-7-menuDevry cis-170-c-i lab-6-of-7-menu
Devry cis-170-c-i lab-6-of-7-menu
noahjamessss
 
Devry cis-170-c-i lab-6-of-7-menu
Devry cis-170-c-i lab-6-of-7-menuDevry cis-170-c-i lab-6-of-7-menu
Devry cis-170-c-i lab-6-of-7-menu
cskvsmi44
 
Gsp 215 Effective Communication / snaptutorial.com
Gsp 215  Effective Communication / snaptutorial.comGsp 215  Effective Communication / snaptutorial.com
Gsp 215 Effective Communication / snaptutorial.com
HarrisGeorg21
 
Cis 170 i lab 1 of 7
Cis 170 i lab 1 of 7Cis 170 i lab 1 of 7
Cis 170 i lab 1 of 7helpido9
 
Gsp 215 Enhance teaching-snaptutorial.com
Gsp 215 Enhance teaching-snaptutorial.comGsp 215 Enhance teaching-snaptutorial.com
Gsp 215 Enhance teaching-snaptutorial.com
robertleew18
 

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

Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
 
ADLAB.pdf
ADLAB.pdfADLAB.pdf
ADLAB.pdf
 
CIS 170 Focus Dreams/newtonhelp.com
CIS 170 Focus Dreams/newtonhelp.comCIS 170 Focus Dreams/newtonhelp.com
CIS 170 Focus Dreams/newtonhelp.com
 
CIS 170 Life of the Mind/newtonhelp.com   
CIS 170 Life of the Mind/newtonhelp.com   CIS 170 Life of the Mind/newtonhelp.com   
CIS 170 Life of the Mind/newtonhelp.com   
 
CIS 170 Imagine Your Future/newtonhelp.com   
CIS 170 Imagine Your Future/newtonhelp.com   CIS 170 Imagine Your Future/newtonhelp.com   
CIS 170 Imagine Your Future/newtonhelp.com   
 
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docxCOMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docx
 
Cis 170 Extraordinary Success/newtonhelp.com
Cis 170 Extraordinary Success/newtonhelp.com  Cis 170 Extraordinary Success/newtonhelp.com
Cis 170 Extraordinary Success/newtonhelp.com
 
CIS 170 Effective Communication - tutorialrank.com
CIS 170 Effective Communication - tutorialrank.comCIS 170 Effective Communication - tutorialrank.com
CIS 170 Effective Communication - tutorialrank.com
 
Devry cis-170-c-i lab-1-of-7-getting-started
Devry cis-170-c-i lab-1-of-7-getting-startedDevry cis-170-c-i lab-1-of-7-getting-started
Devry cis-170-c-i lab-1-of-7-getting-started
 
Devry cis-170-c-i lab-1-of-7-getting-started
Devry cis-170-c-i lab-1-of-7-getting-startedDevry cis-170-c-i lab-1-of-7-getting-started
Devry cis-170-c-i lab-1-of-7-getting-started
 
CIS 170 Inspiring Innovation/tutorialrank.com
 CIS 170 Inspiring Innovation/tutorialrank.com CIS 170 Inspiring Innovation/tutorialrank.com
CIS 170 Inspiring Innovation/tutorialrank.com
 
Cis 170 ilab 1 of 7
Cis 170 ilab 1 of 7Cis 170 ilab 1 of 7
Cis 170 ilab 1 of 7
 
PT1420 Decision Structures in Pseudocode and Visual Basic .docx
PT1420 Decision Structures in Pseudocode and Visual Basic .docxPT1420 Decision Structures in Pseudocode and Visual Basic .docx
PT1420 Decision Structures in Pseudocode and Visual Basic .docx
 
Cmis 102 Success Begins / snaptutorial.com
Cmis 102 Success Begins / snaptutorial.comCmis 102 Success Begins / snaptutorial.com
Cmis 102 Success Begins / snaptutorial.com
 
Gsp 215 Believe Possibilities / snaptutorial.com
Gsp 215  Believe Possibilities / snaptutorial.comGsp 215  Believe Possibilities / snaptutorial.com
Gsp 215 Believe Possibilities / snaptutorial.com
 
Devry cis-170-c-i lab-6-of-7-menu
Devry cis-170-c-i lab-6-of-7-menuDevry cis-170-c-i lab-6-of-7-menu
Devry cis-170-c-i lab-6-of-7-menu
 
Devry cis-170-c-i lab-6-of-7-menu
Devry cis-170-c-i lab-6-of-7-menuDevry cis-170-c-i lab-6-of-7-menu
Devry cis-170-c-i lab-6-of-7-menu
 
Gsp 215 Effective Communication / snaptutorial.com
Gsp 215  Effective Communication / snaptutorial.comGsp 215  Effective Communication / snaptutorial.com
Gsp 215 Effective Communication / snaptutorial.com
 
Cis 170 i lab 1 of 7
Cis 170 i lab 1 of 7Cis 170 i lab 1 of 7
Cis 170 i lab 1 of 7
 
Gsp 215 Enhance teaching-snaptutorial.com
Gsp 215 Enhance teaching-snaptutorial.comGsp 215 Enhance teaching-snaptutorial.com
Gsp 215 Enhance teaching-snaptutorial.com
 

More from shyaminfo04

Uop cmgt-433-week-4-team-red-team
Uop cmgt-433-week-4-team-red-teamUop cmgt-433-week-4-team-red-team
Uop cmgt-433-week-4-team-red-team
shyaminfo04
 
Uop cmgt-433-week-2-team-red-team
Uop cmgt-433-week-2-team-red-teamUop cmgt-433-week-2-team-red-team
Uop cmgt-433-week-2-team-red-team
shyaminfo04
 
Uop cmgt-433-week-1-individual-cyber-security -ict--legal-obligations-and-con...
Uop cmgt-433-week-1-individual-cyber-security -ict--legal-obligations-and-con...Uop cmgt-433-week-1-individual-cyber-security -ict--legal-obligations-and-con...
Uop cmgt-433-week-1-individual-cyber-security -ict--legal-obligations-and-con...
shyaminfo04
 
Cmgt 431-week-1-threat-model-new
Cmgt 431-week-1-threat-model-newCmgt 431-week-1-threat-model-new
Cmgt 431-week-1-threat-model-new
shyaminfo04
 
Cmgt 431-all-assignments-new
Cmgt 431-all-assignments-newCmgt 431-all-assignments-new
Cmgt 431-all-assignments-new
shyaminfo04
 
Cmgt 431-week-1-threat-model-new
Cmgt 431-week-1-threat-model-newCmgt 431-week-1-threat-model-new
Cmgt 431-week-1-threat-model-new
shyaminfo04
 
Ese 633 week 3 dq 2
Ese 633 week 3 dq 2Ese 633 week 3 dq 2
Ese 633 week 3 dq 2
shyaminfo04
 
Ash ese 633 week 6 dq 1
Ash ese 633 week 6 dq 1Ash ese 633 week 6 dq 1
Ash ese 633 week 6 dq 1
shyaminfo04
 
Ash ese 633 week 5 dq 1
Ash ese 633 week 5 dq 1Ash ese 633 week 5 dq 1
Ash ese 633 week 5 dq 1
shyaminfo04
 
Ash ese 633 week 5 assignment collaborative problem solving
Ash ese 633 week 5 assignment collaborative problem solvingAsh ese 633 week 5 assignment collaborative problem solving
Ash ese 633 week 5 assignment collaborative problem solving
shyaminfo04
 
Ash ese 633 week 4 dq 1
Ash ese 633 week 4 dq 1Ash ese 633 week 4 dq 1
Ash ese 633 week 4 dq 1
shyaminfo04
 
Ash ese 633 week 4 assignment helping parents promote independence
Ash ese 633 week 4 assignment helping parents promote independenceAsh ese 633 week 4 assignment helping parents promote independence
Ash ese 633 week 4 assignment helping parents promote independence
shyaminfo04
 
Ash ese 633 week 2 dq 1 non
Ash ese 633 week 2 dq 1 nonAsh ese 633 week 2 dq 1 non
Ash ese 633 week 2 dq 1 non
shyaminfo04
 
Ash eco 203 week 3 assignment efforts to reduce the budget deficit
Ash eco 203 week 3 assignment efforts to reduce the budget deficitAsh eco 203 week 3 assignment efforts to reduce the budget deficit
Ash eco 203 week 3 assignment efforts to reduce the budget deficit
shyaminfo04
 
Ash edu 675 week 6 dq 1 impact reflection new
Ash edu 675 week 6 dq 1 impact reflection newAsh edu 675 week 6 dq 1 impact reflection new
Ash edu 675 week 6 dq 1 impact reflection new
shyaminfo04
 
Devry cis 170 c i lab 3 of 7 looping
Devry cis 170 c i lab 3 of 7 loopingDevry cis 170 c i lab 3 of 7 looping
Devry cis 170 c i lab 3 of 7 looping
shyaminfo04
 
Devry cis 170 c i lab 1 of 7 getting started
Devry cis 170 c i lab 1 of 7 getting startedDevry cis 170 c i lab 1 of 7 getting started
Devry cis 170 c i lab 1 of 7 getting started
shyaminfo04
 

More from shyaminfo04 (17)

Uop cmgt-433-week-4-team-red-team
Uop cmgt-433-week-4-team-red-teamUop cmgt-433-week-4-team-red-team
Uop cmgt-433-week-4-team-red-team
 
Uop cmgt-433-week-2-team-red-team
Uop cmgt-433-week-2-team-red-teamUop cmgt-433-week-2-team-red-team
Uop cmgt-433-week-2-team-red-team
 
Uop cmgt-433-week-1-individual-cyber-security -ict--legal-obligations-and-con...
Uop cmgt-433-week-1-individual-cyber-security -ict--legal-obligations-and-con...Uop cmgt-433-week-1-individual-cyber-security -ict--legal-obligations-and-con...
Uop cmgt-433-week-1-individual-cyber-security -ict--legal-obligations-and-con...
 
Cmgt 431-week-1-threat-model-new
Cmgt 431-week-1-threat-model-newCmgt 431-week-1-threat-model-new
Cmgt 431-week-1-threat-model-new
 
Cmgt 431-all-assignments-new
Cmgt 431-all-assignments-newCmgt 431-all-assignments-new
Cmgt 431-all-assignments-new
 
Cmgt 431-week-1-threat-model-new
Cmgt 431-week-1-threat-model-newCmgt 431-week-1-threat-model-new
Cmgt 431-week-1-threat-model-new
 
Ese 633 week 3 dq 2
Ese 633 week 3 dq 2Ese 633 week 3 dq 2
Ese 633 week 3 dq 2
 
Ash ese 633 week 6 dq 1
Ash ese 633 week 6 dq 1Ash ese 633 week 6 dq 1
Ash ese 633 week 6 dq 1
 
Ash ese 633 week 5 dq 1
Ash ese 633 week 5 dq 1Ash ese 633 week 5 dq 1
Ash ese 633 week 5 dq 1
 
Ash ese 633 week 5 assignment collaborative problem solving
Ash ese 633 week 5 assignment collaborative problem solvingAsh ese 633 week 5 assignment collaborative problem solving
Ash ese 633 week 5 assignment collaborative problem solving
 
Ash ese 633 week 4 dq 1
Ash ese 633 week 4 dq 1Ash ese 633 week 4 dq 1
Ash ese 633 week 4 dq 1
 
Ash ese 633 week 4 assignment helping parents promote independence
Ash ese 633 week 4 assignment helping parents promote independenceAsh ese 633 week 4 assignment helping parents promote independence
Ash ese 633 week 4 assignment helping parents promote independence
 
Ash ese 633 week 2 dq 1 non
Ash ese 633 week 2 dq 1 nonAsh ese 633 week 2 dq 1 non
Ash ese 633 week 2 dq 1 non
 
Ash eco 203 week 3 assignment efforts to reduce the budget deficit
Ash eco 203 week 3 assignment efforts to reduce the budget deficitAsh eco 203 week 3 assignment efforts to reduce the budget deficit
Ash eco 203 week 3 assignment efforts to reduce the budget deficit
 
Ash edu 675 week 6 dq 1 impact reflection new
Ash edu 675 week 6 dq 1 impact reflection newAsh edu 675 week 6 dq 1 impact reflection new
Ash edu 675 week 6 dq 1 impact reflection new
 
Devry cis 170 c i lab 3 of 7 looping
Devry cis 170 c i lab 3 of 7 loopingDevry cis 170 c i lab 3 of 7 looping
Devry cis 170 c i lab 3 of 7 looping
 
Devry cis 170 c i lab 1 of 7 getting started
Devry cis 170 c i lab 1 of 7 getting startedDevry cis 170 c i lab 1 of 7 getting started
Devry cis 170 c i lab 1 of 7 getting started
 

Recently uploaded

How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 

Recently uploaded (20)

How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 

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 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
  • 2. 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
  • 3. 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.”
  • 4. 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.
  • 5. 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
  • 6. 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