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

More Related Content

What's hot

Presentatie .NET 4/VS2010
Presentatie .NET 4/VS2010Presentatie .NET 4/VS2010
Presentatie .NET 4/VS2010Niels Vrolijk
 
Introduction to goodenuffR
Introduction to goodenuffRIntroduction to goodenuffR
Introduction to goodenuffRMartinFrigaard
 
escape sequences and substitution markers
escape sequences and substitution markersescape sequences and substitution markers
escape sequences and substitution markersMicheal Ogundero
 
Infix-Postfix expression conversion
Infix-Postfix expression conversionInfix-Postfix expression conversion
Infix-Postfix expression conversionRashmiranja625
 
Introduction to SkyPat 2.0
Introduction to SkyPat 2.0Introduction to SkyPat 2.0
Introduction to SkyPat 2.0Little Sky
 
My first program in c, hello world !
My first program in c, hello world !My first program in c, hello world !
My first program in c, hello world !Rumman Ansari
 
05 control structures 2
05 control structures 205 control structures 2
05 control structures 2Jomel Penalba
 
[Question Paper] ASP.NET With C# (75:25 Pattern) [April / 2015]
[Question Paper] ASP.NET With C# (75:25 Pattern) [April / 2015][Question Paper] ASP.NET With C# (75:25 Pattern) [April / 2015]
[Question Paper] ASP.NET With C# (75:25 Pattern) [April / 2015]Mumbai B.Sc.IT Study
 
Infix to Postfix Conversion Using Stack
Infix to Postfix Conversion Using StackInfix to Postfix Conversion Using Stack
Infix to Postfix Conversion Using StackSoumen Santra
 
Infix postfixcoversion
Infix postfixcoversionInfix postfixcoversion
Infix postfixcoversionPdr Patnaik
 
COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEWshyamuopeight
 
Python Programming Essentials - M28 - Debugging with pdb
Python Programming Essentials - M28 - Debugging with pdbPython Programming Essentials - M28 - Debugging with pdb
Python Programming Essentials - M28 - Debugging with pdbP3 InfoTech Solutions Pvt. Ltd.
 
C program to write c program without using main function
C program to write c program without using main functionC program to write c program without using main function
C program to write c program without using main functionRumman Ansari
 

What's hot (18)

Presentatie .NET 4/VS2010
Presentatie .NET 4/VS2010Presentatie .NET 4/VS2010
Presentatie .NET 4/VS2010
 
Session 5-exersice
Session 5-exersiceSession 5-exersice
Session 5-exersice
 
Introduction to goodenuffR
Introduction to goodenuffRIntroduction to goodenuffR
Introduction to goodenuffR
 
selection structures
selection structuresselection structures
selection structures
 
escape sequences and substitution markers
escape sequences and substitution markersescape sequences and substitution markers
escape sequences and substitution markers
 
Infix-Postfix expression conversion
Infix-Postfix expression conversionInfix-Postfix expression conversion
Infix-Postfix expression conversion
 
Introduction to SkyPat 2.0
Introduction to SkyPat 2.0Introduction to SkyPat 2.0
Introduction to SkyPat 2.0
 
My first program in c, hello world !
My first program in c, hello world !My first program in c, hello world !
My first program in c, hello world !
 
05 control structures 2
05 control structures 205 control structures 2
05 control structures 2
 
[Question Paper] ASP.NET With C# (75:25 Pattern) [April / 2015]
[Question Paper] ASP.NET With C# (75:25 Pattern) [April / 2015][Question Paper] ASP.NET With C# (75:25 Pattern) [April / 2015]
[Question Paper] ASP.NET With C# (75:25 Pattern) [April / 2015]
 
Infix to Postfix Conversion Using Stack
Infix to Postfix Conversion Using StackInfix to Postfix Conversion Using Stack
Infix to Postfix Conversion Using Stack
 
Infix postfixcoversion
Infix postfixcoversionInfix postfixcoversion
Infix postfixcoversion
 
COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEW
 
Python Programming Essentials - M28 - Debugging with pdb
Python Programming Essentials - M28 - Debugging with pdbPython Programming Essentials - M28 - Debugging with pdb
Python Programming Essentials - M28 - Debugging with pdb
 
Metaprogramming
MetaprogrammingMetaprogramming
Metaprogramming
 
Preprocessor in C
Preprocessor in CPreprocessor in C
Preprocessor in C
 
C program to write c program without using main function
C program to write c program without using main functionC program to write c program without using main function
C program to write c program without using main function
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 

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 stringsash52393
 
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
 
Gsp 215 Effective Communication / snaptutorial.com
Gsp 215  Effective Communication / snaptutorial.comGsp 215  Effective Communication / snaptutorial.com
Gsp 215 Effective Communication / snaptutorial.comHarrisGeorg21
 
Gsp 215 Believe Possibilities / snaptutorial.com
Gsp 215  Believe Possibilities / snaptutorial.comGsp 215  Believe Possibilities / snaptutorial.com
Gsp 215 Believe Possibilities / snaptutorial.comStokesCope20
 
Gsp 215 Enhance teaching-snaptutorial.com
Gsp 215 Enhance teaching-snaptutorial.comGsp 215 Enhance teaching-snaptutorial.com
Gsp 215 Enhance teaching-snaptutorial.comrobertleew18
 
GSP 215 Technology levels--snaptutorial.com
GSP 215 Technology levels--snaptutorial.comGSP 215 Technology levels--snaptutorial.com
GSP 215 Technology levels--snaptutorial.comsholingarjosh136
 
Gsp 215 Massive Success / snaptutorial.com
Gsp 215  Massive Success / snaptutorial.comGsp 215  Massive Success / snaptutorial.com
Gsp 215 Massive Success / snaptutorial.comNorrisMistryzo
 
Gsp 215 Enthusiastic Study / snaptutorial.com
Gsp 215 Enthusiastic Study / snaptutorial.comGsp 215 Enthusiastic Study / snaptutorial.com
Gsp 215 Enthusiastic Study / snaptutorial.comStephenson101
 
GSP 215 RANK Education Counseling -- gsp215rank.com
GSP 215 RANK Education Counseling -- gsp215rank.comGSP 215 RANK Education Counseling -- gsp215rank.com
GSP 215 RANK Education Counseling -- gsp215rank.comkopiko85
 
GSP 215 RANK Education Your Life--gsp215rank.com
GSP 215 RANK Education Your Life--gsp215rank.comGSP 215 RANK Education Your Life--gsp215rank.com
GSP 215 RANK Education Your Life--gsp215rank.comthomashard64
 
GSP 215 RANK Inspiring Innovation--gsp215rank.com
GSP 215 RANK Inspiring Innovation--gsp215rank.com GSP 215 RANK Inspiring Innovation--gsp215rank.com
GSP 215 RANK Inspiring Innovation--gsp215rank.com KeatonJennings102
 
GSP 215 RANK Lessons in Excellence-- gsp215rank.com
GSP 215 RANK Lessons in Excellence-- gsp215rank.comGSP 215 RANK Lessons in Excellence-- gsp215rank.com
GSP 215 RANK Lessons in Excellence-- gsp215rank.comRoelofMerwe102
 
GSP 215 Education Organization - snaptutorial.com
GSP 215  Education Organization - snaptutorial.comGSP 215  Education Organization - snaptutorial.com
GSP 215 Education Organization - snaptutorial.comdonaldzs192
 
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
 
Gsp 215 Exceptional Education / snaptutorial.com
Gsp 215  Exceptional Education / snaptutorial.comGsp 215  Exceptional Education / snaptutorial.com
Gsp 215 Exceptional Education / snaptutorial.comBaileya55
 
