Tcs Xplore IRA code Java Skip to main content

Tcs Xplore IRA code Java

TCS Xplore IRA Java Solution




 import java.io.*;

import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String args[] ) throws Exception { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ Scanner sc=new Scanner(System.in); int n =sc.nextInt(); Customer c[] = new Customer[n]; for(int i=0;i < n;i++){ int id = sc.nextInt(); sc.nextLine(); String name = sc.nextLine(); int loyaltyPoints = sc.nextInt(); c[i] = new Customer(id,name,loyaltyPoints); } int id=sc.nextInt(); Customer c1=getCustomerById(c, id); Customer c2=findCustomer(c); if(c1 != null){ System.out.println("Id-"+c1.getId()); System.out.println("Name-"+c1.getName()); System.out.println("LoyaltyPoints-"+c1.getLoyaltyPoints()); } else{ System.out.println("No Customer found with mentioned attribute"); } if(c2 != null){ System.out.println("Id-"+c2.getId()); System.out.println("Name-"+c2.getName()); System.out.println("LoyaltyPoints-"+c2.getLoyaltyPoints()); } else{ System.out.println("No Customer found with mentioned attribute"); } } public static Customer getCustomerById(Customer c[],int id){ for(Customer c2:c){ if(c2.getId() == id){ return c2; } } return null; } public static Customer findCustomer(Customer c[]){ int max=0; for(Customer c2:c){ if(c2.getLoyaltyPoints() > max){ max = c2.getLoyaltyPoints(); } } for(Customer c2:c){ if(c2.getLoyaltyPoints() == max){ return c2; } } return null; } } class Customer{ private int id; private String name; private int loyaltyPoints; public int getId(){ return id; } public String getName(){ return name; } public int getLoyaltyPoints(){ return loyaltyPoints; }
public Customer(int id,String name,int loyaltyPoints){ this.id=id; this.name=name; this.loyaltyPoints=loyaltyPoints; } public void setId(int id){ this.id=id; } public void setName(String name){ this.name=name; } public void setLoyaltyPoints(int loyaltyPoints){ this.loyaltyPoints=loyaltyPoints; } }

Comments

Popular posts from this blog

The average price of 20 paint brush is $15 while average prices of 18 of those is $12 . for the remaining 2 brushes the prices of 1 is 40% more than that of other

 ques 1 .The average price of 20 paint brush is $15 while average prices of 18 of those is $12 . for the remaining 2 brushes the prices of 1 is 40% more than that of other? answer: brush is $35 and other is $49.  ques 2 .the length and breadth of a rectangular field are 45 m and 30m respectively. find the ratio of the breadth to the length of the field? answer: breadth /length=30/45=2/3=2:3.  ques 3 .A certain distance is covered at a certain speed .if half the distance is covered in double the time,the ratio of the two speeds is? answer: 4:1.  ques 4 .Aman sells 5 articles for rs 15 and makes a profit of 20% .find his gain or loss percent if he sells 8 such articles for Rs 18.40? answer: 8%  loss.  ques 5. In what ratio should  a 20 % methyl alcohol solution be mixed with 50% methyl alcohol solution so that the resultant solution  has 40% methyl alcohol in it? answer: 1:2 . 

Unleashing the Future: AI and ML's Impact on You and the World

 Hey there, tech enthusiast! Remember that time you thought self-driving cars were just science fiction? Well, guess what? AI and ML are making it happen, and that's just the tip of the iceberg! These technologies are changing things faster than ever, from healthcare and finance to art and design. It's like having a superpower that helps us create, learn, and solve problems in ways we never imagined. Here's a taste of what's hot right now: * Machines writing amazing stories and translating languages like a pro? It's called "Large Language Models" and it's changing the game for communication and creativity. * Ever heard of AI learning through playing games? It's called "Deep Reinforcement Learning" and it helps robots master complex skills, making them even better at their jobs. * Imagine AI composing music and creating new artwork. That's "Generative AI" at work, and it's opening up a whole new world of possibilities. *

Do you think layoffs from top IT companies are just the beginning and many more will follow?

 ## Layoffs in IT: Just the Beginning or a Temporary Blip? The recent wave of layoffs in top IT companies has sparked concern about the future of the industry and whether this is just the beginning of a wider trend. While it's difficult to predict the future with certainty, several factors suggest both potential risks and opportunities for the tech workforce. **Possible Drivers of Further Layoffs:** * **Economic Slowdown:** Global economic challenges like inflation, rising interest rates, and potential recession could impact demand for IT services and products, leading to workforce adjustments. * **Overhiring:** Rapid expansion during the pandemic might have resulted in overstaffing, necessitating downsizing as the economy slows. * **Technological Advancements:** Automation and AI are rapidly transforming the industry, potentially displacing human workers in certain roles. * **Market Saturation:** Certain segments, like social media and streaming services, might be reaching saturat

Conquering the Cyber Jungle: Your Guide to Digital Safety and Security

