Skip to main content

Posts

Vowels_Consonants_Count

 Problem Statement Write a Java program to count both vowels and consonants in a given string Conditions Only alphabets should be considered for counting Input Hello World! Output Vowels count - 3 Consonants count - 7 Explanation     The vowels in the given string are e,o and o and so the vowels count is 3. Likewise, the consonants in the given string are h,l,l,w,r,l and d and so the count is 7.

Unique_Characters

  Problem Statement Write a Java program to print the unique characters present in the given string in the same sequence as they appear(the first occurrence) in the input. Condition All the characters should be in lowercase only. Input xperience Output xperinc  

Travel_Agencies

  Problem Statement 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) should matched with the regNo

Space_Character_Count

 Problem Statement Write a Java program to compute the number of spaces and characters in a given string Condition Ignore all the digits Input Hello This is ABCD from XYZ city Output No of spaces : 6 and characters : 26 Explanation     The total number of spaces and all the characters excluding numbers/digits are computed and printed.

Sim_Transfer_Circle

 Problem Statement Create class Sim with below attributes: simId - int customerName - String balance - double ratePerSecond - double circle - String Create class Solution and implement static method "transferCircle" in the Solution class. This method will take array of Sim objects, circle1 String and circle2 string as parameters. And will return another Sim array where the circle1 matches with the circle parameter of the original Sim array and the circle parameter of the new array is set to circle2 and is also sorted by means of ratePerSecond attribute in desending order. Write necessary getters and setters. Before calling "transferCircle" method in the main method, read values for five Sim objects referring the attributes in above sequence along with a String circlee1 and circle2. Then call the "transferCircle" method and write logic in main method to print all the attributes of the result obtained. Input 1 raju 130 1.32 mum 2 sachin 120 2.26 ahd 3 ram 20

Sim_Match_And_Sort

 Problem Statement Create class Sim with below attributes: id - int company - String balance - int ratePerSecond - double circle - String Create class Solution and implement static method "matchAndSort" in the Solution class. This method will take array of Sim objects, search_circle String and search_rate double as parameters. And will return another Sim array where the search_circle matches with the circle parameter of the original Sim array and the search_rate double is greater than the original array of Sim object's ratePerSecond attribute which is also sorted by means of balance attribute in descending order. Write necessary getters and setters. Before calling "matchAndSort" method in the main method, read values for four Sim objects referring the attributes in above sequence along with a String search_circle and a double search_rate. Then call the "matchAndSort" method and write logic in main method to print the id's of the result obtained. In