Cmis 102 Effective Communication / snaptutorial.com
Cmis 102  Effective Communication / snaptutorial.comCmis 102  Effective Communication / snaptutorial.com
Cmis 102 Effective Communication / snaptutorial.comHarrisGeorg12
 
GSP 215 RANK Introduction Education--gsp215rank.com
GSP 215 RANK Introduction Education--gsp215rank.comGSP 215 RANK Introduction Education--gsp215rank.com
GSP 215 RANK Introduction Education--gsp215rank.comagathachristie281
 
GSP 215 RANK Education Counseling--gsp215rank.com
 GSP 215 RANK Education Counseling--gsp215rank.com GSP 215 RANK Education Counseling--gsp215rank.com
GSP 215 RANK Education Counseling--gsp215rank.comwilliamwordsworth40
 

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
 
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
 
Gsp 215 Effective Communication / snaptutorial.com
Gsp 215  Effective Communication / snaptutorial.comGsp 215  Effective Communication / snaptutorial.com
Gsp 215 Effective Communication / 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
 
ADLAB.pdf
ADLAB.pdfADLAB.pdf
ADLAB.pdf
 
Gsp 215 Enhance teaching-snaptutorial.com
Gsp 215 Enhance teaching-snaptutorial.comGsp 215 Enhance teaching-snaptutorial.com
Gsp 215 Enhance teaching-snaptutorial.com
 
GSP 215 Technology levels--snaptutorial.com
GSP 215 Technology levels--snaptutorial.comGSP 215 Technology levels--snaptutorial.com
GSP 215 Technology levels--snaptutorial.com
 
Gsp 215 Massive Success / snaptutorial.com
Gsp 215  Massive Success / snaptutorial.comGsp 215  Massive Success / snaptutorial.com
Gsp 215 Massive Success / snaptutorial.com
 
Gsp 215 Enthusiastic Study / snaptutorial.com
Gsp 215 Enthusiastic Study / snaptutorial.comGsp 215 Enthusiastic Study / snaptutorial.com
Gsp 215 Enthusiastic Study / snaptutorial.com
 
GSP 215 RANK Education Counseling -- gsp215rank.com
GSP 215 RANK Education Counseling -- gsp215rank.comGSP 215 RANK Education Counseling -- gsp215rank.com
GSP 215 RANK Education Counseling -- gsp215rank.com
 
GSP 215 RANK Education Your Life--gsp215rank.com
GSP 215 RANK Education Your Life--gsp215rank.comGSP 215 RANK Education Your Life--gsp215rank.com
GSP 215 RANK Education Your Life--gsp215rank.com
 
GSP 215 RANK Inspiring Innovation--gsp215rank.com
GSP 215 RANK Inspiring Innovation--gsp215rank.com GSP 215 RANK Inspiring Innovation--gsp215rank.com
GSP 215 RANK Inspiring Innovation--gsp215rank.com
 
GSP 215 RANK Lessons in Excellence-- gsp215rank.com
GSP 215 RANK Lessons in Excellence-- gsp215rank.comGSP 215 RANK Lessons in Excellence-- gsp215rank.com
GSP 215 RANK Lessons in Excellence-- gsp215rank.com
 
GSP 215 Education Organization - snaptutorial.com
GSP 215  Education Organization - snaptutorial.comGSP 215  Education Organization - snaptutorial.com
GSP 215 Education Organization - snaptutorial.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
 
Gsp 215 Exceptional Education / snaptutorial.com
Gsp 215  Exceptional Education / snaptutorial.comGsp 215  Exceptional Education / snaptutorial.com
Gsp 215 Exceptional Education / snaptutorial.com
 
Cmis 102 Effective Communication / snaptutorial.com
Cmis 102  Effective Communication / snaptutorial.comCmis 102  Effective Communication / snaptutorial.com
Cmis 102 Effective Communication / snaptutorial.com
 
GSP 215 RANK Introduction Education--gsp215rank.com
GSP 215 RANK Introduction Education--gsp215rank.comGSP 215 RANK Introduction Education--gsp215rank.com
GSP 215 RANK Introduction Education--gsp215rank.com
 
