SentenceWithVowels Solution



File Name:



To calculate the perimeter of a triangle by letting the user to enter 3 coordinates by using Pythagoras to solve



x-coordinates 1,2 and 3 and y-coordinates 1,2 and 3


The perimeter of a triangle

Program Logic (Pseudocode)

Algorithm SentenceWithVowels


1. Initialize variables

(a) A counter in int

(b) E counter in int

(c) I counter in int

(d) O counter in int

(e) U counter in int

(f) sentence string (user input) in string

(g) non-vowel alphabet counter in int

(h) counter for the loop in int

2. Allow the user to enter a sentence

(a) Convert this sentence to lower case

3. Create a loop to compare each letter in the sentence

(a) Check if it is an alphabet character

(b) if it is, then check if it is a vowel

(c) otherwise add it to the non-vowel counter

4. Display the results

(a) Show how many times there is each individual vowel in the sentence

(b) Show how many non-vowel letters are in the sentence as well

5. Terminate