Week 2 - Arrays
Problem Set 2
Things to notice in the problem statement
Divide and Conquer
Define a global variable array to store the points of each letter
Procedure Main
Prompt the user for two words
Compute the score of each word using ComputeWord
Print the winner
End Procedure
Procedure ComputeWord(word)
Initialize score to 0
For each character in the word
Add the character's point value to the score
End For
Return the score
End ProcedureUseful Snippets
Take-aways
Before the problem
Things to notice in the problem statement
Divide and Conquer
Useful Snippets
Take-aways
Before the problem
Things to notice in the problem statement
Divide and Conquer
Useful Snippets
Take-aways
Things to notice in the problem statement
Dividie and Conquer
Useful Snippets
Take-aways
Last updated