Conquering the Cyber Jungle: Your Guide to Digital Safety and Security. Cybersecurity: Keeping Your Digital World Safe (No Worries, It's Not Scary!) Think of the internet as your awesome new neighborhood. It's full of exciting things to explore, like games, shops, and ways to connect with friends. But just like any neighborhood, there are some areas you need to be careful in. That's where cybersecurity comes in! Cybersecurity is like having a friendly neighborhood watch program that keeps your online stuff safe. It's all about protecting your information and devices from bad guys trying to steal it or cause trouble. Here are some simple tips to make your online adventures safe and secure: Choose strong passwords: Imagine a password as your house key. A strong password is like a complicated key that's hard for anyone else to guess. Try mixing uppercase and lowercase letters, numbers, and symbols for extra strength. Be careful what you share online: Think before you

TCS is forcing employees to start work from the office

  TCS is forcing employees to start work from the office , whereas employees don't want to go to the office. 1. How TCS forcing employees to start work from the office : In TCS many projects are there, in one project they have an Hr, a manager, and a team lead.so what they are doing, is they have a daily discussion call, they are adding a manager to the call and then the team lead just initiate the conversation and tends it to work from office status. Suddenly Manager starts giving advice that as covid has ended the world has started working from the office so we should have to start working from the office. I have sent a roster to all team members where I have set three days of work in a week. You must have to come to your depute branch and start work from the office. TCS COMPANY  2. What will happen if the employee didn't go to the office : They have warned that we will cut your leave if all of your leaves will be deducted we will cut your salary and if further, you will not

REET 2022:REET Mains Exam Date release, Notification & Latest Updates| REET level 2 controversy

  REET 2022 pre has been successfully conducted. The REET Mains Exam Date is 4th-5th February 2023. Their is one controversy generated. level 2 students blaiming to government that they have cut down  6000 seats and added in level 1 . Check the information for Notification, Vacancy, and Latest News for Preliminary and Mains exams REET Mains Exam Date is already declared. The exam is scheduled to be held on 4th February 2023 and 5th February 2023. The preliminary exams have been successfully completed and the result is already declared. The candidates who have successfully qualified the exam can apply for the mains exam. Candidates can check the result on the official website. The exam is conducted in level 1 and level 2 prelims exams and result for the same is already released by the Rajasthan Board of Secondary Education (BSER) on the official website. Rajasthan Board of Secondary Education administers the Rajasthan Eligibility Test for teachers. REET ensures fantastic opportunities f

TCS Xplore IRA 6thSep2021 Python and Java SBQ

Create a class Leave with the below attributes:   leaveId of type int leaveType of type String having values as EL/CL/SL noOfDays type int dateOfApplication of type String in the format dd-mm-yy (12-07-21)   Note: leaveType EL represents Earned Leave, CL is Casual Leave and SL is Sick Leave. Assume that Leave details are only for the year 2021.     Create the init method which takes the parameters in the above sequence. The method should set the value of attributes to parameter values.     Create another class Employee with the below two attributes: 1. leaveList of type List having Leave objects 2. leaveBalance of type Dictionary having leaveType as Key and remaining leaves of that type as Value. Eg. {EL:20,CL:2,SL:31}   Create the init method which takes all parameters in the above sequence. The method should set the value of attributes to parameter values inside the method. Create below two methods inside the Employee class:   1. getUpdatedLeaveBalance - This method checks for t

Israel Palestine War - What is Happening - Explained by Dhruv Rathee

 नमस्कार दोस्तों, इजराइल और पलेस्टीन के बीच में एक बार फिर से जंग चिड़ चुकी हैं.7 उक्टूबर, सुभे 6.30 बज़े की बात हैं,जब ज्यादतर इस्रायली लोग अपनी घरों में सो रहे थे,कि आचानक से एर रेड साइरन्स बजने लगते हैं.कुछ ही देर बाद रोकिट्स बरसने लगते हैं इस्रायल के शहरों पर हजारों की संक्या में. इस्रायली डिफेंस फोर्सेज एस्टिमेट करती हैं,2,200 रोकिट्स फायर किये गए.हमास ग्रूब कहता है कि 5,000 रोकिट्स फायर किये गए.अब आमतोर पर इस्रायल के पास एक आइरन डोम सिस्टम हैं. यह दुनिया के वन अवध बेस्ट एर डिफेंस सिस्टम में से हैं.जब भी रोकिट्स की इस तरीके से बरसात होती है,यह लेटिस्ट मिलिटरी टेकनॉलिजी का इस्तिमाल करके उन रोकिट्स को इंटरसेप्ट करता हैऔर हवा में ही डिस्ट्रॉय कर देता है इस्रायल देश को प्रोटेक्टिड रखने के लिए. लेकिन यहाँ पर 5000 रोकिट्स फायर किये गए 20 मिनट के अंदर-अंदर.यह आइरन्डोम सिस्टम भी फेल रहा.हजारों की संख्या में इस्रायल में लोग मारे गएऔर जखमी हुए इन अटैक्स के चलते. यह सरप्राइज अटैक पिछले कई दशकों मेंसबसे बड़ा हमला है जो इस्रायल-पलेस्टीन कॉनफ्लिक्ट में देखा गया हैऔर यह याद दिलाता है योम-किपुर व

Happy Diwali Wishes in English link ,text and Deepawali Greetings 2022

Diwali  is a New Year celebration for Hindus, Jains, Sikhs, and some  Muslims  and  Buddhists . This year, the five-day holiday falls in  October   (starting Monday, October 24, 2022). The festival of lights, popular in South Asian countries and among those of South Asian descent, is marked by oil lamps called diyas, to honor the goddess of wealth and prosperity Lakshmi, and to symbolize the triumph of light over darkness. It's a joyous time, and while it has some religious roots, it's become a secular holiday in many areas of the world and across several cultures. If you or someone you love is celebrating Diwali and you'd like to honor them, these  happy  Diwali wishes  and  Diwali greetings  will surely brighten someone's day. Diwali Wishes 1.  Have a happy  and fresh Diwali  2. May your Diwali be free from darkness and abundant with light 3. Have a fun and festive Diwali 4.  Hoping your Diwali brings health, wealth, and happiness 5.  May your Diwali bring Peace and l