Question
Instruction: In this python program please convert into java program. Thank you. Code: while(True): try: word = input() vowelCount=0 consonantCount=0 word=word.lower() vowelCluster=0 consonantCluster=0 for i
Instruction: In this python program please convert into java program. Thank you.
Code:
while(True):
try:
word = input()
vowelCount=0
consonantCount=0
word=word.lower()
vowelCluster=0
consonantCluster=0
for i in range(len(word)):
if(word[i] in ['a','e','i','o','u']):
if(consonantCount>0):
if(consonantCount>=2):
consonantCluster += 1
consonantCount=0
vowelCount += 1
elif(word[i] in ['b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z']):
if(vowelCount>0):
if(vowelCount>=2):
vowelCluster += 1
vowelCount=0
consonantCount += 1
else:
vowelCount=0
consonantCount=0
if(vowelCount>=2):
vowelCluster += 1
if(consonantCount>=2):
consonantCluster += 1
if(consonantCluster>=1 and vowelCluster>=1):
print("YES")
else:
print("NO")
except EOFError:
break
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started