Skip to main content

Posts

Showing posts from March, 2023

TCS Xplore 2023 Ion Proctored Exam ( IPA) 6 - JAVA coding solution ( 15 marks )

 Problem Statement :   Subscribe Please :   click here           Subscribe Please :   click here   Write a program to take a integer  number and check whether this number is perfect number or not . if number is perfect then print "Given number is Perfect number" else print  "Given number is not Perfect number". A number whose  sum of factors  (excluding the number itself) is equal to the number is called a  perfect   number . In other words, if the sum of positive divisors (excluding the number itself) of a number equals the number itself is called a  perfect number .                                           Subscribe Please :   click here   Example :  First, we find the factors of 496 i.e.  1, 2, 4, 8, 16, 31, 62, 124,  and  248 . Let's find the sum of factors (1 + 2 + 4 + 8 + 16 + 31 + 62 + 124 +248 =  496 ). We observe that the sum of factors is equal to the number itself. Hence, the number  496  is a perfect number.                                          

A Series on "JAVA CODING CHALLENGE" #2 Palindrome Check for String and Number both

Problem 2 :  Subscribe Please :   click here              Subscribe Please :   click here Write a program to check whether a String or Number is Palindrome or Not . Example : String : "madam" is Palindrome and "mad" is not                    Number : 121212 is Palindrome but 123 is not .  Subscribe Please :   click here                       Subscribe Please :   click here Approach :   Get the number to check for palindrome Hold the number in temporary variable Reverse the number Compare the temporary number with reversed number If both numbers are same, print "palindrome number" Else print "not palindrome number" Code :  import java . util .*; public class Palindrome {     public static void main ( String [] args ) {         Scanner sc = new Scanner ( System . in );           String str = sc . nextLine ();           String str2 = "" ;           for ( int i = str . length ()- 1 ; i >= 0 ; i --){             str2 += str

A Series on "JAVA CODING CHALLENGE" #1 Reverse a Number

 Problem 1 :  Subscribe Please :   click here                 Subscribe Please :   click here Write a program to reverse a number . Example : if a number is 12345 the it's output will be 54321 .  Approach : Taking a integer value from user and applying the logic and print the output .  Subscribe Please :   click here              Subscribe Please :   click here Code : import java . util . Scanner ; public class Reverse {     public static void main ( String [] args ) {         Scanner sc = new Scanner ( System . in );         System . out . println ( "Enter a number : " );         int num = sc . nextInt ();         System . out . println ( "Reverse of Number : " );         while ( num != 0 ){             int d = num % 10 ;             System . out . print ( d );             num = num / 10 ;         }     } }  Subscribe Please :   click here             Subscribe Please :   click here                                  Subscribe Please :   click here

TCS Xplore 2023 Ion Proctored Exam ( IPA) 5 - JAVA coding solution ( 35 marks )

 Problem Statement :                               Subscribe Please :   click here Write a java program in which - 1. declare a class Vegetables and make attributes as -         int - vegetableId , String vegetableName , int price , int rating  and along with the constructor . All the attribute should be private and implement the getter and setter . 2.  Write a Solution class with main method . where you have to implement a static method findPrice where you have to pass array object along with the rating which you have to take form user . 3. in findPrice method , you have to implement that if the rating of vegetable is greather than the rating that user has given then return that vegetable object as output which has minimum rating or if no any vegetables are present which satisfy the above condition then simply print "No Match Found". 4. if it any return any object then print the price of that object .  Subscribe Please :   click here         Subscribe Please :   click here C

Complete Strategy to clear TCS Xplore IPA in One Attempt Now ( 80+ Score )

  So hello Everyone , Here are the all Links from where you can Practice !  All the resources are searched from my best !  1. For KYT and Bizzskill  Link :- tcs Xplore course  2. Unix Operating system Link :-    a.  click here Link 1 b.  click here Link 2 c.  Click here Link 3   3. UI  Link :-  click here 4. SQL and Pl SQL Link : -  Click here Click here click here 5. Java MCQ  Link :-  click here click here click here 6. Java coding :-  Access the playlist on YouTube :-  click here to watch Access the blogs :-  click here All in one link :-   click here

Mission "TCS DIGITAL" ( Upgrade Ninja to Digital ) previous year Coding Quistion 06

  Problem Statement :  Subscribe the channel :  click here Q--> Write a program to take a number as input and find that if square number, then last digit of the number is equal to same as input number . Approach :  1. Take a Integer as input  2. Square the number  3. and check the condition Code : import java . util .*; public class JAVA36 {     public static void main ( String [] args ) {         Scanner sc = new Scanner ( System . in );         int n = sc . nextInt ();         int sqr = n * n ;         int d = sqr % 10 ;         if ( d == n ){             System . out . println ( "Correct Number !" );         }         else {             System . out . println ( "Incorrect number !" );         }     }     }                     Subscribe the channel :  click here

Mission "TCS DIGITAL" ( Upgrade Ninja to Digital ) previous year Coding Quistion 05

  Problem Statement :  Subscribe the channel :  click here Q--> Write a program to find Nth smallest element from Array . Approach :  1. Number of element you want to store array . 2. Store element in array as a unsorted manner  3. find the  element at Nth smallest element  Code : import java . util .*; public class JAVA35 {     public static void main ( String [] args ) {         Scanner sc = new Scanner ( System . in );         System . out . println ( "Enter your length of array : " );         int n = sc . nextInt ();                 int arr []= new int [ n ];         for ( int i = 0 ; i < arr . length ; i ++){             arr [ i ]= sc . nextInt ();         }         System . out . println ( "Array ELements are : " );         System . out . println ( "------------------------" );         for ( int i : arr ){             System . out . println ( i + " " );         }         System . out . println ( "Enter your desire

Mission "TCS DIGITAL" ( Upgrade Ninja to Digital ) previous year Coding Quistion 04

 Problem Statement :  Subscribe the channel :  click here   Given an array Arr[ ] of N integers and a positive integer K. The task is to cyclically rotate the array clockwise by K. Note  : Keep the first of the array unaltered.   Example 1: 5  —Value of N {10, 20, 30, 40, 50}  —Element of Arr[ ] 2  —–Value of K Output : 40 50 10 20 30 Example 2: 4  —Value of N {10, 20, 30, 40}  —Element of Arr[] 1  —–Value of K Output : 40 10 20 30 code :   import java.util.*; public class rotate {     public static void main( String [] args) {         Scanner sc= new Scanner(System.in);         int n=sc.nextInt();         int arr[]= new int [n];         for ( int i= 0 ;i<arr.length;i++){             arr[i]=sc.nextInt();         }         int k=sc.nextInt();         // 12 20 30 40 50         int arr2[]= new int [n];         for ( int i= 0 ;i<k;i++){             arr2[i]=arr[arr.length- 1 -i];         }         int j= 0 ;         for ( int i=k;i<arr.length;i++){             arr

Mission "TCS DIGITAL" ( Upgrade Ninja to Digital ) previous year Coding Quistion 03

  Problem Statement :  Click here to Subscribe :  Education inTalk Q3 . Find the number of students whose height is less than the height of their adjacent students. Problem Statement :  A physical education teacher asks students to assemble in a straight line for the morning assembly.Given an array of N in which each element represents the height of the student in that position. The task here is to find the number of students whose height is less than the height of their adjacent students. Input: 35, 15, 45,25,55  Output: 2 (35>15<45 and 45>25<55) Explanation :  we take element at index 1 start checking the condition and those who satisfied the condition , will be our output . [ there is no mean to take 1st and last element into the iteration as there are no adjacent element of both side ] Code :  public class Problem3 {     public static void main( String [] args) {                 int arr[]={ 35 , 105 , 45 , 25 , 55 };         int count = 0 ;         for ( int i=

Mission "TCS DIGITAL" ( Upgrade Ninja to Digital ) previous year Coding Quistion 02

  Problem 2 :  Subscribe Please :  click here Q2 : Sum of the digits of the given positive integer number N is UNO or not. Problem Statement :  Given a positive integer number N, reduce the number of digits of N by computing the sum of all the digits to get a new number. If this new number exceeds 9, then sum the digits of this new number to get another number and continue this way until a single digit value is obtained as the ‘digit sum’. The task here is to find out whether the result of the digit sum done this way is ‘1’ or not. If the result is 1 return UNO else not. Input : 254 output : not Input : 235 output : UNO Explation : 1. 254 = 2+5+4 = 11  2. 11>9 3. 11 = 1+1 = 2 4. 2<9 but not 1 so  5. output "NOT" 1. 235 = 2+3+5 =10 2. 10>9 3. 10 = 1+0 = 1 4. 1<9 and sum=1 so 5. output "UNO" Code :  import java.util.Scanner; public class Problem2 {     public static void main( String [] args) {           Scanner sc= new Scanner(System.in);        

Mission "TCS DIGITAL" ( Upgrade Ninja to Digital ) previous year Coding Quistion 01

 Problem 1 : Subscribe the channel :  Click here Q1 .  An automobile company manufactures both a two wheeler (TW) and a four wheeler (FW). A company manager wants to make the production of both types of vehicle according to the given data below: 1st data, Total number of vehicle (two-wheeler + four-wheeler)=v 2nd data, Total number of wheels = W The task is to find how many two-wheelers as well as four-wheelers need to manufacture as per the given data. Example : Input : 200  -> Value of V 540   -> Value of W Output : TW =130 FW=70 Explanation: 130+70 = 200 vehicles (70 *4)+(130* 2)= 540 wheels Constraints : 2<=W W%2=0 V <W Print “INVALID INPUT” , if inputs did not meet the constraints. The input format for testing The candidate has to write the code to accept two positive numbers separated by a new line. First Input line – Accept value of V. Second Input line- Accept value for W. The output format for testing Written program code should generate two outputs, each separate