GSP 215 RANK Education Counseling--gsp215rank.com
 GSP 215 RANK Education Counseling--gsp215rank.com GSP 215 RANK Education Counseling--gsp215rank.com
GSP 215 RANK Education Counseling--gsp215rank.com
 

More from noahjamessss

Devry cis-170-c-i lab-7-of-7-sequential-files
Devry cis-170-c-i lab-7-of-7-sequential-filesDevry cis-170-c-i lab-7-of-7-sequential-files
Devry cis-170-c-i lab-7-of-7-sequential-filesnoahjamessss
 
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-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsDevry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsnoahjamessss
 
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-loopingnoahjamessss
 
Devry cis-170-c-i lab-2-of-7-decisions
Devry cis-170-c-i lab-2-of-7-decisionsDevry cis-170-c-i lab-2-of-7-decisions
Devry cis-170-c-i lab-2-of-7-decisionsnoahjamessss
 
Devry busn-278-entire-course
Devry busn-278-entire-courseDevry busn-278-entire-course
Devry busn-278-entire-coursenoahjamessss
 
Busn 278-week-4-midterm
Busn 278-week-4-midtermBusn 278-week-4-midterm
Busn 278-week-4-midtermnoahjamessss
 
Bus 650-week-6-final-paper-financial-analysis-the-lg-group
Bus 650-week-6-final-paper-financial-analysis-the-lg-groupBus 650-week-6-final-paper-financial-analysis-the-lg-group
Bus 650-week-6-final-paper-financial-analysis-the-lg-groupnoahjamessss
 
Ash bus-650-week-2-return-on-investment-education-funding
Ash bus-650-week-2-return-on-investment-education-fundingAsh bus-650-week-2-return-on-investment-education-funding
Ash bus-650-week-2-return-on-investment-education-fundingnoahjamessss
 
Ash bus-650-week-2-dq-2-managing-earnings
Ash bus-650-week-2-dq-2-managing-earningsAsh bus-650-week-2-dq-2-managing-earnings
Ash bus-650-week-2-dq-2-managing-earningsnoahjamessss
 
Ash bus-650-week-2-dq-1-initial-investment
Ash bus-650-week-2-dq-1-initial-investmentAsh bus-650-week-2-dq-1-initial-investment
Ash bus-650-week-2-dq-1-initial-investmentnoahjamessss
 
Ash bus-650-week-1-dq-2-short-term-or-long-term-view
Ash bus-650-week-1-dq-2-short-term-or-long-term-viewAsh bus-650-week-1-dq-2-short-term-or-long-term-view
Ash bus-650-week-1-dq-2-short-term-or-long-term-viewnoahjamessss
 
Ash bus-650-ash-complete-class
Ash bus-650-ash-complete-classAsh bus-650-ash-complete-class
Ash bus-650-ash-complete-classnoahjamessss
 
Keller hsm 541 week 7 course project due
Keller hsm 541 week 7 course project dueKeller hsm 541 week 7 course project due
Keller hsm 541 week 7 course project duenoahjamessss
 
Hrm 326 final exam guide
Hrm 326 final exam guideHrm 326 final exam guide
Hrm 326 final exam guidenoahjamessss
 
Mkt 421 final exam guide (new, 2017) new
Mkt 421 final exam guide (new, 2017) newMkt 421 final exam guide (new, 2017) new
Mkt 421 final exam guide (new, 2017) newnoahjamessss
 
Uop phl 458 week 3 dq 1 new
Uop phl 458 week 3 dq 1 newUop phl 458 week 3 dq 1 new
Uop phl 458 week 3 dq 1 newnoahjamessss
 
Uop phl 458 week 1 dq 1 new
Uop phl 458 week 1 dq 1 newUop phl 458 week 1 dq 1 new
Uop phl 458 week 1 dq 1 newnoahjamessss
 
