Skip to main content

Posts

Showing posts from January, 2023

TCS IPA previous year problems solved [input + output ] in JAVA - (35 marks )

  Problem Statement :  Video Link :   Click Here Create a class AutonomousCar with the below attributes: carld – int brand – String   noOfTestsConducted – int noOfTestsPassed- int environment – String grade – String Write getters, setters for the above attributes . Create constructor which takes parameter in the above sequence except grade. Create class Solution with main method. Implement two static methods – findTestPassedByEnv and updateCarGrade in Solution class. findTestPassedByEnv method: This method will take two input parameters -array of AutonomousCar objects and string parameter environment. The method will return the sum of the noOfTestsPassed attribute from autonomousCar objects for the environment passed as parameter. If no autonomousCar with the given environment is present in the array of AutonomousCar objects, then the method should return 0. updateCarGrade method: This method will take a String parameter brand, along with the array of AutonomousCar objects. The method

TCS IPA previous year coding quistion ( 35 marks ) --- ( in JAVA )

        Problem Statement :-   Video Link :  click here Create a class Footwear which consists of the below attributes.   footwearId=int   footwearName=String   footwearType=String   price =int the above attributes should be private. write getter and setter and parametrised constructor as required. create the class footwearProgram with the main method. implement the 1 static methods.getCountByType in the Solution class. getCountByType method:    this method will take two input parameters. array of the Footwear objects and string parameter footwear type. this method will return the count of the footwears from array of the footwear objects for the given type of footwear. if no footwear with the given footwear type is found in the array of footwear abjects,then the method should return 0. for getCountByType method- the main method should print the count of the footwears ,if the returned value is greater than zero. or it should print "Footwear not available"; consider the sample

TCS IPA previous year practice problem 7 ( in JAVA ) ---- ( 15 marks )

  Problem Statement :-  Write a program to print the smallest vowel in a given string ...... Input :           Matrix  output :            a Explanation :      The vowels in the given string are  a  and  i . And the alphabetically smallest between them        is  a . Video Link :    Click here to watch video on youtube Code : import java . util . Scanner ; public class Solution4 {     public static void main ( String [] args ) {         Scanner sc = new Scanner ( System . in );         String word = sc . nextLine ();         String vowels []={ "a" , "e" , "i" , "o" , "u" };         for ( int i = 0 ; i < vowels . length ; i ++){             if ( word . contains ( vowels [ i ])){                 System . out . println ( " Smallest Vowel : " + vowels [ i ]);                 break ;             }         }     } } Thank You ..... Subscribe the Channel ....

TCS IPA Previous Years Coding Problem 6 ( In JAVA )

Problem Statement :- Write a Java program to check whether a given number is a perfect square or not Condition :    Input will only be a positive interger and will not have any decimal or special characters Input :  9 Output :  Perfect Square ? : TRUE  Code : import java . util .*; public class Solution3 {     public static void main ( String [] args ) {         Scanner sc = new Scanner ( System . in );         int n = sc . nextInt ();         for ( int i = 0 ; i < n ; i ++){             int sqr = i * i ;             if ( sqr == n ){                 System . out . println ( "true" );             }         }     } }

TCS IPA coding Problem 5 ( 15 marks ) --- ( with JAVA )

  Problem Statement :  Write a Java program to reverse a given string Condition The reverse string should be printed in lowercase only. Input      WelCome Output emoclew Source Code : import java . util . Scanner ; public class Solution2 {     public static void main ( String [] args ) {         Scanner sc = new Scanner ( System . in );         String st = sc . nextLine ();         String str = st . toLowerCase ();         for ( int i = str . length ()- 1 ; i >= 0 ; i --){             System . out . print ( str . charAt ( i ));         }     } }

TCS IPA previous year quistion ( 35 marks ) , Quistion , Input , output

 Problem Statement Video Link :    https://youtu.be/XCBvfJAo908 Create a class TravelAgencies with below attributes: regNo – int agencyName – String pakageType – String price – int flightFacility – boolean Write getters, setters for the above attributes . Create constructor which takes parameter in the above sequence. Create class Solution with main method. Implement two static methods – findAgencyWithHighestPackagePrice and agencyDetailsforGivenIdAndType in Solution class. findAgencyWithHighestPackagePrice method: This method will take array of TravelAgencies objects as an input parameter and return the highest package price from the given array of objects. agencyDetailsForGivenldAndType method: This method will take three input parameters -array of TravelAgencies objects, int parameter regNo and String parameter packageType. The method will return the TravelAgencies object based on below conditions. FlightFacility should be available. The input parameters(regNo and packageType) shoul