7) Write a program using switch case to Print the vowel if a vowel is entered Pr
ID: 3613730 • Letter: 7
Question
7) Write a program using switch case to
Print the vowel if a vowel is entered
Print the message “ consonant is entered” if anythingother than vowel is entered.
8) A right triangle can have sides whose lengths are allintegers. The set of three integer values for the lengths of thesides of a right triangle is called Pythagorean triple. The lengthsof the three sides must satisfy the relationship that the sum ofthe squares of two of the sides is equal to the square of thehypotenuse. Write an application that displays a table of thePythagorean triples for side1, side 2, hypotenuse, all no largerthan 500.
Explanation / Answer
please rate - thanks this is 2 questions, not 1 import java.util.*; public class isvowel{ public static void main(String[] args) {char ch; String input; Scanner in=new Scanner(System.in); System.out.println("Enter a character "); input=in.next(); ch=input.charAt(0); switch(ch) { case 'a': case 'A': case 'e': case 'E': case 'i': case 'I': case 'o': case 'O': case 'u': case 'U': System.out.println(ch); break; default: System.out.println("consonant isentered"); } } }
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.