Uop str 581 week 4
Uop str 581 week 4Uop str 581 week 4
Uop str 581 week 4noahjamessss
 
Uop str 581 capstone final exam part 2 new
Uop str 581 capstone final exam part 2 newUop str 581 capstone final exam part 2 new
Uop str 581 capstone final exam part 2 newnoahjamessss
 

More from noahjamessss (20)

Devry cis-170-c-i lab-7-of-7-sequential-files
Devry cis-170-c-i lab-7-of-7-sequential-filesDevry cis-170-c-i lab-7-of-7-sequential-files
Devry cis-170-c-i lab-7-of-7-sequential-files
 
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-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functionsDevry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functions
 
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-2-of-7-decisions
Devry cis-170-c-i lab-2-of-7-decisionsDevry cis-170-c-i lab-2-of-7-decisions
Devry cis-170-c-i lab-2-of-7-decisions
 
Devry busn-278-entire-course
Devry busn-278-entire-courseDevry busn-278-entire-course
Devry busn-278-entire-course
 
Busn 278-week-4-midterm
Busn 278-week-4-midtermBusn 278-week-4-midterm
Busn 278-week-4-midterm
 
Bus 650-week-6-final-paper-financial-analysis-the-lg-group
Bus 650-week-6-final-paper-financial-analysis-the-lg-groupBus 650-week-6-final-paper-financial-analysis-the-lg-group
Bus 650-week-6-final-paper-financial-analysis-the-lg-group
 
Ash bus-650-week-2-return-on-investment-education-funding
Ash bus-650-week-2-return-on-investment-education-fundingAsh bus-650-week-2-return-on-investment-education-funding
Ash bus-650-week-2-return-on-investment-education-funding
 
Ash bus-650-week-2-dq-2-managing-earnings
Ash bus-650-week-2-dq-2-managing-earningsAsh bus-650-week-2-dq-2-managing-earnings
Ash bus-650-week-2-dq-2-managing-earnings
 
Ash bus-650-week-2-dq-1-initial-investment
Ash bus-650-week-2-dq-1-initial-investmentAsh bus-650-week-2-dq-1-initial-investment
Ash bus-650-week-2-dq-1-initial-investment
 
Ash bus-650-week-1-dq-2-short-term-or-long-term-view
Ash bus-650-week-1-dq-2-short-term-or-long-term-viewAsh bus-650-week-1-dq-2-short-term-or-long-term-view
Ash bus-650-week-1-dq-2-short-term-or-long-term-view
 
Ash bus-650-ash-complete-class
Ash bus-650-ash-complete-classAsh bus-650-ash-complete-class
Ash bus-650-ash-complete-class
 
Keller hsm 541 week 7 course project due
Keller hsm 541 week 7 course project dueKeller hsm 541 week 7 course project due
Keller hsm 541 week 7 course project due
 
Hrm 326 final exam guide
Hrm 326 final exam guideHrm 326 final exam guide
Hrm 326 final exam guide
 
Mkt 421 final exam guide (new, 2017) new
Mkt 421 final exam guide (new, 2017) newMkt 421 final exam guide (new, 2017) new
Mkt 421 final exam guide (new, 2017) new
 
Uop phl 458 week 3 dq 1 new
Uop phl 458 week 3 dq 1 newUop phl 458 week 3 dq 1 new
Uop phl 458 week 3 dq 1 new
 
Uop phl 458 week 1 dq 1 new
Uop phl 458 week 1 dq 1 newUop phl 458 week 1 dq 1 new
Uop phl 458 week 1 dq 1 new
 
Uop str 581 week 4
Uop str 581 week 4Uop str 581 week 4
Uop str 581 week 4
 
Uop str 581 capstone final exam part 2 new
Uop str 581 capstone final exam part 2 newUop str 581 capstone final exam part 2 new
Uop str 581 capstone final exam part 2 new
 

Recently uploaded

ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 

Recently uploaded (20)

ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 

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

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