Write A Java Program That Keeps A Number From The User and Generates An Integer Between 1 and 7 and Displays The Name of The Weekday
Write A Java Program That Keeps A Number From The User and Generates An Integer Between 1 and 7 and Displays The Name of The Weekday
Write A Java Program That Keeps A Number From The User and Generates An Integer Between 1 and 7 and Displays The Name of The Weekday
displays
the name of the weekday.
Test Data
Input number: 3
Expected Output :
Wednesday
Test Data
Input a month number: 2
Input a year: 2016
Expected Output :
February 2016 has 29 days
Write a Java program that takes the user to provide a single character from the alphabet. Print Vowel or
Consonant, depending on the user input. If the user input is not a letter (between a and z or A and Z), or is a string
of length > 1, print an error message.
Test Data
Input an alphabet: p
Expected Output :
Input letter is Consonant
Exercise 1: Write Java program to allow the user to input his/her age. Then the program will show if the person is
eligible to vote. A person who is eligible to vote must be older than or equal to 18 years old.
Write a method that prints how many of n1, n2, and n3are odd:
public void printNumOdd(int n1, int n2, int n3) {
}
Write a method with a while loop to prints 1 through n in square brackets. For example, if n = 6 print !![1] [2] [3]
[4] [5] [6]