SlideShare uma empresa Scribd logo
1 de 6
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

Mais conteúdo relacionado

Mais procurados

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 codepradesigali1
 
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 plannedJosé San Román A. de Lara
 
A simple program C# program
A simple program C# programA simple program C# program
A simple program C# programMicheal Ogundero
 
javabasics_ programming development chapter01
javabasics_ programming development chapter01javabasics_ programming development chapter01
javabasics_ programming development chapter01Udeshg90
 
Reverse algorithm how_to_guide
Reverse algorithm how_to_guideReverse algorithm how_to_guide
Reverse algorithm how_to_guideLekh Raj Lalka
 
csharp repitition structures
csharp repitition structurescsharp repitition structures
csharp repitition structuresMicheal Ogundero
 
Refactoring to Testable Code
Refactoring to Testable CodeRefactoring to Testable Code
Refactoring to Testable CodeRichard Taylor
 
Code quality
Code qualityCode quality
Code quality44ue
 
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 ConceptsP3 InfoTech Solutions Pvt. Ltd.
 
Fundamentals of programming)
Fundamentals of programming)Fundamentals of programming)
Fundamentals of programming)jakejakejake2
 

Mais procurados (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
 

Semelhante a 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-stringscskvsmi44
 
CIS 170 Focus Dreams/newtonhelp.com
CIS 170 Focus Dreams/newtonhelp.comCIS 170 Focus Dreams/newtonhelp.com
CIS 170 Focus Dreams/newtonhelp.combellflower82
 
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.docxdonnajames55
 
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.comBartholomew19
 
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-startednoahjamessss
 
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-startedgovendaagoovenda
 
CIS 170 Inspiring Innovation/tutorialrank.com
 CIS 170 Inspiring Innovation/tutorialrank.com CIS 170 Inspiring Innovation/tutorialrank.com
CIS 170 Inspiring Innovation/tutorialrank.comjonhson110
 
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 .docxamrit47
 
Cmis 102 Success Begins / snaptutorial.com
Cmis 102 Success Begins / snaptutorial.comCmis 102 Success Begins / snaptutorial.com
Cmis 102 Success Begins / snaptutorial.comWilliamsTaylorza48
 
Gsp 215 Believe Possibilities / snaptutorial.com
Gsp 215  Believe Possibilities / snaptutorial.comGsp 215  Believe Possibilities / snaptutorial.com
Gsp 215 Believe Possibilities / snaptutorial.comStokesCope20
 
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-menunoahjamessss
 
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-menucskvsmi44
 
Gsp 215 Effective Communication / snaptutorial.com
Gsp 215  Effective Communication / snaptutorial.comGsp 215  Effective Communication / snaptutorial.com
Gsp 215 Effective Communication / snaptutorial.comHarrisGeorg21
 
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.comrobertleew18
 

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

Mais de 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-teamshyaminfo04
 
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-teamshyaminfo04
 
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-newshyaminfo04
 
Cmgt 431-all-assignments-new
Cmgt 431-all-assignments-newCmgt 431-all-assignments-new
Cmgt 431-all-assignments-newshyaminfo04
 
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-newshyaminfo04
 
Ese 633 week 3 dq 2
Ese 633 week 3 dq 2Ese 633 week 3 dq 2
Ese 633 week 3 dq 2shyaminfo04
 
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 1shyaminfo04
 
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 1shyaminfo04
 
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 solvingshyaminfo04
 
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 1shyaminfo04
 
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 independenceshyaminfo04
 
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 nonshyaminfo04
 
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 deficitshyaminfo04
 
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 newshyaminfo04
 
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 loopingshyaminfo04
 
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 startedshyaminfo04
 

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

Último

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
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
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
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationNeilDeclaro1
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactisticshameyhk98
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
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
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answersdalebeck957
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
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
 

Último (20)

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
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
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
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactistics
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
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
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answers
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
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
 

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