SentenceWithVowels Solution

$30.00

Category:

Description

File Name:

 

H:\CPSC1150\Lab5|SentenceWithVowels.java
Purpose

 

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

.

Input

 

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

 

The perimeter of a triangle

 

 

Program Logic (Pseudocode)

 

Algorithm SentenceWithVowels

Start

  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 !!