//Write a java program accept date of birth from scanner and check eligible for vote ?
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter date of birth in format dd/mm/yyyy : ");
String dob = sc.nextLine();
String[] dobArray = dob.split("/");
int day = Integer.parseInt(dobArray[0]);
int month = Integer.parseInt(dobArray[1]);
int year = Integer.parseInt(dobArray[2]);
if(year < 1950)
{
System.out.println("You are not eligible for vote.");
}
else if(year == 1950 && month < 1)
{
System.out.println("You are not eligible for vote.");
}
else if(year == 1950 && month == 1 && day <18)
{
System.out.println("You are not eligible for vote.");
}
else
{
System.out.println("You are eligible for vote.");
}
}
}
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter date of birth in format dd/mm/yyyy : ");
String dob = sc.nextLine();
String[] dobArray = dob.split("/");
int day = Integer.parseInt(dobArray[0]);
int month = Integer.parseInt(dobArray[1]);
int year = Integer.parseInt(dobArray[2]);
if(year < 1950)
{
System.out.println("You are not eligible for vote.");
}
else if(year == 1950 && month < 1)
{
System.out.println("You are not eligible for vote.");
}
else if(year == 1950 && month == 1 && day <18)
{
System.out.println("You are not eligible for vote.");
}
else
{
System.out.println("You are eligible for vote.");
}
}
}
Sony is Hiring Machine learning Intern
Role - Machine learning Intern
Experience: Student/fresher
Salary - 40k - 50k per month
Passout year - 2024,2023 ,2022
Qualification: Btech/BE/Mtech/MCA
Location: Work from home
Apply now: https://www.linkedin.com/jobs/view/3352394311
Role - Machine learning Intern
Experience: Student/fresher
Salary - 40k - 50k per month
Passout year - 2024,2023 ,2022
Qualification: Btech/BE/Mtech/MCA
Location: Work from home
Apply now: https://www.linkedin.com/jobs/view/3352394311
Linkedin
Sony Research India hiring Machine Learning Intern in Mumbai, Maharashtra, India | LinkedIn
Posted 11:00:43 AM. The Sony R&D Centre is the research and development organization within Sony Group Corporation. Weβ¦See this and similar jobs on LinkedIn.
Java Hyd Team
import java.util.Scanner; class ReverseWords { static void reverseWords(String str) { String[] arr = str.split("\\s"); for (int i = arr.length-1; i >= 0; i--) { Syβ¦
package com.Aman;import java.util.*;import java.util.regex.Pattern;public class Q1_A4 { // Java Program to reverse a String// without using inbuilt String function // Method to reverse words of a String static String reverseWords(String str) { // Specifying the pattern to be searched Pattern pattern = Pattern.compile("\\s"); // splitting String str with a pattern // (i.e )splitting the string whenever their // is whitespace and store in temp array. String[] temp = pattern.split(str); String result = ""; // Iterate over the temp array and store // the string in reverse order. for (int i = 0; i < temp.length; i++) { if (i == temp.length - 1) result = temp[i] + result; else result = " " + temp[i] + result; } return result; } // Driver methods to test above method public static void main(String[] args) { String s1 = "There is a Cat"; System.out.println(reverseWords(s1)); String s2 = " Cat is there"; System.out.println(reverseWords(s2)); }}import java.util.*;// import statement for utility packagepublic class Q1_A2 { //class initialization public static void main(String[] args) { // main method allocates memory for the code /project.... Scanner x = new Scanner(System.in); // output Statement String firstString = x.next(); //taking input from user via keyboard String secondString = x.next(); // taking input from user via keyboard System.out.println("Check if the first String and second String is anagram of each other: " + isAnagram(firstString, secondString)); // output Statement } public static boolean isAnagram(String firstString, String secondString) { //methods with inputs parameters char[] firstStringCharArray = firstString.toLowerCase().toCharArray(); // declaring firstStringCharArray a value in lowerCase char[] secondStringCharArray = secondString.toLowerCase().toCharArray(); // declaring secondStringCharArray a value in lowerCase Arrays.sort(firstStringCharArray); // sorting array in ascending order Arrays.sort(secondStringCharArray); // sorting array in ascending order return Arrays.equals(firstStringCharArray, secondStringCharArray); // return statement checks value with the help of .equalsMethod and returns boolean after checking... }}package com.Aman;//add in packagepublic class Q1_A1 { //create class (class doesn't allocates space public static void main(String[] args) { //main method allocates space for the project in heap String inputString = "malayalam"; //declaring and initializing string value int length = inputString.length(); // initializing length with array value length int i, begin, end, middle; // declaring variable in int datatype begin = 0;//initializing variable with value end = length - 1;//initializing variable with value middle = (begin + end) / 2;//initializing variable with value for (i = begin; i <= middle; i++) { // for loop if (inputString.charAt(begin) == inputString.charAt(end)) { //conditional blocks begin++; // post increment after end--; // post decrement after } else { //conditional blocks System.out.println("Not a palindrome.");//output statement break; // breaks statement } } if (i == middle + 1) { //conditional blocks System.out.println("Palindrome."); // output statement } }}