Advertisement

Problem Solving And Iteration

Problem Solving And Iteration This video talks about problem-solving using loops.

It goes without saying that you cannot code a solution until you understand the problem. That said, there are also some common patterns you will see in your code. We've talked in passing about some of them.

For example, if you're trying to find the sum of some numbers, you need to keep track of the value of sum. You also know that before you begin your calculations, the sum must be set to zero.

Write solutions to the following:

1) How many letters are in the string str? (Write in Java)

2) Assume you have 3 integers represented by the variables a, b, and c. Using 3 if statements, how would you find the greatest number? Do not use else-if or else.

3) How would you find how many uppercase vowels are in a string? (Write in English first, then write in Java)

4) Building on number 3, how would you find which vowel is the most common? (Write in English first, then write in Java)

Java,APCSA,Loops,Iteration,

Post a Comment

0 Comments