Grade Level: High School
Duration: 50 to 100 minutes
Get out notebook paper.
Insert standard heading.
Title: Vowels
Objective: Familiarize students with FRQ requirements.
Activity: Briefly review the structure of an FRQ:
Activity: Present the following example FRQ:
Write a method `public int countVowels(String input)` that takes a single String parameter and returns the number of vowels (a, e, i, o, u) in the string, ignoring case. - Input: A string of any length. - Output: An integer representing the count of vowels. - Constraints: You may assume the input string contains only letters and spaces. Example: Input: "AP Computer Science A" Output: 8
Objective: Teach students to break down the problem into logical steps.
Activity: Write pseudocode on the board:
Pseudocode: 1. Convert the input string to lowercase. 2. Initialize a counter variable to 0. 3. Loop through each character in the string. 4. If the character is a vowel (a, e, i, o, u), increment the counter. 5. Return the counter value.
Objective: Implement the solution in Java.
Activity: Code the solution step-by-step in an IDE while explaining your thought process:
??????????? to be coded by you You can ask questions. If are super stuck, I demo it on the Board You will drop off 3 files into Google Classroom: • Your files will be: • PX_lastname_Vowels.java (Python program) • PX_lastname_Vowels.png (Screenshot) • PX_lastname_Vowels.mp4 (Video running the program)
Activity: Run the program with test cases, including edge cases:
"Hello"
→ Output: 2
""
→ Output: 0
"xyz"
→ Output: 0
Summary:
Open the floor for student questions.