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

More Related Content

What's hot

Presentatie .NET 4/VS2010
Presentatie .NET 4/VS2010Presentatie .NET 4/VS2010
Presentatie .NET 4/VS2010
Niels Vrolijk
 
Session 5-exersice
Session 5-exersiceSession 5-exersice
Session 5-exersice
Keroles karam khalil
 
Introduction to goodenuffR
Introduction to goodenuffRIntroduction to goodenuffR
Introduction to goodenuffR
MartinFrigaard
 
selection structures
selection structuresselection structures
selection structures
Micheal Ogundero
 
escape sequences and substitution markers
escape sequences and substitution markersescape sequences and substitution markers
escape sequences and substitution markers
Micheal Ogundero
 
Infix-Postfix expression conversion
Infix-Postfix expression conversionInfix-Postfix expression conversion
Infix-Postfix expression conversion
Rashmiranja625
 
Introduction to SkyPat 2.0
Introduction to SkyPat 2.0Introduction to SkyPat 2.0
Introduction to SkyPat 2.0
Little Sky
 
05 control structures 2
05 control structures 205 control structures 2
05 control structures 2Jomel Penalba
 
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
 
[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 Stack
Soumen Santra
 
Infix postfixcoversion
Infix postfixcoversionInfix postfixcoversion
Infix postfixcoversion
Pdr Patnaik
 
COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEW
shyamuopeight
 
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
P3 InfoTech Solutions Pvt. Ltd.
 
Metaprogramming
MetaprogrammingMetaprogramming
Metaprogramming
Mehmet Emin İNAÇ
 
Preprocessor in C
Preprocessor in CPreprocessor in C
Preprocessor in C
Prabhu Govind
 
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
Rumman Ansari
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
Jehangir Khan
 

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
 
05 control structures 2
05 control structures 205 control structures 2
05 control structures 2
 
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 !
 
[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 strings
ash52393
 
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
 
Gsp 215 Effective Communication / snaptutorial.com
Gsp 215  Effective Communication / snaptutorial.comGsp 215  Effective Communication / snaptutorial.com
Gsp 215 Effective Communication / snaptutorial.com
HarrisGeorg21
 
Gsp 215 Believe Possibilities / snaptutorial.com
Gsp 215  Believe Possibilities / snaptutorial.comGsp 215  Believe Possibilities / snaptutorial.com
Gsp 215 Believe Possibilities / snaptutorial.com
StokesCope20
 
ADLAB.pdf
ADLAB.pdfADLAB.pdf
ADLAB.pdf
ycpthalachira
 
Gsp 215 Enhance teaching-snaptutorial.com
Gsp 215 Enhance teaching-snaptutorial.comGsp 215 Enhance teaching-snaptutorial.com
Gsp 215 Enhance teaching-snaptutorial.com
robertleew18
 
Gsp 215 Enthusiastic Study / snaptutorial.com
Gsp 215 Enthusiastic Study / snaptutorial.comGsp 215 Enthusiastic Study / snaptutorial.com
Gsp 215 Enthusiastic Study / snaptutorial.com
Stephenson101
 
Gsp 215 Massive Success / snaptutorial.com
Gsp 215  Massive Success / snaptutorial.comGsp 215  Massive Success / snaptutorial.com
Gsp 215 Massive Success / snaptutorial.com
NorrisMistryzo
 
GSP 215 Technology levels--snaptutorial.com
GSP 215 Technology levels--snaptutorial.comGSP 215 Technology levels--snaptutorial.com
GSP 215 Technology levels--snaptutorial.com
sholingarjosh136
 
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
kopiko85
 
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
thomashard64
 
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
RoelofMerwe102
 
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 Education Organization - snaptutorial.com
GSP 215  Education Organization - snaptutorial.comGSP 215  Education Organization - snaptutorial.com
GSP 215 Education Organization - snaptutorial.com
donaldzs192
 
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
 
Gsp 215 Exceptional Education / snaptutorial.com
Gsp 215  Exceptional Education / snaptutorial.comGsp 215  Exceptional Education / snaptutorial.com
Gsp 215 Exceptional Education / snaptutorial.com
Baileya55
 
Cmis 102 Effective Communication / snaptutorial.com
Cmis 102  Effective Communication / snaptutorial.comCmis 102  Effective Communication / snaptutorial.com
Cmis 102 Effective Communication / snaptutorial.com
HarrisGeorg12
 
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
agathachristie281
 
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
williamwordsworth40
 

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 Enthusiastic Study / snaptutorial.com
Gsp 215 Enthusiastic Study / snaptutorial.comGsp 215 Enthusiastic Study / snaptutorial.com
Gsp 215 Enthusiastic Study / 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 Technology levels--snaptutorial.com
GSP 215 Technology levels--snaptutorial.comGSP 215 Technology levels--snaptutorial.com
GSP 215 Technology levels--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 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 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 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 cskvsmi44

Cmgt 410-week-3-dq-2
Cmgt 410-week-3-dq-2Cmgt 410-week-3-dq-2
Cmgt 410-week-3-dq-2
cskvsmi44
 
Cmgt 410-week-1-dq-1
Cmgt 410-week-1-dq-1Cmgt 410-week-1-dq-1
Cmgt 410-week-1-dq-1
cskvsmi44
 
Strayer cis-273-week-7-lab-assignment-7-form-page-new
Strayer cis-273-week-7-lab-assignment-7-form-page-newStrayer cis-273-week-7-lab-assignment-7-form-page-new
Strayer cis-273-week-7-lab-assignment-7-form-page-new
cskvsmi44
 
Strayer cis-273-week-6-lab-assignment-6-working-with-tables-new
Strayer cis-273-week-6-lab-assignment-6-working-with-tables-newStrayer cis-273-week-6-lab-assignment-6-working-with-tables-new
Strayer cis-273-week-6-lab-assignment-6-working-with-tables-new
cskvsmi44
 
Strayer cis-273-week-4-lab-assignment-5
Strayer cis-273-week-4-lab-assignment-5Strayer cis-273-week-4-lab-assignment-5
Strayer cis-273-week-4-lab-assignment-5
cskvsmi44
 
Strayer cis-273-week-3-lab-assignment-4-nested-lists-and-cascading-style-shee...
Strayer cis-273-week-3-lab-assignment-4-nested-lists-and-cascading-style-shee...Strayer cis-273-week-3-lab-assignment-4-nested-lists-and-cascading-style-shee...
Strayer cis-273-week-3-lab-assignment-4-nested-lists-and-cascading-style-shee...
cskvsmi44
 
Strayer cis-273-week-3-lab-assignment-3-storyboarding-new
Strayer cis-273-week-3-lab-assignment-3-storyboarding-newStrayer cis-273-week-3-lab-assignment-3-storyboarding-new
Strayer cis-273-week-3-lab-assignment-3-storyboarding-new
cskvsmi44
 
Strayer cis-273-week-2-lab-assignment-2-three-web-pages-with-hyperlinks-new
Strayer cis-273-week-2-lab-assignment-2-three-web-pages-with-hyperlinks-newStrayer cis-273-week-2-lab-assignment-2-three-web-pages-with-hyperlinks-new
Strayer cis-273-week-2-lab-assignment-2-three-web-pages-with-hyperlinks-new
cskvsmi44
 
Strayer cis-273-week-2-lab-assignment-1-beginning-html-new
Strayer cis-273-week-2-lab-assignment-1-beginning-html-newStrayer cis-273-week-2-lab-assignment-1-beginning-html-new
Strayer cis-273-week-2-lab-assignment-1-beginning-html-new
cskvsmi44
 
Uop cis-207-week-3-individual-mobile-ordering-system-summary-new
Uop cis-207-week-3-individual-mobile-ordering-system-summary-newUop cis-207-week-3-individual-mobile-ordering-system-summary-new
Uop cis-207-week-3-individual-mobile-ordering-system-summary-new
cskvsmi44
 
Uop cis-207-week-1-individual-data
Uop cis-207-week-1-individual-dataUop cis-207-week-1-individual-data
Uop cis-207-week-1-individual-data
cskvsmi44
 
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
cskvsmi44
 
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
 

More from cskvsmi44 (13)

Cmgt 410-week-3-dq-2
Cmgt 410-week-3-dq-2Cmgt 410-week-3-dq-2
Cmgt 410-week-3-dq-2
 
Cmgt 410-week-1-dq-1
Cmgt 410-week-1-dq-1Cmgt 410-week-1-dq-1
Cmgt 410-week-1-dq-1
 
Strayer cis-273-week-7-lab-assignment-7-form-page-new
Strayer cis-273-week-7-lab-assignment-7-form-page-newStrayer cis-273-week-7-lab-assignment-7-form-page-new
Strayer cis-273-week-7-lab-assignment-7-form-page-new
 
Strayer cis-273-week-6-lab-assignment-6-working-with-tables-new
Strayer cis-273-week-6-lab-assignment-6-working-with-tables-newStrayer cis-273-week-6-lab-assignment-6-working-with-tables-new
Strayer cis-273-week-6-lab-assignment-6-working-with-tables-new
 
Strayer cis-273-week-4-lab-assignment-5
Strayer cis-273-week-4-lab-assignment-5Strayer cis-273-week-4-lab-assignment-5
Strayer cis-273-week-4-lab-assignment-5
 
Strayer cis-273-week-3-lab-assignment-4-nested-lists-and-cascading-style-shee...
Strayer cis-273-week-3-lab-assignment-4-nested-lists-and-cascading-style-shee...Strayer cis-273-week-3-lab-assignment-4-nested-lists-and-cascading-style-shee...
Strayer cis-273-week-3-lab-assignment-4-nested-lists-and-cascading-style-shee...
 
Strayer cis-273-week-3-lab-assignment-3-storyboarding-new
Strayer cis-273-week-3-lab-assignment-3-storyboarding-newStrayer cis-273-week-3-lab-assignment-3-storyboarding-new
Strayer cis-273-week-3-lab-assignment-3-storyboarding-new
 
Strayer cis-273-week-2-lab-assignment-2-three-web-pages-with-hyperlinks-new
Strayer cis-273-week-2-lab-assignment-2-three-web-pages-with-hyperlinks-newStrayer cis-273-week-2-lab-assignment-2-three-web-pages-with-hyperlinks-new
Strayer cis-273-week-2-lab-assignment-2-three-web-pages-with-hyperlinks-new
 
Strayer cis-273-week-2-lab-assignment-1-beginning-html-new
Strayer cis-273-week-2-lab-assignment-1-beginning-html-newStrayer cis-273-week-2-lab-assignment-1-beginning-html-new
Strayer cis-273-week-2-lab-assignment-1-beginning-html-new
 
Uop cis-207-week-3-individual-mobile-ordering-system-summary-new
Uop cis-207-week-3-individual-mobile-ordering-system-summary-newUop cis-207-week-3-individual-mobile-ordering-system-summary-new
Uop cis-207-week-3-individual-mobile-ordering-system-summary-new
 
Uop cis-207-week-1-individual-data
Uop cis-207-week-1-individual-dataUop cis-207-week-1-individual-data
Uop cis-207-week-1-individual-data
 
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
 

Recently uploaded

Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
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
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
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
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
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
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
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
 
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
 
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
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
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)
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 

Recently uploaded (20)

Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
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 ...
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
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
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
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
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
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
 
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
 
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...
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 

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