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


  1. Allow the user to enter a sentence

(a) Convert this sentence to lower case


  1. 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


  1. 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


  1. Terminate


error: Content is protected !!