├── AWS ├── Angular-Spring-REST-Integration-Hands-on.zip ├── Apache-Kafka-On-Prem-Hands-On (1).zip ├── Apache-Kafka-S3-HandsOn.zip ├── Creating-MSK-Cluster-Hands-on.zip ├── Deploy-Producer-Consumer-in-EC2-Hands-on.zip ├── DynamoDB-Hands-on.zip ├── Ec-2 Hands-on.zip ├── Microservice-with-DynamoDB-backend.zip ├── RDS-Hands-on (1).zip ├── SQS-Hands-On.zip ├── Swagger.zip ├── read.txt └── s3-handson (1).zip ├── Data Structures and Algorithms ├── 2d_array.java ├── array_ds.java ├── array_manipulation.java ├── balanced_bracket.java ├── between_two_sets.java ├── components_in_graph.java ├── delete_duplicate_values.java ├── divisible_sum_pair.java ├── find_the_running_median.java ├── forming_a_magic_squre.java ├── left_rotation.java ├── min-max_sum.java ├── queue_using_two_stack.java ├── sparse_array.java └── time_conversion.java ├── README.md ├── SQL programming ├── Buses based on Source and Destination │ ├── query.sql │ └── readme.md ├── Car & owner details based on car type │ ├── README.md │ └── query.sql ├── Car details based on type and name │ ├── README.md │ └── query.sql ├── Car rental system - Create Table │ ├── README.md │ └── query.sql ├── Car rental system - add new column │ ├── README.md │ └── query.sql ├── Cars not taken for rent │ ├── README.md │ └── query.sql ├── Concatenating Details │ ├── README.md │ └── singlerow3.sql ├── Credential details │ ├── README.md │ └── query.sql ├── Customer contact details │ ├── README.md │ └── query.sql ├── Customer mail details │ ├── README.md │ └── sample.sql ├── Customer using HDFC bank │ ├── query.sql │ └── question.pdf ├── Customers having gmail id │ ├── READEME.md │ └── query.sql ├── Delivery Partner details based on rating │ ├── README.md │ └── sample.sql ├── Department name based on block number │ ├── README.md │ └── bselect3.sql ├── Hostel-Insert Student Records set2 │ ├── README.md │ ├── database_diagram.png │ └── ddl4.sql ├── Hotel_info │ ├── README.md │ └── sample.sql ├── Hotels not taken orders in a specific month │ ├── README.md │ └── sample.sql ├── Hotels that took order based on month │ ├── README.md │ └── sample.sql ├── Hotels that took order more than five times │ └── sample.sql ├── Hunger eats - Change the field name │ ├── README.md │ └── sample.sql ├── Hunger eats - change datatype │ ├── README.md │ └── sample.sql ├── Hunger eats - update table │ ├── README.md │ ├── sample.sql │ └── table_data.png ├── Insert Records - Department │ ├── README.md │ └── insert.sql ├── Maruthi car owner details │ ├── README.md │ └── query.sql ├── Minimum & Maximum Discount Amount │ ├── README.md │ ├── database_diagram.png │ └── group3.sql ├── Movie-Modify the datatype set2 │ ├── README.md │ └── dml2.sql ├── No of time rented by each car │ ├── README.md │ └── query.sql ├── Number of Tickets Booked │ ├── README.md..txt │ └── query.sql ├── Order details │ ├── README.md │ └── sample.sql ├── PL_SQL │ ├── Display_department_names_using_Cursors.sql │ ├── Insert_Record_using_Anonymous_Block.sql │ ├── Package_with_a_Procedure_to_update_salary.sql │ ├── Procedure_with_Exception_Handling.sql │ ├── area_of_a_circle.sql │ ├── insert_a_record_trigger.sql │ ├── insert_credit_procedure.sql │ ├── select_city_procedure.sql │ └── update_location.sql ├── Password Generation │ ├── query.sql │ └── question.pdf ├── Patient Appointment Details based on reason │ ├── README.md │ ├── database_diagram.png │ └── query.sql ├── Patient Appointment details Based On Month │ ├── README.md │ ├── database_diagram.png │ └── join3.sql ├── Rental details based on date │ ├── README.md │ └── query.sql ├── Review of delivery partner based on rating │ ├── README.md │ └── sample.sql ├── Student and their Department Based on City │ ├── README.md │ └── joins3.sql ├── Total sale daywise │ ├── README.md │ └── sample.sql ├── Username and password │ ├── query.sql │ └── question.docx └── car rental system - Insert values │ ├── README.md │ ├── query.sql │ └── table_data.png ├── code quality ├── FlightManagement-2.zip ├── TraineeManager.zip ├── patient-intake-system.zip └── read.txt ├── html_css ├── bill calculator.txt ├── feedback details.txt ├── learning material styling.txt ├── simple calculatro.txt └── trainer feedback rating chart.txt ├── java programming ├── Account Manipulation - Abstract Class │ ├── Account.java │ ├── Customer.java │ ├── Main.java │ ├── README.md │ └── SavingsAccount.java ├── Add Flight using JDBC │ ├── DB.java │ ├── Flight.java │ ├── FlightManagementSystem.java │ ├── Main.java │ ├── README.md │ └── database.properties ├── Array Compatibility │ ├── CompatibleArrays.java │ └── README.md ├── Array Manipulation - Use try with multi catch │ ├── ArrayException.java │ └── README.md ├── Auditing │ ├── EmployeeAudit.java │ └── Main.java ├── Average and Grade Calculation │ ├── README.md │ ├── Student.java │ └── StudentMain.java ├── Bank Account - Interface │ ├── Account.java │ ├── CurrentAccount.java │ ├── MaintenanceCharge.java │ ├── README.md │ ├── SavingsAccount.java │ └── UserInterface.java ├── BankAccountDetails │ ├── Account.java │ └── AccountDetails.java ├── Batting Average │ ├── README.md │ └── com │ │ ├── ui │ │ └── UserInterface.java │ │ └── utility │ │ └── Player.java ├── Bill Generator │ ├── README.md │ └── SnackDetails.java ├── Book Manipulation │ ├── Book.java │ ├── Library.java │ ├── Main.java │ └── README.md ├── Check Number Type │ ├── NumberType.java │ ├── NumberTypeUtility.java │ └── README.md ├── Collage Account │ ├── README.md │ ├── TuitionFee.java │ └── UserInterface.java ├── Contact Details of Hosteller │ ├── Hosteller.java │ ├── Main.java │ ├── README.md │ └── Student.java ├── Count of Each Words │ ├── CountOfWords.java │ └── README.md ├── Cumulative sun in an array │ ├── CumulativeSum.java │ └── README.md ├── Display Characters │ ├── AsciValue.java │ └── README.md ├── Divider two number - Use finally │ ├── Division.java │ └── README.md ├── DreamTek Company │ ├── Associate.java │ ├── Main.java │ ├── READEME.md │ └── picture.jpg ├── Employee ID Validation │ ├── README.md │ └── UserMain.java ├── Employee Loan Eligibility - Polymorphism │ ├── Employee.java │ ├── Loan.java │ ├── Main.java │ ├── PermanentEmployee.java │ ├── README.md │ └── TemporaryEmployee.java ├── Employee Loan Eligibility │ ├── Employee.java │ ├── Employeeutility.java │ ├── main.java │ └── question.pdf ├── Employee Promotion │ ├── Employee.java │ ├── Main.java │ └── Management.java ├── Employee Salary Calculation │ ├── Employee.java │ ├── Main.java │ └── READEME.md ├── Employees eligible for promotionCoding exercise │ ├── Main.java │ └── README.md ├── Factors of a Number │ ├── FindFactor.java │ └── README.md ├── Find Average Age │ ├── README.md │ └── Test.java ├── Find Season │ ├── README.md │ └── Season.java ├── Find and Replace │ ├── README.md │ └── ReplaceWord.java ├── Fruit Basket Estimation │ ├── FruitBasket.java │ ├── FruitBasketUtility.java │ └── Main.java ├── Fuel Consumption Calculator │ ├── Main.java │ └── README.md ├── Grade Calculation │ ├── GradeCalculator.java │ ├── Main.java │ └── README.md ├── Highest Marks in Each Semester │ ├── HighestMarkPerSem.java │ └── README.md ├── Highest Placement │ ├── Placement.java │ └── README.md ├── Increment Calculation │ ├── IncrementCalcuation.java │ └── README.md ├── InitCap │ ├── InitCap.java │ └── README.md ├── Inner Class │ ├── AddressBook.java │ ├── README.md │ └── TestApplication.java ├── Insurance Bazaar │ ├── README.md │ └── com │ │ ├── ui │ │ └── UserInterface.java │ │ └── utility │ │ └── Bazaar.java ├── Least Offer │ ├── Main.java │ └── README.md ├── List of prime numbers │ ├── PrimeNumbers.java │ └── README.md ├── Lucky Number │ ├── LuckyNum.java │ └── README.md ├── Mall Parking System │ ├── Main.java │ └── README.md ├── Member Manipulation │ ├── Library.java │ ├── Main.java │ ├── Member.java │ └── README.md ├── Movie Ticket Calculation │ ├── CinemaTicket.java │ └── README.md ├── Number Palindrome │ ├── Palindrome.java │ └── README.md ├── Number of New Words │ ├── README.md │ └── UniqueWords.java ├── Numerology number │ ├── Main.java │ └── README.md ├── Numerology │ ├── Numerology.java │ └── README.md ├── Palindrome │ ├── Palindrome.java │ └── README.md ├── Participant List Manipulation │ ├── Main.java │ ├── Participant.java │ ├── ParticipantUtility.java │ └── README.md ├── Password Generation │ ├── Main.java │ └── README.md ├── Persist Employee │ ├── Employee.java │ ├── EmployeeUtility.java │ ├── Main.java │ └── README.md ├── PhoneBook Manipulation │ ├── Contact.java │ ├── Main.java │ ├── PhoneBook.java │ └── README.md ├── Placement Enrollment Count │ ├── main.java │ └── question.pdf ├── Player Selection System_JDBC │ ├── DB.java │ ├── Main.java │ ├── Player.java │ ├── PlayerSelectionSystem.java │ └── database.properties ├── Print unique characters │ ├── README.md │ └── UniqueChar.java ├── Register a Candidate - User defined Exception(with throw and throws) │ ├── Candidate.java │ ├── InvalidSalaryException.java │ ├── Main.java │ └── README.md ├── Retrieve ID and Price of mobiles with in the range │ ├── DB.java │ ├── Main.java │ ├── Mobile.java │ ├── MobileManagementSystem.java │ ├── README.md │ ├── database.properties.txt │ └── script.sql ├── Retrieve customer count based on loan type │ ├── DB.java │ ├── Loan.java │ ├── LoanManagementSystem.java │ ├── Main.java │ ├── README.md │ ├── database.properties.txt │ └── script.sql ├── Retriving Data from file │ ├── FileDemo.java │ ├── README.md │ └── log.txt ├── Search a Course │ ├── Course.java │ └── README.md ├── Search for Trains - JDBC │ ├── DB.java │ ├── Database.properties │ ├── Main.java │ ├── Train.java │ ├── Trainmamagementsystem.java │ └── question.pdf ├── Shape - Area Volume Calculator │ ├── Cube.java │ ├── Main.java │ ├── README.md │ ├── Rectangle.java │ ├── Shape.java │ ├── Spatial.java │ ├── Sphere.java │ └── Triangle.java ├── String Concatenation │ ├── javacode.java │ └── question.pdf ├── Students Details - Constructor │ ├── README.md │ ├── Student.java │ └── StudentMain.java ├── Substitution Cipher Technique │ ├── Main.java │ └── README.md ├── Ticket Price Calculation - Static │ ├── Main.java │ ├── README.md │ └── Ticket.java ├── Travel Agency │ ├── CommissionInfo.java │ ├── Ticket.java │ ├── UserInterface.java │ └── question.pdf ├── Validate Name │ ├── README.md │ ├── Validate.java │ └── ValidateUtility.java ├── Validate PAN │ ├── PanCard.java │ └── README.md ├── Vehicle-Loan-Insurance - Use Interface │ ├── Insurance.java │ ├── Loan.java │ ├── Main.java │ ├── README.md │ └── Vehicle.java ├── Visitors Details │ ├── FileManager.java │ ├── Main.java │ └── README.md ├── ZeeZee Bank │ ├── Account.java │ ├── Main.java │ └── README.md └── uwu.txt ├── java_script ├── emp experience.js ├── greeting.txt ├── placing order for cake.txt ├── reduction of loan.txt ├── unique character.txt ├── validate email.txt └── word play.txt ├── jquery ├── alternative rows.txt ├── customer data.txt ├── error message.txt ├── get json data.txt ├── ice cream flovour.txt ├── load jquery.txt ├── login form.txt ├── select the boxes.txt ├── three divition.txt ├── vertical menu.txt └── wellcome msg.txt ├── microservice ├── MS_HANDSON-01.zip ├── MS_HANDSON-02.zip ├── MS_HANDSON-03.zip └── read.txt ├── react ├── ReactJS-HOL_001.zip ├── ReactJS-HOL_002.zip ├── ReactJS-HOL_003.zip ├── ReactJS-HOL_004.zip ├── ReactJS-HOL_005.zip ├── ReactJS-HOL_006.zip ├── ReactJS-HOL_007.zip ├── ReactJS-HOL_008.zip ├── ReactJS-HOL_009.zip ├── ReactJS-HOL_010.zip ├── ReactJS-HOL_011.zip ├── ReactJS-HOL_012.zip ├── ReactJS-HOL_013.zip └── read.txt ├── spring data ├── 04 - 01 Spring-data-jpa-Hands on.zip ├── 04 - 02 Spring-data-jpa-Hands on.zip ├── 04 - 03 Spring-data-jpa-Hands on.zip └── read.txt ├── spring rest ├── 03-01-spring-rest-handson.zip ├── 03-02-spring-rest-handson.zip ├── 03-03-spring-rest-handson.zip ├── 03-04-spring-rest-handson.zip ├── JWT-handson (1).zip └── read.txt └── unix and shell scripting ├── copy_complete_directrory.sh ├── copy_directrory.sh ├── copy_file5.sh ├── copy_file6.sh ├── find_string7.sh ├── find_string8.sh ├── grep_command1.sh ├── grep_command2.sh ├── list_of_files2.sh ├── list_of_files3.sh ├── move_file1.sh ├── move_file2.sh ├── pattern_printing.sh ├── script_to_count.sh └── shellScripting.sh /AWS/Angular-Spring-REST-Integration-Hands-on.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/AWS/Angular-Spring-REST-Integration-Hands-on.zip -------------------------------------------------------------------------------- /AWS/Apache-Kafka-On-Prem-Hands-On (1).zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/AWS/Apache-Kafka-On-Prem-Hands-On (1).zip -------------------------------------------------------------------------------- /AWS/Apache-Kafka-S3-HandsOn.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/AWS/Apache-Kafka-S3-HandsOn.zip -------------------------------------------------------------------------------- /AWS/Creating-MSK-Cluster-Hands-on.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/AWS/Creating-MSK-Cluster-Hands-on.zip -------------------------------------------------------------------------------- /AWS/Deploy-Producer-Consumer-in-EC2-Hands-on.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/AWS/Deploy-Producer-Consumer-in-EC2-Hands-on.zip -------------------------------------------------------------------------------- /AWS/DynamoDB-Hands-on.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/AWS/DynamoDB-Hands-on.zip -------------------------------------------------------------------------------- /AWS/Ec-2 Hands-on.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/AWS/Ec-2 Hands-on.zip -------------------------------------------------------------------------------- /AWS/Microservice-with-DynamoDB-backend.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/AWS/Microservice-with-DynamoDB-backend.zip -------------------------------------------------------------------------------- /AWS/RDS-Hands-on (1).zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/AWS/RDS-Hands-on (1).zip -------------------------------------------------------------------------------- /AWS/SQS-Hands-On.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/AWS/SQS-Hands-On.zip -------------------------------------------------------------------------------- /AWS/Swagger.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/AWS/Swagger.zip -------------------------------------------------------------------------------- /AWS/read.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /AWS/s3-handson (1).zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/AWS/s3-handson (1).zip -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # learning_path_JF 2 | 3 | 4 | Its a learning path of a java full stack developer. 5 | 6 | 7 | you will find lots of code in this . I hope most of the code is helpful . 8 | 9 | 10 | #HAPPY_CODING 11 | -------------------------------------------------------------------------------- /SQL programming/Buses based on Source and Destination/query.sql: -------------------------------------------------------------------------------- 1 | select distinct s1.bus_no, 2 | b.bus_name 3 | from schedule s1 4 | inner join schedule s2 on s1.source = s2.destination 5 | and s1.destination = s2.source 6 | inner join buses b on s1.bus_no = b.bus_no 7 | order by s1.bus_no; 8 | 9 | select distinct s1.bus_no, 10 | b.bus_name 11 | from schedule s1, 12 | schedule s2, 13 | buses b 14 | where s1.source = s2.destination 15 | and s1.destination = s2.source 16 | and s1.bus_no = b.bus_no 17 | order by s1.bus_no; -------------------------------------------------------------------------------- /SQL programming/Buses based on Source and Destination/readme.md: -------------------------------------------------------------------------------- 1 | # Buses based on Source and Destination 2 | 3 | Write a query to display the list of bus numbers and names where the source and destination of a bus is the destination and source of another bus. Display the unique records in ascending order by bus_no. 4 | 5 | > **Note:** 6 | > Evaluate only the respective query to get the desired result. 7 | 8 | ![database diagram](../../../database_4.jpg) -------------------------------------------------------------------------------- /SQL programming/Car & owner details based on car type/README.md: -------------------------------------------------------------------------------- 1 | # Car & owner details based on car type 2 | 3 | Write a query to display car id, car name and owner id of all the cars whose car type is 'Hatchback' or 'SUV'. Sort the result based on car id. 4 | 5 | > (Hint: Use CARS tables to retrieve records. Data is case-sensitive. E.g: Car_type='Hatchback'. Use IN operator) 6 | 7 | *NOTE: Maintain the same sequence of column order, as specified in the question description* 8 | 9 | ![database diagram](../database_2.png) 10 | -------------------------------------------------------------------------------- /SQL programming/Car & owner details based on car type/query.sql: -------------------------------------------------------------------------------- 1 | select car_id, car_name, owner_id 2 | from cars 3 | where car_type in ("Hatchback", "SUV") 4 | order by car_id; -------------------------------------------------------------------------------- /SQL programming/Car details based on type and name/README.md: -------------------------------------------------------------------------------- 1 | # Car details based on type and name 2 | 3 | Write a query to display car id, car name and car type of Maruthi company 'Sedan' type cars. Sort the result based on car id. 4 | 5 | > (HINT : Use Cars table to retrieve records.car name='Maruthi Swift'.car type='Sedan'.Data is case sensitive.) 6 | 7 | *NOTE: Maintain the same sequence of column order, as specified in the question description* 8 | 9 | ![database diagram](../database_2.png) -------------------------------------------------------------------------------- /SQL programming/Car details based on type and name/query.sql: -------------------------------------------------------------------------------- 1 | select car_id, car_name, car_type 2 | from cars 3 | where car_name like "Maruthi%" 4 | and car_type = "Sedan" 5 | order by car_id; -------------------------------------------------------------------------------- /SQL programming/Car rental system - Create Table/README.md: -------------------------------------------------------------------------------- 1 | # Car rental system - Create Table 2 | 3 | Refer to the given schema. 4 | 5 | Write a query to create the Owners table with the specified columns and constraints. 6 | 7 | *Note: Letters in bold represents the table name* 8 | 9 | *Note: Maintain the same sequence of column order, as specified in the question description* 10 | 11 | ![database diagram](../database_2.png) -------------------------------------------------------------------------------- /SQL programming/Car rental system - Create Table/query.sql: -------------------------------------------------------------------------------- 1 | create table owners 2 | ( 3 | owner_id VARCHAR(10) primary key, 4 | owner_name varchar(20), 5 | address varchar(20), 6 | phone_no bigint, 7 | email_id varchar(20) 8 | ); -------------------------------------------------------------------------------- /SQL programming/Car rental system - add new column/README.md: -------------------------------------------------------------------------------- 1 | # Car rental system - add new column 2 | 3 | Refer to the given schema. Assume, CARS table has been already created. Write an appropriate query for the given requirement. 4 | Requirement 1: Add a new column Car_Regno VARCHAR(10) to the Cars table. 5 | 6 | *Note: Letters in the bold represents the attribute name.* 7 | 8 | ![database diagram](../database_2.png) -------------------------------------------------------------------------------- /SQL programming/Car rental system - add new column/query.sql: -------------------------------------------------------------------------------- 1 | alter table cars 2 | add column car_regno varchar(10); -------------------------------------------------------------------------------- /SQL programming/Cars not taken for rent/README.md: -------------------------------------------------------------------------------- 1 | # Cars not taken for rent 2 | 3 | Write a query to display car id, car name, car type of cars which was not taken for rent. Sort the result based on car id. 4 | 5 | > HINT: Use Cars and Rentals tables to retrieve records. 6 | 7 | *NOTE: Maintain the same sequence of column order, as specified in the question description* 8 | 9 | ![database diagram](../database_2.png) -------------------------------------------------------------------------------- /SQL programming/Cars not taken for rent/query.sql: -------------------------------------------------------------------------------- 1 | select car_id, car_name, car_type 2 | from cars 3 | where car_id not in (select distinct car_id from rentals); -------------------------------------------------------------------------------- /SQL programming/Concatenating Details/README.md: -------------------------------------------------------------------------------- 1 | # Concatenating Details 2 | 3 | Write a query to display address details by concatenating address and city of students . Give an alias as Address and sort the result based on the concatenated column in descending order 4 | 5 | > Example: 6 | 7 | Address - Toms Town 8 | 9 | City - Bangalore 10 | 11 | > Output: 12 | 13 | Toms Town, Bangalore 14 | 15 | ![database diagram](../database_1.jpg) -------------------------------------------------------------------------------- /SQL programming/Concatenating Details/singlerow3.sql: -------------------------------------------------------------------------------- 1 | select concat(address, ', ', city) as address 2 | from student 3 | order by concat(address, city) desc; -------------------------------------------------------------------------------- /SQL programming/Credential details/README.md: -------------------------------------------------------------------------------- 1 | # Credential details 2 | 3 | Refer to the schema. Write a query to display the username and password of all owners. Give an alias name as USERNAME and PASSWORD. Sort the result based on the username in ascending order. 4 | 5 | Username and password is generated as mentioned below 6 | 7 | USERNAME: concatenate the owner's name with owner id. 8 | 9 | PASSWORD: concatenate first 3 character of owner name with owner id. 10 | 11 | > For Example: 12 | 13 | Owner_id - 01 14 | 15 | Owner_name - jeeva 16 | 17 | > Sample Output: 18 | 19 | USERNAME PASSWORD 20 | jeeva01 jee01 21 | 22 | 23 | > HINT: Use Owners table to retrieve records. 24 | 25 | *NOTE: Maintain the same sequence of column order, as specified in the question description* 26 | 27 | ![database diagram](../database_2.png) -------------------------------------------------------------------------------- /SQL programming/Credential details/query.sql: -------------------------------------------------------------------------------- 1 | select concat(owner_name, owner_id) as username, concat(left(owner_name, 3), owner_id) as password 2 | from owners 3 | order by concat(owner_name, owner_id); -------------------------------------------------------------------------------- /SQL programming/Customer contact details/README.md: -------------------------------------------------------------------------------- 1 | # Customer contact details 2 | 3 | Write a query to display the customer id, customer name and contact details of customers. If address is missing, display the email id. If both address and email is missing then display ‘NA’. Give an alias name as CONTACT_DETAILS.Sort the results based on customer id in ascending order. 4 | 5 | > (HINT : Use Customers table to retrieve records.) 6 | 7 | ![database diagram](../database_2.png) -------------------------------------------------------------------------------- /SQL programming/Customer contact details/query.sql: -------------------------------------------------------------------------------- 1 | select customer_id, customer_name, ifnull(address, ifnull(email_id, "NA")) as contact_details 2 | from customes 3 | order by customer_id; -------------------------------------------------------------------------------- /SQL programming/Customer mail details/README.md: -------------------------------------------------------------------------------- 1 | # Customer mail details 2 | 3 | Refer to the schema. Write a query to display the customer mail details. Display the details in the below format. 4 | 5 | Give an alias name as CUSTOMER_MAIL_INFO. Sort the result in ascending order. 6 | 7 | > For Example: 8 | 9 | Customer_id - 'CUST001' 10 | 11 | Email_id - 'mano@hotmail.com' 12 | 13 | > Sample Output: 14 | 15 | CUSTOMER_MAIL_INFO 16 | CUST001 mail id is mano@hotmail.com 17 | 18 | 19 | > HINT: Use Customers table to retrieve records. 20 | 21 | *NOTE: Maintain the same sequence of column order, as specified in the question description* 22 | 23 | ![database diagram](../database_3.png) -------------------------------------------------------------------------------- /SQL programming/Customer mail details/sample.sql: -------------------------------------------------------------------------------- 1 | select concat(customer_id, ' mail id is ', email_id) as customer_mail_info 2 | from customers; -------------------------------------------------------------------------------- /SQL programming/Customer using HDFC bank/query.sql: -------------------------------------------------------------------------------- 1 | select distinct u.name, u.address from users u 2 | join bookingdetails b on b.user_id = u.user_id 3 | where u.user_id not in 4 | ( select user_id from bookingdetails where name='HDFC') 5 | order by u.name; 6 | -------------------------------------------------------------------------------- /SQL programming/Customer using HDFC bank/question.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/SQL programming/Customer using HDFC bank/question.pdf -------------------------------------------------------------------------------- /SQL programming/Customers having gmail id/READEME.md: -------------------------------------------------------------------------------- 1 | # Customers having gmail id 2 | 3 | Write a query to display customer id, customer name, address, and phone number of customers having Gmail id. Sort the result based on customer id. 4 | 5 | > (HINT: Use Customers table to retrieve records. Email id='xxxxx@gmail.com'.Data is case sensitive.) 6 | 7 | *NOTE: Maintain the same sequence of column order, as specified in the question description* 8 | 9 | ![database diagram](../database_2.png) -------------------------------------------------------------------------------- /SQL programming/Customers having gmail id/query.sql: -------------------------------------------------------------------------------- 1 | select customer_id, customer_name, address, phone_no 2 | from customers 3 | where email_id like "%gmail%" 4 | order by customer_id; -------------------------------------------------------------------------------- /SQL programming/Delivery Partner details based on rating/README.md: -------------------------------------------------------------------------------- 1 | # Delivery Partner details based on rating 2 | 3 | Write a query to display partner id, partner name, phone number of delivery partners whose rating is between 3 to 5, sort the result based on partner id. 4 | 5 | > (Hint: Use Delivery_partners table to retrieve records.) 6 | 7 | *NOTE: Maintain the same sequence of column order, as specified in the question description* 8 | 9 | ![database diagram](../database_3.png) -------------------------------------------------------------------------------- /SQL programming/Delivery Partner details based on rating/sample.sql: -------------------------------------------------------------------------------- 1 | SELECT partner_id, partner_name, phone_no 2 | from delivery_partners 3 | where rating between 3 and 5 4 | order by partner_id; -------------------------------------------------------------------------------- /SQL programming/Department name based on block number/README.md: -------------------------------------------------------------------------------- 1 | # Department name based on block number 2 | 3 | Write a query to display the names of the departments in block number 3. Sort the records in ascending order. 4 | 5 | ![database diagram](../database_1.jpg) -------------------------------------------------------------------------------- /SQL programming/Department name based on block number/bselect3.sql: -------------------------------------------------------------------------------- 1 | select department_name 2 | from department 3 | where department_block_number = 3 4 | order by department_name; -------------------------------------------------------------------------------- /SQL programming/Hostel-Insert Student Records set2/README.md: -------------------------------------------------------------------------------- 1 | # Movie-Modify the datatype set2 2 | 3 | Refer to the given schema. Assume that the Customer_master table has been already created. 4 | 5 | Write a query to change the data type of the field phone_no in Customer_Master table to int(10). 6 | 7 | ![database diagram](database_diagram.png) -------------------------------------------------------------------------------- /SQL programming/Hostel-Insert Student Records set2/database_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/SQL programming/Hostel-Insert Student Records set2/database_diagram.png -------------------------------------------------------------------------------- /SQL programming/Hostel-Insert Student Records set2/ddl4.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE CUSTOMER_MASTER 2 | MODIFY COLUMN PHONE_NO(10); -------------------------------------------------------------------------------- /SQL programming/Hotel_info/README.md: -------------------------------------------------------------------------------- 1 | # Hotel_info 2 | 3 | Refer to the schema. Write a query to display the hotel name along with the type. Display the details in the below format. 4 | 5 | Give an alias name as `hotel_info`. Sort the result in descending order. 6 | 7 | > For Example: 8 | 9 | Hotel_name - 'A2B' 10 | 11 | Hotel_type - 'VEG' 12 | 13 | Sample Output: 14 | 15 | | hotel_info | 16 | | ---------- | 17 | | A2B is a VEG hotel | 18 | 19 | 20 | > HINT: Use Hotel_details table to retrieve records. 21 | 22 | *NOTE: Maintain the same sequence of column order, as specified in the question description* 23 | 24 | ![database diagram](../database_3.png) -------------------------------------------------------------------------------- /SQL programming/Hotel_info/sample.sql: -------------------------------------------------------------------------------- 1 | select concat(hotel_name, ' is a ', hotel_type, ' hotel') as hotel_info 2 | from hotel_details 3 | order by hotel_name desc; -------------------------------------------------------------------------------- /SQL programming/Hotels not taken orders in a specific month/README.md: -------------------------------------------------------------------------------- 1 | # Hotels not taken orders in a specific month 2 | 3 | Write a query to display hotel id, hotel name and hotel type of hotels which has not taken any orders in the month of 'MAY 19'. Sort the result based on hotel id in ascending order. 4 | 5 | > HINT: Use Hotel_details and Orders tables to retrieve records. Eg: order_date= 2019-05-12 6 | 7 | *NOTE: Maintain the same sequence of column order, as specified in the question description* 8 | 9 | ![database diagram](../database_3.png) -------------------------------------------------------------------------------- /SQL programming/Hotels not taken orders in a specific month/sample.sql: -------------------------------------------------------------------------------- 1 | select hotel_id, hotel_name, hotel_type 2 | from hotel_details 3 | where hotel_id not in (select hotel_id 4 | from orders 5 | where month(order_date) = 5 and year(order_date) = 2019); -------------------------------------------------------------------------------- /SQL programming/Hotels that took order based on month/README.md: -------------------------------------------------------------------------------- 1 | # Hotels that took order based on month 2 | 3 | Write a query to display distinct hotel id, hotel name, and rating of hotels that have taken order in the month of July. Sort the result based on hotel id in ascending order. 4 | 5 | > (HINT: Use Hotel_details and Orders tables to retrieve records.Order date='2019-07-14') 6 | 7 | *NOTE: Maintain the same sequence of column order, as specified in the question description* 8 | 9 | ![database diagram](../database_3.png) -------------------------------------------------------------------------------- /SQL programming/Hotels that took order based on month/sample.sql: -------------------------------------------------------------------------------- 1 | select distinct hotel_details.hotel_id, hotel_details.hotel_name, hotel_details.rating 2 | from hotel_details, orders 3 | where hotel_details.hotel_id = orders.hotel_id 4 | and month(orders.order_date) = 7 5 | order by hotel_details.hotel_id; -------------------------------------------------------------------------------- /SQL programming/Hotels that took order more than five times/sample.sql: -------------------------------------------------------------------------------- 1 | select orders.hotel_id, hotel_details.hotel_name, count(orders.order_id) as no_of_orders 2 | from orders, hotel_details 3 | where orders.hotel_id = hotel_details.hotel_id 4 | group by hotel_id 5 | having count(orders.order_id) > 5; -------------------------------------------------------------------------------- /SQL programming/Hunger eats - Change the field name/README.md: -------------------------------------------------------------------------------- 1 | # Hunger eats - Change the field name 2 | 3 | Write appropriate query/queries for the given requirement. Assume, Hotel_Details table has been already created. 4 | 5 | Requirement 1: Change the name of the existing field Rating to Hotel_Rating in the Hotel_Details table. 6 | 7 | *Note: Letters in the bold represents the attributes* 8 | 9 | ![database diagram](../database_3.png) -------------------------------------------------------------------------------- /SQL programming/Hunger eats - Change the field name/sample.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE hotel_details 2 | CHANGE rating hotel_rating INT; -------------------------------------------------------------------------------- /SQL programming/Hunger eats - change datatype/README.md: -------------------------------------------------------------------------------- 1 | # Hunger eats - change datatype 2 | 3 | Refer to the given schema. Assume that the 'Customers' table has been already created. 4 | 5 | Write a query to change the data type of the field customer_id in Customers table to int. 6 | 7 | *Note: Letters in bold represents the attribute name* 8 | 9 | ![database diagram](database_3.png) 10 | -------------------------------------------------------------------------------- /SQL programming/Hunger eats - change datatype/sample.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE customers 2 | MODIFY COLUMN customer_id int; -------------------------------------------------------------------------------- /SQL programming/Hunger eats - update table/README.md: -------------------------------------------------------------------------------- 1 | # Hunger eats - update table 2 | 3 | Refer to the given schema diagram and sample records inserted into the Customers table. 4 | 5 | ![table data][table_data.png] 6 | 7 | Update records based on the given requirement. 8 | 9 | > Requirement 1: update the phone no of the Customers whose id is 'CUST1004' to the new phone no '9876543210' 10 | 11 | *NOTE: Maintain the same sequence of column order, as specified in the question description* 12 | 13 | ![database diagram](../database_3.png) -------------------------------------------------------------------------------- /SQL programming/Hunger eats - update table/sample.sql: -------------------------------------------------------------------------------- 1 | UPDATE customers 2 | SET phone_no = 9876543210 3 | WHERE customer_id = "CUST1004"; -------------------------------------------------------------------------------- /SQL programming/Hunger eats - update table/table_data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/SQL programming/Hunger eats - update table/table_data.png -------------------------------------------------------------------------------- /SQL programming/Insert Records - Department/README.md: -------------------------------------------------------------------------------- 1 | # Insert Records - Department 2 | 3 | Insert the following records into the department table 4 | 5 | | Department_id | Department_name | department_block_number | 6 | | 1 | CSE | 3 | 7 | | 2 | IT | 3 | 8 | | 3 | SE | 3 | 9 | 10 | ![database diagram](../database_1.jpg) -------------------------------------------------------------------------------- /SQL programming/Insert Records - Department/insert.sql: -------------------------------------------------------------------------------- 1 | insert into department (Department_id, Department_name, department_block_number) 2 | values (1, "CSE", 3), 3 | (2, "IT", 3), 4 | (3, "SE", 3); -------------------------------------------------------------------------------- /SQL programming/Maruthi car owner details/README.md: -------------------------------------------------------------------------------- 1 | # Maruthi car owner details 2 | 3 | Write a query to display distinct owner id, owner name, address, and phone no of owners who owns 'Maruthi' company car. Sort the result based on owner id. 4 | 5 | *Note: If car_name contains a string 'Maruthi' it is a Maruthi company car.* 6 | 7 | **Example: 'Maruthi swift','Maruthi 800'** 8 | 9 | > HINT: Use Owners and Cars tables to retrieve records. 10 | 11 | *NOTE: Maintain the same sequence of column order, as specified in the question description* 12 | 13 | ![database diagram](../database_2.png) -------------------------------------------------------------------------------- /SQL programming/Maruthi car owner details/query.sql: -------------------------------------------------------------------------------- 1 | select distinct owner_id, owner_name, address, phone_no 2 | from owners 3 | where owner_id in (select distinct owner_id from cars where car_name like "Maruthi%"); -------------------------------------------------------------------------------- /SQL programming/Minimum & Maximum Discount Amount/README.md: -------------------------------------------------------------------------------- 1 | # Minimum & Maximum Discount Amount 2 | 3 | Write a query to display the minimum discount amount and the maximum discount amount offered as per the coupon. Give an alias name as MIN_DISCOUNT to the minimum discount amount and MAX_DISCOUNT to the maximum discount amount. 4 | 5 | > NOTE: 6 | 7 | Maintain the same sequence of column order, as specified in the question description 8 | 9 | ![database diagram](database_diagram.png) -------------------------------------------------------------------------------- /SQL programming/Minimum & Maximum Discount Amount/database_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/SQL programming/Minimum & Maximum Discount Amount/database_diagram.png -------------------------------------------------------------------------------- /SQL programming/Minimum & Maximum Discount Amount/group3.sql: -------------------------------------------------------------------------------- 1 | SELECT A.MIN_DISCOUNT, B.MAX_DISCOUNT 2 | FROM ( 3 | SELECT MIN(DISCOUNT_AMOUNT) AS `MIN_DISCOUNT` 4 | FROM DISCOUNT_MASTER 5 | ) A, 6 | ( 7 | SELECT MAX(DISCOUNT_AMOUNT) AS `MAX_DISCOUNT` 8 | FROM DISCOUNT_MASTER 9 | ) B; -------------------------------------------------------------------------------- /SQL programming/Movie-Modify the datatype set2/README.md: -------------------------------------------------------------------------------- 1 | # Hostel-Insert Student Records set2 2 | 3 | Refer to the given schema diagram. Insert the below records into Student_details Table. 4 | 5 | | STUDENT_ID | STUDENT_NAME | DEPARTMENT | DOB | ADDRESS | PHONE_NO | EMAIL_ID | 6 | | ---------- | ------------ | ---------- | --- | ------- | -------- | -------- | 7 | | S1001 | Varsha | ECE | 1999-06-12 | CHENNAI | 9845712345 | varsha123@gmail.com | 8 | | S1002 | William | ECE | 1999-02-04 | CALCUTTA | 6845712345 | william123@gmail.com | 9 | | S1003 | Basha | EEE | 1999-06-14 | DELHI | 9945712345 | basha222@gmail.com | 10 | | S1004 | Catherine | CSE | 1998-08-16 | DELHI | 6785712345 | cathu123@gmail.com | 11 | | S1005 | Kate | ECE | 1999-06-30 | BANGALORE | 7685712345 | katedd@gmail.com | 12 | | S1006 | Michel | ECE | 1998-06-04 | COIMBATORE | 6645712345 | michel000@gmail.com | 13 | 14 | > NOTE: 15 | 16 | Maintain the same sequence of column order, as specified in the question description -------------------------------------------------------------------------------- /SQL programming/Movie-Modify the datatype set2/dml2.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO STUDENT_DETAILS 2 | VALUES 3 | ("S1001", "Varsha", "ECE", "1999-06-12", "CHENNAI", "9845712345", "varsha123@gmail.com"), 4 | ("S1002", "William", "ECE", "1999-02-04", "CALCUTTA", "6845712345", "william123@gmail.com"), 5 | ("S1003", "Basha", "EEE", "1999-06-14", "DELHI", "9945712345", "basha222@gmail.com"), 6 | ("S1004", "Catherine", "CSE", "1998-08-16", "DELHI", "6785712345", "cathu123@gmail.com"), 7 | ("S1005", "Kate", "ECE", "1999-06-30", "BANGALORE", "7685712345", "katedd@gmail.com"), 8 | ("S1006", "Michel", "ECE", "1998-06-04", "COIMBATORE", "6645712345", "michel000@gmail.com"); -------------------------------------------------------------------------------- /SQL programming/No of time rented by each car/README.md: -------------------------------------------------------------------------------- 1 | # No of time rented by each car 2 | 3 | Write a query to display car id and number of times car taken for rental. Give an alias name to the number of times car taken for rental as 'NO_OF_TRIPS'. Sort the records based on car id in ascending order. 4 | 5 | > (HINT: Use Rentals table to retrieve records.) 6 | 7 | ![database diagram](../database_2.png) -------------------------------------------------------------------------------- /SQL programming/No of time rented by each car/query.sql: -------------------------------------------------------------------------------- 1 | select car_id, count(car_id) 2 | from rentals 3 | group by car_id 4 | order by car_id; -------------------------------------------------------------------------------- /SQL programming/Number of Tickets Booked/README.md..txt: -------------------------------------------------------------------------------- 1 | # Number of Tickets Booked 2 | 3 | Write a query to display the user id and number of time tickets was booked by each user. Give an alias name as no_of_times. Sort the result based on the user_id. 4 | 5 | > **Note:** 6 | > Evaluate only the respective query to get the desired result. 7 | 8 | ![database diagram](../../../database_4.jpg) -------------------------------------------------------------------------------- /SQL programming/Number of Tickets Booked/query.sql: -------------------------------------------------------------------------------- 1 | select user_id, count(bd_id) as `no_of_times` 2 | from bookingdetails 3 | group by user_id asc; -------------------------------------------------------------------------------- /SQL programming/Order details/README.md: -------------------------------------------------------------------------------- 1 | # Order details 2 | 3 | Write a query to display order id, customer name, hotel name, and order amount of all orders. Sort the result based on order id in ascending order. 4 | 5 | > HINT: Use Customers, Hotel_details and Orders tables to retrieve records. 6 | 7 | *NOTE: Maintain the same sequence of column order, as specified in the question description* 8 | 9 | ![database diagram](../database_3.png) -------------------------------------------------------------------------------- /SQL programming/Order details/sample.sql: -------------------------------------------------------------------------------- 1 | select orders.order_id, customers.customer_name, hotel_details.hotel_name, orders.order_amount 2 | from orders, customers, hotel_details 3 | where orders.customer_id = customers.customer_id 4 | and orders.hotel_id = hotel_details.hotel_id 5 | order by orders.order_id; -------------------------------------------------------------------------------- /SQL programming/PL_SQL/Display_department_names_using_Cursors.sql: -------------------------------------------------------------------------------- 1 | set serveroutput on 2 | DECLARE 3 | BEGIN 4 | dbms_output.put_line('Department Names are:'); 5 | for REC IN(select DEPARTMENT_ID, DEPARTMENT_NAME , LOCATION_ID FROM DEPARTMENT order by DEPARTMENT_NAME ASC) 6 | LOOP 7 | dbms_output.put_line(REC.DEPARTMENT_NAME); 8 | end LOOP; 9 | end; 10 | / 11 | -------------------------------------------------------------------------------- /SQL programming/PL_SQL/Insert_Record_using_Anonymous_Block.sql: -------------------------------------------------------------------------------- 1 | DECLARE 2 | l_department_id department.department_id%TYPE; 3 | BEGIN 4 | SELECT MAX (department_id) + 10 INTO l_department_id FROM department; 5 | 6 | INSERT INTO department (department_id, department_name, location_id) 7 | VALUES (l_department_id, 'TESTING', 'CHN-102'); 8 | DELETE FROM department WHERE department_id='1040'; 9 | END; 10 | / 11 | 12 | 13 | -------------------------------------------------------------------------------- /SQL programming/PL_SQL/Package_with_a_Procedure_to_update_salary.sql: -------------------------------------------------------------------------------- 1 | create package EMP_DESIGNATION 2 | as 3 | PROCEDURE EMP_DETAILS 4 | ( 5 | design employee.designation%type, 6 | incentive number 7 | ); 8 | end EMP_DESIGNATION; 9 | / 10 | CREATE package body EMP_DESIGNATION 11 | as 12 | PROCEDURE EMP_DETAILS 13 | ( 14 | design employee.designation%type, 15 | incentive number 16 | ) 17 | as 18 | begin 19 | update employee set employee.salary=employee.salary+incentive 20 | where employee.designation=design; 21 | dbms_output.put_line (sql%rowcount || 'employee(s) are updated.'); 22 | end EMP_DETAILS; 23 | end EMP_DESIGNATION; 24 | / 25 | -------------------------------------------------------------------------------- /SQL programming/PL_SQL/Procedure_with_Exception_Handling.sql: -------------------------------------------------------------------------------- 1 | CREATE PROCEDURE CHECK_AGE_ELIGIBILITY 2 | ( 3 | v_id IN EMPLOYEE.EMPID%TYPE, 4 | v_name IN EMPLOYEE.EMPNAME%TYPE, 5 | v_age IN EMPLOYEE.AGE%TYPE 6 | ) 7 | as 8 | in_valid_age exception; 9 | BEGIN 10 | if(v_age>=18) then 11 | insert INTO EMPLOYEE VALUES(v_id,v_name,v_age); 12 | dbms_output.put_line('Age valid - Record inserted'); 13 | else 14 | raise in_valid_age; 15 | end if; 16 | EXCEPTION 17 | when in_valid_age 18 | then 19 | dbms_output.put_line('Age invalid - Record not inserted'); 20 | end; 21 | / 22 | 23 | -------------------------------------------------------------------------------- /SQL programming/PL_SQL/area_of_a_circle.sql: -------------------------------------------------------------------------------- 1 | DECLARE 2 | pi constant number(3,2):=3.14; 3 | Radius number(5); 4 | Area number(7,2); 5 | BEGIN 6 | Radius:=3; 7 | WHILE(Radius<=7) 8 | LOOP 9 | Area:= pi*power(Radius,2); 10 | insert into circle VALUES(Radius,Area); 11 | Radius:=Radius+1; 12 | end LOOP; 13 | end; 14 | / 15 | -------------------------------------------------------------------------------- /SQL programming/PL_SQL/insert_a_record_trigger.sql: -------------------------------------------------------------------------------- 1 | create trigger 2 | display_message 3 | after insert or update on employee 4 | begin 5 | dbms_output.put_line('NEW EMPLOYEE DETAILS INSERTED'); 6 | END; 7 | / 8 | -------------------------------------------------------------------------------- /SQL programming/PL_SQL/insert_credit_procedure.sql: -------------------------------------------------------------------------------- 1 | CREATE PROCEDURE insert_credit 2 | ( 3 | credit_id IN number, 4 | credit_card_number IN varchar, 5 | credit_card_expire IN varchar, 6 | holder_name IN varchar, 7 | card_type IN varchar 8 | ) 9 | AS 10 | BEGIN 11 | 12 | insert INTO credit_card(id, card_number, card_expire, name ,cc_type) 13 | VALUES(credit_id, credit_card_number , credit_card_expire , holder_name ,card_type); 14 | 15 | COMMIT; 16 | 17 | END; 18 | / 19 | -------------------------------------------------------------------------------- /SQL programming/PL_SQL/select_city_procedure.sql: -------------------------------------------------------------------------------- 1 | create procedure select_city 2 | ( 3 | user_id IN number, 4 | city_details OUT varchar 5 | ) 6 | as 7 | BEGIN 8 | select 'User is from' || 9 | case 10 | when city IN('Bangalore','Chennai') 11 | then city 12 | else 'other cities' 13 | end 14 | into city_details 15 | from contact 16 | where id=user_id; 17 | end; 18 | / 19 | -------------------------------------------------------------------------------- /SQL programming/PL_SQL/update_location.sql: -------------------------------------------------------------------------------- 1 | BEGIN 2 | 3 | update Department 4 | 5 | set LOCATION_ID = 'HQ-BLR-101' 6 | 7 | where LOCATION_ID like 'HQ%'; 8 | 9 | END; 10 | / 11 | -------------------------------------------------------------------------------- /SQL programming/Password Generation/query.sql: -------------------------------------------------------------------------------- 1 | select name, concat(substr(NAME,1,3), substr(PHNO,1,3)) as password from users 2 | order by NAME; 3 | -------------------------------------------------------------------------------- /SQL programming/Password Generation/question.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/SQL programming/Password Generation/question.pdf -------------------------------------------------------------------------------- /SQL programming/Patient Appointment Details based on reason/README.md: -------------------------------------------------------------------------------- 1 | # Patient Appointment Details based on reason 2 | 3 | Refer to the given schema. 4 | 5 | Write a query to display the patient id, patient first name, patient age, appointment number and the date of appointment of those patients whose reason for the appointment is 'FEVER'. Sort the records based on patient id. 6 | 7 | > Hint: 8 | 9 | Use the Appointment table and Patient table to retrieve the records. Data is case-sensitive 10 | 11 | ![database datagram](database_diagram.png) 12 | 13 | -------------------------------------------------------------------------------- /SQL programming/Patient Appointment Details based on reason/database_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/SQL programming/Patient Appointment Details based on reason/database_diagram.png -------------------------------------------------------------------------------- /SQL programming/Patient Appointment Details based on reason/query.sql: -------------------------------------------------------------------------------- 1 | SELECT P.PATIENT_ID, P.P_FIRST_NAME, P.P_AGE, A.APP_NUMBER, A.APP_DATE 2 | FROM PATIENT P, APPOINMENT A 3 | WHERE P.PATIENT_ID = A.PATIENT_ID 4 | AND A.APP_REASON = 'FEVER' 5 | ORDER BY P.PATIENT_ID; -------------------------------------------------------------------------------- /SQL programming/Patient Appointment details Based On Month/README.md: -------------------------------------------------------------------------------- 1 | # Patient Appointment details Based On Month 2 | 3 | Refer to the schema. Write a query to display unique patient id, patient first name, patient age, address and contact number of all the patients who booked appointments in the month of JUNE 2019. Sort the records based on patient id. 4 | 5 | > Hint: 6 | 7 | Use Patient & Appointment tables. The appointment date will be in the format 'YYYY-MM-DD'. 8 | 9 | ![database diagram](database_diagram.png) -------------------------------------------------------------------------------- /SQL programming/Patient Appointment details Based On Month/database_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/SQL programming/Patient Appointment details Based On Month/database_diagram.png -------------------------------------------------------------------------------- /SQL programming/Patient Appointment details Based On Month/join3.sql: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT P.PATIENT_ID, P.P_FIRST_NAME, P.P_AGE, P.ADDRESS, P.CONTACT_NUMBER 2 | FROM PATIENT P, APPOINTMENT A 3 | WHERE P.PATIENT_ID = A.PATIENT_ID 4 | AND MONTH(A.APP_DATE) = 6 5 | AND YEAR(A.APP_DATE) = 2019 6 | ORDER BY P.PATIENT_ID; 7 | -------------------------------------------------------------------------------- /SQL programming/Rental details based on date/README.md: -------------------------------------------------------------------------------- 1 | # Rental details based on date 2 | 3 | Write a query to display rental id, car id, customer id and km driven of rentals taken during 'AUGUST 2019'. Sort the result based on rental id. 4 | 5 | > (HINT : Use Rentals table to retrieve records. Eg: return date: 2019-08-12 ) 6 | 7 | *NOTE: Maintain the same sequence of column order, as specified in the question description* 8 | 9 | ![database diagram](../database_2.png) -------------------------------------------------------------------------------- /SQL programming/Rental details based on date/query.sql: -------------------------------------------------------------------------------- 1 | select rental_id, car_id, customer_id, km_driven 2 | from rentals 3 | where month(pickup_date) = 8 4 | and year(pickup_date) = 2019 5 | order by rental_id; -------------------------------------------------------------------------------- /SQL programming/Review of delivery partner based on rating/README.md: -------------------------------------------------------------------------------- 1 | # Review of delivery partner based on rating 2 | 3 | Write a query to display partner id,partner name and review of the delivery partner, give alias name for partner review as 'REVIEW', sort the result based on partner id in ascending order. 4 | 5 | *Note: Review is based on the following condition* 6 | 7 | IF rating>=4 then 'GOOD' 8 | 9 | IF rating between >=2 and <4 then 'AVERAGE' 10 | 11 | IF rating <2 then 'WORST' 12 | 13 | > HINT : Use Delivery_partners table to retrieve records. -------------------------------------------------------------------------------- /SQL programming/Review of delivery partner based on rating/sample.sql: -------------------------------------------------------------------------------- 1 | select partner_id, partner_name, ( 2 | case 3 | when rating >= 4 then "GOOD" 4 | when rating >= 2 and rating < 4 then "AVERAGE" 5 | else "WORST" 6 | end 7 | ) as review 8 | from delivery_partners 9 | order by partner_id; -------------------------------------------------------------------------------- /SQL programming/Student and their Department Based on City/README.md: -------------------------------------------------------------------------------- 1 | # Student and their Department Based on City 2 | 3 | Write a query to display list of students name and their department name who are all from 'Coimbatore'. Sort the result based on students name 4 | 5 | ![database diagram](../database_1.jpg) -------------------------------------------------------------------------------- /SQL programming/Student and their Department Based on City/joins3.sql: -------------------------------------------------------------------------------- 1 | select s.student_name, d.department_name 2 | from student as s 3 | inner join department 4 | on s.city = "Coimbatore" 5 | and s.department_id = d.department_id 6 | order by s.student_name; -------------------------------------------------------------------------------- /SQL programming/Total sale daywise/README.md: -------------------------------------------------------------------------------- 1 | # Total sale daywise 2 | 3 | Write a query to display order_date, total order amount in each day. Give an alias name for total order amount as ‘TOTAL_SALE’. Sort the result based on order_date. 4 | 5 | > HINT : Use Orders table to retrieve records. 6 | 7 | *NOTE: Maintain the same sequence of column order, as specified in the question description* 8 | 9 | ![database diagram](../database_3.png) -------------------------------------------------------------------------------- /SQL programming/Total sale daywise/sample.sql: -------------------------------------------------------------------------------- 1 | select order_date, sum(order_amount) as total_sale 2 | from orders 3 | group by order_date; -------------------------------------------------------------------------------- /SQL programming/Username and password/query.sql: -------------------------------------------------------------------------------- 1 | Select concat(cust_name,cust_id) 2 | as USERNAME, 3 | concat(substring(cust_name,1,3), 4 | substring(cust_phone,-4,4)) as PASSWORD 5 | from customer 6 | order by USER NAME; 7 | -------------------------------------------------------------------------------- /SQL programming/Username and password/question.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/SQL programming/Username and password/question.docx -------------------------------------------------------------------------------- /SQL programming/car rental system - Insert values/README.md: -------------------------------------------------------------------------------- 1 | # car rental system - Insert values 2 | 3 | Refer to the given schema diagram. Insert the below records into Rentals Table. Assume the rentals table has been already created. 4 | 5 | ![table data](table_data.png) 6 | 7 | *Note: Letters in bold represent the attributes.* 8 | 9 | *NOTE: Maintain the same sequence of column order, as specified in the question description* 10 | 11 | ![database diagram](../database_2.png) -------------------------------------------------------------------------------- /SQL programming/car rental system - Insert values/query.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO rentals 2 | VALUES 3 | ("R001", "C007", "V004", "2018-03-10", "2018-03-10", 800, 9000), 4 | ("R002", "C001", "V007", "2018-03-11", "2018-03-12", 200, 3000), 5 | ("R003", "C007", "V003", "2018-04-15", "2018-04-15", 100, 1500), 6 | ("R004", "C007", "V001", "2018-05-16", "2018-05-18", 1000, 10000), 7 | ("R005", "C004", "V005", "2018-05-10", "2018-05-12", 900, 11000), 8 | ("R006", "C004", "V006", "2018-05-20", "2018-05-21", 200, 2500); -------------------------------------------------------------------------------- /SQL programming/car rental system - Insert values/table_data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/SQL programming/car rental system - Insert values/table_data.png -------------------------------------------------------------------------------- /code quality/FlightManagement-2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/code quality/FlightManagement-2.zip -------------------------------------------------------------------------------- /code quality/TraineeManager.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/code quality/TraineeManager.zip -------------------------------------------------------------------------------- /code quality/patient-intake-system.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/code quality/patient-intake-system.zip -------------------------------------------------------------------------------- /code quality/read.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /html_css/feedback details.txt: -------------------------------------------------------------------------------- 1 | the html part: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |

Feedback for the ART OFLIVING session


10 | 11 | 12 | 13 |
14 | 15 |
20 | 21 |
28 | 29 |
30 | 31 | Feedback Details
Successfully Added Feedback Details! 34 | 35 |
36 | 37 | 38 | 39 | 40 | 41 | the JS part: 42 | 43 | var feed=[]; 44 | function addFeedback(){ 45 | var 46 | x=document.getElementById("feedback").value; feed.push(x); 47 | } 48 | 49 | function displayFeedback(){ 50 | var i=0; 51 | 52 | var res=""; 53 | 54 | for(i=0; i"+feed[i]+"
"; 55 | 56 | document.getElementsByName("inner") [1].innerHTML = res; 57 | 58 | feed= []; 59 | 60 | } -------------------------------------------------------------------------------- /html_css/simple calculatro.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | Calculator
4 |
5 | Input1
6 | Input2
7 | Select Operation
14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /java programming/Account Manipulation - Abstract Class/Account.java: -------------------------------------------------------------------------------- 1 | public abstract class Account { 2 | protected int accountNumber; 3 | protected Customer customerObj; 4 | protected double balance; 5 | 6 | public Account(int accountNumber, Customer customerObj, double balance) { 7 | this.accountNumber = accountNumber; 8 | this.customerObj = customerObj; 9 | this.balance = balance; 10 | } 11 | 12 | public int getAccountNumber() { 13 | return accountNumber; 14 | } 15 | 16 | public void setAccountNumber(int accountNumber) { 17 | this.accountNumber = accountNumber; 18 | } 19 | 20 | public Customer getCustomerObj() { 21 | return customerObj; 22 | } 23 | 24 | public void setCustomerObj(Customer customerObj) { 25 | this.customerObj = customerObj; 26 | } 27 | 28 | public double getBalance() { 29 | return balance; 30 | } 31 | 32 | public void setBalance(double balance) { 33 | this.balance = balance; 34 | } 35 | 36 | public abstract boolean withdraw(double amount); 37 | } 38 | -------------------------------------------------------------------------------- /java programming/Account Manipulation - Abstract Class/Customer.java: -------------------------------------------------------------------------------- 1 | public class Customer { 2 | private int customerId; 3 | private String customerName; 4 | private String emailId; 5 | 6 | public Customer(int customerId, String customerName, String emailId) { 7 | this.customerId = customerId; 8 | this.customerName = customerName; 9 | this.emailId = emailId; 10 | } 11 | 12 | public int getCustomerId() { 13 | return customerId; 14 | } 15 | 16 | public void setCustomerId(int customerId) { 17 | this.customerId = customerId; 18 | } 19 | 20 | public String getCustomerName() { 21 | return customerName; 22 | } 23 | 24 | public void setCustomerName(String customerName) { 25 | this.customerName = customerName; 26 | } 27 | 28 | public String getEmailId() { 29 | return emailId; 30 | } 31 | 32 | public void setEmailId(String emailId) { 33 | this.emailId = emailId; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /java programming/Account Manipulation - Abstract Class/Main.java: -------------------------------------------------------------------------------- 1 | public class Main { 2 | public static void main(String[] args) { 3 | Customer customer = new Customer(101, "Ritam", "ritam@email.com"); 4 | SavingsAccount savingsAccount = new SavingsAccount(1001, customer, 10000, 500); 5 | 6 | if (savingsAccount.withdraw(9000)) { 7 | System.out.println(savingsAccount.getBalance()); 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /java programming/Account Manipulation - Abstract Class/SavingsAccount.java: -------------------------------------------------------------------------------- 1 | public class SavingsAccount extends Account { 2 | private double minimumBalance; 3 | 4 | public SavingsAccount(int accountNumber, Customer customerObj, double balance, double minimumBalance) { 5 | super(accountNumber, customerObj, balance); 6 | this.minimumBalance = minimumBalance; 7 | } 8 | 9 | public double getMinimumBalance() { 10 | return minimumBalance; 11 | } 12 | 13 | public void setMinimumBalance(double minimumBalance) { 14 | this.minimumBalance = minimumBalance; 15 | } 16 | 17 | @Override 18 | public boolean withdraw(double amount) { 19 | if (balance - amount > minimumBalance) { 20 | balance -= amount; 21 | 22 | return true; 23 | } 24 | 25 | return false; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /java programming/Add Flight using JDBC/DB.java: -------------------------------------------------------------------------------- 1 | import java.io.FileInputStream; 2 | import java.io.IOException; 3 | import java.sql.Connection; 4 | import java.sql.DriverManager; 5 | import java.sql.SQLException; 6 | import java.util.Properties; 7 | 8 | public class DB { 9 | private static Connection connection = null; 10 | private static Properties properties = new Properties(); 11 | 12 | public static Connection getConnection() throws ClassNotFoundException, SQLException { 13 | try { 14 | FileInputStream fileInputStream = new FileInputStream("database.properties"); 15 | properties.load(fileInputStream); 16 | 17 | Class.forName(properties.getProperty("DB_DRIVER_CLASS")); 18 | 19 | connection = DriverManager.getConnection( 20 | properties.getProperty("DB_URL"), 21 | properties.getProperty("DB_USERNAME"), 22 | properties.getProperty("DB_PASSWORD") 23 | ); 24 | } catch (IOException e) { 25 | e.printStackTrace(); 26 | } 27 | 28 | return connection; 29 | } 30 | } -------------------------------------------------------------------------------- /java programming/Add Flight using JDBC/Flight.java: -------------------------------------------------------------------------------- 1 | public class Flight { 2 | private int flightId; 3 | private String source; 4 | private String destination; 5 | private int noOfSeats; 6 | private double flightFare; 7 | 8 | public Flight(int flightId, String source, String destination, int noOfSeats, double flightFare) { 9 | this.flightId = flightId; 10 | this.source = source; 11 | this.destination = destination; 12 | this.noOfSeats = noOfSeats; 13 | this.flightFare = flightFare; 14 | } 15 | 16 | public int getFlightId() { 17 | 18 | return flightId; 19 | } 20 | 21 | public void setFlightId(int flightId) { 22 | this.flightId = flightId; 23 | } 24 | 25 | public String getSource() { 26 | return source; 27 | } 28 | 29 | public void setSource(String source) { 30 | this.source = source; 31 | } 32 | 33 | public String getDestination() { 34 | return destination; 35 | } 36 | 37 | public void setDestination(String destination) { 38 | this.destination = destination; 39 | } 40 | 41 | public int getNoOfSeats() { 42 | return noOfSeats; 43 | } 44 | 45 | public void setNoOfSeats(int noOfSeats) { 46 | this.noOfSeats = noOfSeats; 47 | } 48 | 49 | public double getFlightFare() { 50 | return flightFare; 51 | } 52 | 53 | public void setFlightFare(double flightFare) { 54 | this.flightFare = flightFare; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /java programming/Add Flight using JDBC/FlightManagementSystem.java: -------------------------------------------------------------------------------- 1 | import java.sql.Connection; 2 | import java.sql.PreparedStatement; 3 | import java.sql.SQLException; 4 | 5 | public class FlightManagementSystem { 6 | public boolean addFlight(Flight flight) { 7 | try { 8 | Connection connection = DB.getConnection(); 9 | String query = "insert into flight (flightId, source, destination, noofseats, flightfare) values (?, ?, ?, ?, ?);"; 10 | 11 | PreparedStatement preparedStatement = connection.prepareStatement(query); 12 | preparedStatement.setInt(1, flight.getFlightId()); 13 | preparedStatement.setString(2, flight.getSource()); 14 | preparedStatement.setString(3, flight.getDestination()); 15 | preparedStatement.setInt(4, flight.getNoOfSeats()); 16 | preparedStatement.setDouble(5, flight.getFlightFare()); 17 | 18 | preparedStatement.execute(); 19 | return true; 20 | } catch (ClassNotFoundException | SQLException e) { 21 | e.printStackTrace(); 22 | } 23 | 24 | return false; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /java programming/Add Flight using JDBC/Main.java: -------------------------------------------------------------------------------- 1 | public class Main { 2 | public static void main(String[] args) { 3 | Flight flight = new Flight(100, "NYC", "LA", 100, 100.0); 4 | FlightManagementSystem flightManagementSystem = new FlightManagementSystem(); 5 | boolean isFlightAdded = flightManagementSystem.addFlight(flight); 6 | 7 | if (isFlightAdded) { 8 | System.out.println("Flight details added successfully"); 9 | } else { 10 | System.out.println("Addition not done"); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /java programming/Add Flight using JDBC/database.properties: -------------------------------------------------------------------------------- 1 | #To test in the local machine 2 | #Enter your own detials 3 | 4 | DB_DRIVER_CLASS=com.mysql.jdbc.Driver 5 | DB_URL=jdbc:mysql://localhost:3306/${sys.DB} 6 | DB_USERNAME=${sys.DB_USERNAME} 7 | DB_PASSWORD=${sys.DB_PASSWORD} -------------------------------------------------------------------------------- /java programming/Array Compatibility/README.md: -------------------------------------------------------------------------------- 1 | # Array Compatiblilty 2 | 3 | Two arrays are said to be compatible if they are of the same size and if the ith element in the first array is greater than or equal to the ith element in the second array for all i elements.If the array size is zero or lesser then display the message "Invalid array size".Write a Java program to find whether 2 arrays are compatible or not.If the arrays are compatible display the message as "Arrays are Compatible" ,if not then display the message as "Arrays are Not Compatible". 4 | 5 | > Sample Input 1: 6 | 7 | Enter the size for First array: 8 | 5 9 | Enter the elements for First array: 10 | 5 11 | 14 12 | 17 13 | 19 14 | 15 15 | Enter the size for Second array: 16 | 5 17 | Enter the elements for Second array: 18 | 2 19 | 5 20 | 9 21 | 15 22 | 7 23 | 24 | > Sample Output 1: 25 | 26 | Arrays are Compatible 27 | 28 | --- 29 | 30 | > Sample Input 2: 31 | 32 | Enter the size for First array: 33 | 3 34 | Enter the elements for First array: 35 | 1 36 | 4 37 | 7 38 | Enter the size for Second array: 39 | 5 40 | Enter the elements for Second array: 41 | 2 42 | 5 43 | 9 44 | 5 45 | 7 46 | 47 | > Sample Output 2: 48 | 49 | Arrays are Not Compatible 50 | 51 | --- 52 | 53 | > Sample Input 3: 54 | 55 | Enter the size for First array: 56 | -2 57 | 58 | > Sample Output 3: 59 | 60 | Invalid array size -------------------------------------------------------------------------------- /java programming/Array Manipulation - Use try with multi catch/ArrayException.java: -------------------------------------------------------------------------------- 1 | import java.util.InputMismatchException; 2 | import java.util.Scanner; 3 | 4 | public class ArrayException { 5 | public String getPriceDetails() { 6 | Scanner scanner = new Scanner(System.in); 7 | 8 | System.out.println("Enter the number of elements in the array"); 9 | int n = scanner.nextInt(); 10 | int[] arr = new int[n]; 11 | 12 | System.out.println("Enter the price details"); 13 | 14 | for (int i = 0; i < n; ++i) { 15 | try { 16 | arr[i] = scanner.nextInt(); 17 | } catch (InputMismatchException ignore) { 18 | return "Input was not in the correct format"; 19 | } 20 | } 21 | 22 | System.out.println("Enter the index of the array element you want to access"); 23 | 24 | try { 25 | int index = scanner.nextInt(); 26 | return "The array element is " + arr[index]; 27 | } catch (InputMismatchException ignore) { 28 | return "Input was not in the correct format"; 29 | } catch (ArrayIndexOutOfBoundsException ignore) { 30 | return "Array index is out of range"; 31 | } 32 | } 33 | 34 | public static void main(String[] args) { 35 | System.out.println(new ArrayException().getPriceDetails()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /java programming/Auditing/EmployeeAudit.java: -------------------------------------------------------------------------------- 1 | import java.util.ArrayList; 2 | 3 | public interface EmployeeAudit { 4 | 5 | // Fill the code 6 | public ArrayList fetchEmployeeDetails(double salary); 7 | } -------------------------------------------------------------------------------- /java programming/Bank Account - Interface/Account.java: -------------------------------------------------------------------------------- 1 | public class Account { 2 | private String accountNumber; 3 | private String customerName; 4 | private double balance; 5 | 6 | public Account(String accountNumber, String customerName, double balance) { 7 | this.accountNumber = accountNumber; 8 | this.customerName = customerName; 9 | this.balance = balance; 10 | } 11 | 12 | public String getAccountNumber() { 13 | return accountNumber; 14 | } 15 | 16 | public void setAccountNumber(String accountNumber) { 17 | this.accountNumber = accountNumber; 18 | } 19 | 20 | public String getCustomerName() { 21 | return customerName; 22 | } 23 | 24 | public void setCustomerName(String customerName) { 25 | this.customerName = customerName; 26 | } 27 | 28 | public double getBalance() { 29 | return balance; 30 | } 31 | 32 | public void setBalance(double balance) { 33 | this.balance = balance; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /java programming/Bank Account - Interface/CurrentAccount.java: -------------------------------------------------------------------------------- 1 | public class CurrentAccount extends Account implements MaintenanceCharge { 2 | public CurrentAccount(String accountNumber, String customerName, double balance) { 3 | super(accountNumber, customerName, balance); 4 | } 5 | 6 | @Override 7 | public float calculateMaintenanceCharge(float noOfYears) { 8 | return (100.0f + noOfYears) + 200.0f; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /java programming/Bank Account - Interface/MaintenanceCharge.java: -------------------------------------------------------------------------------- 1 | public interface MaintenanceCharge { 2 | float calculateMaintenanceCharge(float noOfYears); 3 | } 4 | -------------------------------------------------------------------------------- /java programming/Bank Account - Interface/SavingsAccount.java: -------------------------------------------------------------------------------- 1 | public class SavingsAccount extends Account implements MaintenanceCharge { 2 | public SavingsAccount(String accountNumber, String customerName, double balance) { 3 | super(accountNumber, customerName, balance); 4 | } 5 | 6 | @Override 7 | public float calculateMaintenanceCharge(float noOfYears) { 8 | return (50.0f * noOfYears) + 50.0f; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /java programming/BankAccountDetails/Account.java: -------------------------------------------------------------------------------- 1 | public class Account{ 2 | private int accountId; 3 | private String accountType; 4 | private int balance; 5 | 6 | public int getAccountId() { 7 | return accountId; 8 | } 9 | public void setAccountId(int accountId) { 10 | this.accountId = accountId; 11 | } 12 | public String getAccountType() { 13 | return accountType; 14 | } 15 | public void setAccountType(String accountType) { 16 | this.accountType = accountType; 17 | } 18 | public int getBalance() { 19 | return balance; 20 | } 21 | public void setBalance(int balance) { 22 | this.balance = balance; 23 | } 24 | 25 | public boolean withdraw(int amount){ 26 | if(balance >= amount){ 27 | balance -= amount; 28 | System.out.println("Balance amount after withdraw:"+balance); 29 | return true; 30 | }else{ 31 | System.out.println("Sorry!!! No enough balance"); 32 | return false; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /java programming/Batting Average/com/ui/UserInterface.java: -------------------------------------------------------------------------------- 1 | package com.ui; 2 | 3 | import com.utility.Player; 4 | 5 | import java.util.ArrayList; 6 | import java.util.Scanner; 7 | 8 | public class UserInterface { 9 | public static void main(String[] args) { 10 | Scanner scanner = new Scanner(System.in); 11 | Player player = new Player(); 12 | player.setScoreList(new ArrayList<>()); 13 | boolean flag = true; 14 | 15 | while (flag) { 16 | System.out.println("1. Add Runs Scored"); 17 | System.out.println("2. Calculate average runs scored"); 18 | System.out.println("3. Exit"); 19 | System.out.println("Enter your choice"); 20 | int choice = scanner.nextInt(); 21 | 22 | switch (choice) { 23 | case 1: { 24 | System.out.println("Enter the runs scored"); 25 | int score = scanner.nextInt(); 26 | player.addScoreDetails(score); 27 | break; 28 | } 29 | case 2: { 30 | System.out.println("Average runs secured"); 31 | System.out.println(player.getAverageRunScored()); 32 | break; 33 | } 34 | case 3: { 35 | System.out.println("Thank you for use the application"); 36 | flag = false; 37 | break; 38 | } 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /java programming/Batting Average/com/utility/Player.java: -------------------------------------------------------------------------------- 1 | package com.utility; 2 | 3 | import java.util.List; 4 | 5 | public class Player { 6 | private List scoreList; 7 | 8 | public List getScoreList() { 9 | return scoreList; 10 | } 11 | 12 | public void setScoreList(List scoreList) { 13 | this.scoreList = scoreList; 14 | } 15 | 16 | public double getAverageRunScored() { 17 | if (scoreList.isEmpty()) { 18 | return 0.0; 19 | } 20 | 21 | int size = scoreList.size(); 22 | int totalScore = 0; 23 | 24 | for (int score : scoreList) { 25 | totalScore += score; 26 | } 27 | 28 | return (double) totalScore / (double) size; 29 | } 30 | 31 | public void addScoreDetails(int score) { 32 | scoreList.add(score); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /java programming/Bill Generator/README.md: -------------------------------------------------------------------------------- 1 | # Bill Generation 2 | 3 | Tom went to a movie with his friends in a multiplex theatre and during break time he bought pizzas, puffs and cool drinks. Consider the following prices : 4 | 5 | Rs.100/pizza 6 | Rs.20/puffs 7 | Rs.10/cooldrink 8 | Generate a bill for What Tom has bought. 9 | 10 | ### Sample Input 1: 11 | 12 | Enter the no of pizzas bought:10 13 | Enter the no of puffs bought:12 14 | Enter the no of cool drinks bought:5 15 | 16 | ### Sample Output 1: 17 | 18 | Bill Details 19 | No of pizzas:10 20 | No of puffs:12 21 | No of cooldrinks:5 22 | Total price=1290 23 | ENJOY THE SHOW!!! -------------------------------------------------------------------------------- /java programming/Bill Generator/SnackDetails.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | class SnacksDetails { 4 | public static void main(String[] args) { 5 | Scanner scanner = new Scanner(System.in); 6 | int pizza = 100; 7 | int puff = 20; 8 | int coolDrink = 10; 9 | 10 | System.out.println("Enter the no of pizzas bought:"); 11 | int pizzaCount = scanner.nextInt(); 12 | System.out.println("Enter the no of puffs bought:"); 13 | int puffCount = scanner.nextInt(); 14 | System.out.println("Enter the no of cool drinks bought:"); 15 | int coolDrinkCount = scanner.nextInt(); 16 | 17 | long price = pizza * pizzaCount + puff * puffCount + coolDrink * coolDrinkCount; 18 | 19 | System.out.println("Bill Details"); 20 | System.out.println("No of pizzas:" + pizzaCount); 21 | System.out.println("No of puffs:" + puffCount); 22 | System.out.println("No of cooldrinks:" + coolDrinkCount); 23 | System.out.println("Total price=" + price); 24 | System.out.println("ENJOY THE SHOW!!!"); 25 | } 26 | } -------------------------------------------------------------------------------- /java programming/Book Manipulation/Book.java: -------------------------------------------------------------------------------- 1 | public class Book { 2 | private int isbnno; 3 | private String bookName; 4 | private String author; 5 | 6 | public int getIsbnno() { 7 | return isbnno; 8 | } 9 | 10 | public void setIsbnno(int isbnno) { 11 | this.isbnno = isbnno; 12 | } 13 | 14 | public String getBookName() { 15 | return bookName; 16 | } 17 | 18 | public void setBookName(String bookName) { 19 | this.bookName = bookName; 20 | } 21 | 22 | public String getAuthor() { 23 | return author; 24 | } 25 | 26 | public void setAuthor(String author) { 27 | this.author = author; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /java programming/Book Manipulation/Library.java: -------------------------------------------------------------------------------- 1 | import java.util.ArrayList; 2 | 3 | public class Library { 4 | private ArrayList bookList = new ArrayList<>(); 5 | 6 | public ArrayList getBookList() { 7 | return bookList; 8 | } 9 | 10 | public void setBookList(ArrayList bookList) { 11 | this.bookList = bookList; 12 | } 13 | 14 | public void addBook(Book book) { 15 | bookList.add(book); 16 | } 17 | 18 | public boolean isEmpty() { 19 | return bookList.isEmpty(); 20 | } 21 | 22 | public ArrayList viewAllBooks() { 23 | return bookList; 24 | } 25 | 26 | public ArrayList viewBooksByAuthor(String author) { 27 | ArrayList booksByAuthor = new ArrayList<>(); 28 | 29 | for (Book book : bookList) { 30 | if (book.getAuthor().contains(author)) { 31 | booksByAuthor.add(book); 32 | } 33 | } 34 | 35 | return booksByAuthor; 36 | } 37 | 38 | public int countnoofbook(String bname) { 39 | return (int) bookList.stream().filter(book -> book.getBookName().contains(bname)).count(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /java programming/Check Number Type/NumberType.java: -------------------------------------------------------------------------------- 1 | public interface NumberType { 2 | boolean checkNumber(int num); 3 | } 4 | -------------------------------------------------------------------------------- /java programming/Check Number Type/NumberTypeUtility.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class NumberTypeUtility { 4 | public static NumberType idOdd() { 5 | return (num) -> num % 2 != 0; 6 | } 7 | 8 | public static void main(String[] args) { 9 | Scanner scanner = new Scanner(System.in); 10 | int num = scanner.nextInt(); 11 | 12 | if (idOdd().checkNumber(num)) { 13 | System.out.println(num + " is odd"); 14 | } else { 15 | System.out.println(num + " is not odd"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /java programming/Collage Account/TuitionFee.java: -------------------------------------------------------------------------------- 1 | public interface TuitionFee { 2 | int calculateTuitionFees(String courseType, int basicFee, int noOfSemesters); 3 | } 4 | -------------------------------------------------------------------------------- /java programming/Contact Details of Hosteller/Hosteller.java: -------------------------------------------------------------------------------- 1 | public class Hosteller extends Student { 2 | private String hostelName; 3 | private int roomNumber; 4 | 5 | public String getHostelName() { 6 | return hostelName; 7 | } 8 | 9 | public void setHostelName(String hostelName) { 10 | this.hostelName = hostelName; 11 | } 12 | 13 | public int getRoomNumber() { 14 | return roomNumber; 15 | } 16 | 17 | public void setRoomNumber(int roomNumber) { 18 | this.roomNumber = roomNumber; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /java programming/Contact Details of Hosteller/Student.java: -------------------------------------------------------------------------------- 1 | public class Student { 2 | protected int studentId; 3 | protected String name; 4 | protected int departmentId; 5 | protected String gender; 6 | protected String phone; 7 | 8 | public int getStudentId() { 9 | return studentId; 10 | } 11 | 12 | public void setStudentId(int studentId) { 13 | this.studentId = studentId; 14 | } 15 | 16 | public String getName() { 17 | return name; 18 | } 19 | 20 | public void setName(String name) { 21 | this.name = name; 22 | } 23 | 24 | public int getDepartmentId() { 25 | return departmentId; 26 | } 27 | 28 | public void setDepartmentId(int departmentId) { 29 | this.departmentId = departmentId; 30 | } 31 | 32 | public String getGender() { 33 | return gender; 34 | } 35 | 36 | public void setGender(String gender) { 37 | this.gender = gender; 38 | } 39 | 40 | public String getPhone() { 41 | return phone; 42 | } 43 | 44 | public void setPhone(String phone) { 45 | this.phone = phone; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /java programming/Count of Each Words/CountOfWords.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | @SuppressWarnings("unchecked") // Do not delete this line 4 | public class CountOfWords { 5 | public static void main(String[] args) { 6 | Scanner scanner = new Scanner(System.in); 7 | String article = scanner.nextLine().toLowerCase(); 8 | Map map = new TreeMap<>(); 9 | 10 | String[] strings = article.split("[ ,;:.?!]"); 11 | 12 | for (String string : strings) { 13 | if (!string.isEmpty()) { 14 | map.put(string, map.getOrDefault(string, 0) + 1); 15 | } 16 | } 17 | 18 | int count = 0; 19 | 20 | for (int i : map.values()) { 21 | count += i; 22 | } 23 | 24 | System.out.println("Number of words " + count); 25 | System.out.println("Words with the count"); 26 | 27 | for (Map.Entry entry : map.entrySet()) { 28 | System.out.println(entry.getKey() + ": " + entry.getValue()); 29 | } 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /java programming/Count of Each Words/README.md: -------------------------------------------------------------------------------- 1 | # Count of Each Words 2 | 3 | Miss.Jane, an experienced English professor, gives practice tests to her students to improve their written skills. Everyday students write an article and they submit it to Jane. Jane is particular that the students use only special characters like , ; : . ? ! in the article. 4 | 5 | **Note : Using the above mentioned special characters will help to split the words in a sentence. 6 | All other special characters when used will be considered as a part of the word itself.** 7 | 8 | She counts the total number of words used and the count of each word in the article. Based on this analysis she gives her feedback to the students. 9 | 10 | Difficulty arises when the number of students increase. So she wanted to automate the process in the following format. Help her to write a java program to display the words and the number of times it has been used in the article and to display the words using lower case and in alphabetical order. 11 | 12 | > Sample Input Output: 13 | 14 | Enter Student's Article 15 | hello Hello HEllo hi hi: hi! Welcome, welcome 16 | Number of words 8 17 | Words with the count 18 | hello: 3 19 | hi: 3 20 | welcome: 2 -------------------------------------------------------------------------------- /java programming/Cumulative sun in an array/CumulativeSum.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | import java.util.StringJoiner; 3 | 4 | class CumulativeSum { 5 | public static void main(String[] args) { 6 | Scanner scanner = new Scanner(System.in); 7 | int n; 8 | 9 | System.out.println("Enter number of elements"); 10 | n = scanner.nextInt(); 11 | 12 | if (n <= 0) { 13 | System.out.println("Invalid Range"); 14 | } else { 15 | int sum = 0; 16 | StringJoiner stringJoiner = new StringJoiner(" "); 17 | 18 | System.out.println("Enter the elements"); 19 | 20 | for (int i = 0; i < n; ++i) { 21 | int num = scanner.nextInt(); 22 | sum += num; 23 | stringJoiner.add(String.valueOf(sum)); 24 | } 25 | 26 | System.out.println(stringJoiner.toString()); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /java programming/Cumulative sun in an array/README.md: -------------------------------------------------------------------------------- 1 | # Cumulative sum in an array 2 | 3 | Raghavi wants to write Java program to find the cumulative sum of the array with a given set of values.Input consist of integers .If the size of an array is zero or lesser then display the message as "Invalid Range". Print the output in the format which is provided in sample output . 4 | 5 | Assume maximum size of array is 20, 6 | 7 | > Sample Input 1: 8 | 9 | Enter number of elements 10 | 5 11 | Enter the elements 12 | 2 13 | 3 14 | 5 15 | 7 16 | 1 17 | 18 | > Sample Output 1: 19 | 20 | 2 5 10 17 18 21 | 22 | --- 23 | 24 | > Sample Input 2: 25 | 26 | Enter number of elements 27 | 5 28 | Enter the elements 29 | 2 30 | 3 31 | -5 32 | 7 33 | 1 34 | 35 | > Sample Output 2: 36 | 37 | 2 5 0 7 8 38 | 39 | --- 40 | 41 | > Sample Input 3: 42 | 43 | Enter number of elements 44 | 0 45 | 46 | > Sample Output 3: 47 | 48 | Invalid Range -------------------------------------------------------------------------------- /java programming/Display Characters/AsciValue.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | class AsciValue { 4 | public static void main(String[] args) { 5 | Scanner scanner = new Scanner(System.in); 6 | 7 | System.out.println("Enter the digits:"); 8 | 9 | for (int i = 0; i < 4; ++i) { 10 | int input = scanner.nextInt(); 11 | System.out.println(input + "-" + (char) input); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /java programming/Display Characters/README.md: -------------------------------------------------------------------------------- 1 | # Display Characters 2 | 3 | Rohan wants a magic board, which displays a character for a corresponding number for his science exhibition. Help him to develop such application. 4 | 5 | For example when the digits 65,66,67,68 are entered, the alphabet ABCD are to be displayed. 6 | 7 | [Assume the number of inputs should be always 4 ] 8 | 9 | > Sample Input 1: 10 | 11 | Enter the digits: 12 | 65 13 | 66 14 | 67 15 | 68 16 | 17 | > Sample Output 1: 18 | 19 | 65-A 20 | 66-B 21 | 67-C 22 | 68-D 23 | 24 | 25 | > Sample Input 2: 26 | 27 | Enter the digits: 28 | 115 29 | 116 30 | 101 31 | 112 32 | 33 | 34 | > Sample Output 2: 35 | 36 | 115-s 37 | 116-t 38 | 101-e 39 | 112-p -------------------------------------------------------------------------------- /java programming/Divider two number - Use finally/Division.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class Division { 4 | public String divideTwoNumbers(int num1, int num2) { 5 | String message = "Thanks for using the application."; 6 | String result = ""; 7 | 8 | try { 9 | int div = num1 / num2; 10 | result = "The answer is " + div + "."; 11 | } catch (ArithmeticException ignore) { 12 | result = "Division by zero is not possible."; 13 | } finally { 14 | result += " " + message; 15 | } 16 | 17 | return result; 18 | } 19 | 20 | public static void main(String[] args) { 21 | Scanner scanner = new Scanner(System.in); 22 | 23 | System.out.println("Enter the numbers"); 24 | int num1 = scanner.nextInt(); 25 | int num2 = scanner.nextInt(); 26 | 27 | Division division = new Division(); 28 | System.out.println(division.divideTwoNumbers(num1, num2)); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /java programming/DreamTek Company/Associate.java: -------------------------------------------------------------------------------- 1 | class Associate { 2 | private int associateId; 3 | private String associateName; 4 | private String workStatus; 5 | 6 | public int getAssociateId() { 7 | return associateId; 8 | } 9 | 10 | public void setAssociateId(int associateId) { 11 | this.associateId = associateId; 12 | } 13 | 14 | public String getAssociateName() { 15 | return associateName; 16 | } 17 | 18 | public void setAssociateName(String associateName) { 19 | this.associateName = associateName; 20 | } 21 | 22 | public String getWorkStatus() { 23 | return workStatus; 24 | } 25 | 26 | public void setWorkStatus(String workStatus) { 27 | this.workStatus = workStatus; 28 | } 29 | 30 | public void trackAssociateStatus(int days) { 31 | if (days <= 20) { 32 | setWorkStatus("Core skills"); 33 | } else if (days <= 40) { 34 | setWorkStatus("Advanced modules"); 35 | } else if (days <= 60) { 36 | setWorkStatus("Project phase"); 37 | } else { 38 | setWorkStatus("Project phase"); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /java programming/DreamTek Company/Main.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | class Main { 4 | public static void main(String[] args) { 5 | Scanner scanner = new Scanner(System.in); 6 | int associateId, days; 7 | String associateName; 8 | 9 | System.out.println("Enter the associate id:"); 10 | associateId = scanner.nextInt(); 11 | 12 | System.out.println("Enter the associate name:"); 13 | associateName = scanner.next(); 14 | 15 | System.out.println("Enter the number of days:"); 16 | days = scanner.nextInt(); 17 | 18 | if (days < 0) { 19 | System.out.println("Invalid Input"); 20 | } else { 21 | Associate associate = new Associate(); 22 | associate.setAssociateId(associateId); 23 | associate.setAssociateName(associateName); 24 | associate.trackAssociateStatus(days); 25 | 26 | System.out.println("The associate " + associate.getAssociateName() + " work status:" + associate.getWorkStatus()); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /java programming/DreamTek Company/picture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/java programming/DreamTek Company/picture.jpg -------------------------------------------------------------------------------- /java programming/Employee ID Validation/README.md: -------------------------------------------------------------------------------- 1 | # Employee ID Validation 2 | 3 | Global Info Technologies has approached you to develop an application to maintain the work details of their employees. 4 | 5 | Imagine you are developing the login module. In that module,you will have to validate the id with the format given from the client. 6 | 7 | The format is "GBL/001/0417", here the first three letters are standard. 8 | Create a class UserMain and implement the functionalities which are required. 9 | 10 | > Sample Input 1: 11 | 12 | Enter your ID 13 | GBL/020/0715 14 | 15 | > Sample Output 1: 16 | 17 | Login success 18 | 19 | --- 20 | 21 | > Sample Input 2: 22 | 23 | Enter your ID 24 | ABC/120/0215 25 | 26 | > Sample Output 2: 27 | 28 | Incorrect ID -------------------------------------------------------------------------------- /java programming/Employee ID Validation/UserMain.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | import java.util.regex.Matcher; 3 | import java.util.regex.Pattern; 4 | 5 | class UserMain { 6 | public static void main(String[] args) { 7 | Scanner scanner = new Scanner(System.in); 8 | String id; 9 | Pattern pattern = Pattern.compile("^GBL/\\d{3}/\\d{4}$"); 10 | 11 | System.out.println("Enter your ID"); 12 | id = scanner.next(); 13 | 14 | Matcher matcher = pattern.matcher(id); 15 | 16 | if (matcher.matches()) { 17 | System.out.println("Login success"); 18 | } else { 19 | System.out.println("Incorrect ID"); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /java programming/Employee Loan Eligibility - Polymorphism/Employee.java: -------------------------------------------------------------------------------- 1 | public abstract class Employee { 2 | protected int employeeId; 3 | protected String employeeName; 4 | protected double salary; 5 | 6 | public Employee(int employeeId, String employeeName) { 7 | this.employeeId = employeeId; 8 | this.employeeName = employeeName; 9 | } 10 | 11 | public int getEmployeeId() { 12 | return employeeId; 13 | } 14 | 15 | public void setEmployeeId(int employeeId) { 16 | this.employeeId = employeeId; 17 | } 18 | 19 | public String getEmployeeName() { 20 | return employeeName; 21 | } 22 | 23 | public void setEmployeeName(String employeeName) { 24 | this.employeeName = employeeName; 25 | } 26 | 27 | public double getSalary() { 28 | return salary; 29 | } 30 | 31 | public void setSalary(double salary) { 32 | this.salary = salary; 33 | } 34 | 35 | public abstract void calculateSalary(); 36 | } 37 | -------------------------------------------------------------------------------- /java programming/Employee Loan Eligibility - Polymorphism/Loan.java: -------------------------------------------------------------------------------- 1 | public class Loan { 2 | public double calculateLoanAmount(Employee employee) { 3 | double loan = 0.0; 4 | 5 | if (employee instanceof PermanentEmployee) { 6 | loan = employee.getSalary() * 15.0 / 100.0; 7 | } else if (employee instanceof TemporaryEmployee) { 8 | loan = employee.getSalary() * 10.0 / 100.0; 9 | } 10 | 11 | return loan; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /java programming/Employee Loan Eligibility - Polymorphism/Main.java: -------------------------------------------------------------------------------- 1 | public class Main { 2 | public static void main(String[] args) { 3 | PermanentEmployee permanentEmployee = new PermanentEmployee(101, "Ritam", 100000); 4 | TemporaryEmployee temporaryEmployee = new TemporaryEmployee(102, "Chakraborty", 6, 100); 5 | 6 | Loan loan = new Loan(); 7 | double permanentEmployeeLoan = loan.calculateLoanAmount(permanentEmployee); 8 | double temporaryEmployeeLoan = loan.calculateLoanAmount(temporaryEmployee); 9 | 10 | System.out.println(permanentEmployeeLoan); 11 | System.out.println(temporaryEmployeeLoan); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /java programming/Employee Loan Eligibility - Polymorphism/PermanentEmployee.java: -------------------------------------------------------------------------------- 1 | public class PermanentEmployee extends Employee { 2 | private double basicPay; 3 | 4 | public PermanentEmployee(int employeeId, String employeeName, double basicPay) { 5 | super(employeeId, employeeName); 6 | this.basicPay = basicPay; 7 | } 8 | 9 | public double getBasicPay() { 10 | return basicPay; 11 | } 12 | 13 | public void setBasicPay(double basicPay) { 14 | this.basicPay = basicPay; 15 | } 16 | 17 | @Override 18 | public void calculateSalary() { 19 | double pfAmount = basicPay * 0.12; 20 | double salary = basicPay - pfAmount; 21 | setSalary(salary); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /java programming/Employee Loan Eligibility - Polymorphism/TemporaryEmployee.java: -------------------------------------------------------------------------------- 1 | public class TemporaryEmployee extends Employee { 2 | private int hoursWorked; 3 | private int hourlyWages; 4 | 5 | public TemporaryEmployee(int employeeId, String employeeName, int hoursWorked, int hourlyWages) { 6 | super(employeeId, employeeName); 7 | this.hoursWorked = hoursWorked; 8 | this.hourlyWages = hourlyWages; 9 | } 10 | 11 | public int getHoursWorked() { 12 | return hoursWorked; 13 | } 14 | 15 | public void setHoursWorked(int hoursWorked) { 16 | this.hoursWorked = hoursWorked; 17 | } 18 | 19 | public int getHourlyWages() { 20 | return hourlyWages; 21 | } 22 | 23 | public void setHourlyWages(int hourlyWages) { 24 | this.hourlyWages = hourlyWages; 25 | } 26 | 27 | @Override 28 | public void calculateSalary() { 29 | double salary = hoursWorked * hourlyWages; 30 | setSalary(salary); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /java programming/Employee Loan Eligibility/Employee.java: -------------------------------------------------------------------------------- 1 | //DO NOT EDIT OR DELETE 2 | public class Employee { 3 | private String empId; 4 | private String empName; 5 | private double salary; 6 | 7 | public String getEmpId() { 8 | return empId; 9 | } 10 | public void setEmpId(String empId) { 11 | this.empId = empId; 12 | } 13 | public String getEmpName() { 14 | return empName; 15 | } 16 | public void setEmpName(String empName) { 17 | this.empName = empName; 18 | } 19 | public double getSalary() { 20 | return salary; 21 | } 22 | public void setSalary(double salary) { 23 | this.salary = salary; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /java programming/Employee Loan Eligibility/Employeeutility.java: -------------------------------------------------------------------------------- 1 | import java.util.ArrayList; 2 | import java.util.Arrays; 3 | import java.util.List; 4 | import java.util.stream.Stream; 5 | 6 | public class EmployeeUtility { 7 | 8 | public Employee[] getEmployeeDetails(String[] details) { 9 | 10 | //Fill your code here 11 | int i=0; 12 | int n=details.length; 13 | Employee eobj[]=new Employee[n]; 14 | while(i getStreamOfEmployee(Employee[] empDetails) { 31 | 32 | 33 | return(Arrays.stream(empDetails)); 34 | } 35 | 36 | public String[] shortlistedEmployee(Stream empStream,double minSalary) { 37 | 38 | //Fill your code here 39 | 40 | List sls=new ArrayList<>(); 41 | empStream.filter(e -> e.getSalary()>=minSalary).forEach(x->{ 42 | String res=""; 43 | res+=x.getEmpId()+" "+x.getEmpName()+" "+x.getSalary(); 44 | sls.add(res); 45 | });; 46 | String sar[]=new String[sls.size()]; 47 | int j=0; 48 | for(String ts:sls) 49 | { 50 | sar[j]=ts; 51 | j+=1; 52 | } 53 | Arrays.sort(sar); 54 | return(sar); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /java programming/Employee Loan Eligibility/main.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | //DO NOT EDIT OR DELETE 3 | public class Main { 4 | 5 | public static void main(String[] args) { 6 | Scanner sc=new Scanner(System.in); 7 | EmployeeUtility utilObj=new EmployeeUtility(); 8 | System.out.println("Enter the number of Employees"); 9 | int n=sc.nextInt(); 10 | sc.nextLine(); 11 | if(n>0) { 12 | System.out.println("Enter the details of Employees"); 13 | String [] details=new String[n]; 14 | for(int i=0;i0) { 22 | System.out.println("Shortlisted Employees are"); 23 | for(String s:result) { 24 | System.out.println(s); 25 | } 26 | } 27 | else { 28 | System.out.println("No Employee is having the required salary"); 29 | } 30 | } 31 | else 32 | { 33 | System.out.println("Invalid Input"); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /java programming/Employee Loan Eligibility/question.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/java programming/Employee Loan Eligibility/question.pdf -------------------------------------------------------------------------------- /java programming/Employee Promotion/Employee.java: -------------------------------------------------------------------------------- 1 | public class Employee { 2 | private String empName; 3 | private String empId; 4 | private double empSalary; 5 | 6 | public Employee(String empName, String empId, double empSalary) { 7 | super(); 8 | this.empName = empName; 9 | this.empId = empId; 10 | this.empSalary = empSalary; 11 | } 12 | public String getEmpName() { 13 | return empName; 14 | } 15 | public void setEmpName(String empName) { 16 | this.empName = empName; 17 | } 18 | public String getEmpId() { 19 | return empId; 20 | } 21 | public void setEmpId(String empId) { 22 | this.empId = empId; 23 | } 24 | public double getEmpSalary() { 25 | return empSalary; 26 | } 27 | public void setEmpSalary(double empSalary) { 28 | this.empSalary = empSalary; 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /java programming/Employee Promotion/Main.java: -------------------------------------------------------------------------------- 1 | import java.text.DecimalFormat; 2 | import java.util.*; 3 | 4 | public class Main { 5 | public static void main(String[] args) { 6 | Scanner sc=new Scanner(System.in); 7 | System.out.println("Enter the number of employees"); 8 | int no=sc.nextInt(); 9 | String info[]=new String[no]; 10 | List list=new ArrayList<>(); 11 | System.out.println("Enter the employee details"); 12 | 13 | for(int i=0;i employeeList=new ArrayList(); 5 | private int count; 6 | public Management(double salaryLimit, List employeeList) { 7 | super(); 8 | this.salaryLimit = salaryLimit; 9 | this.employeeList = employeeList; 10 | } 11 | public double getSalaryLimit() { 12 | return salaryLimit; 13 | } 14 | public void setSalaryLimit(double salaryLimit) { 15 | this.salaryLimit = salaryLimit; 16 | } 17 | public List getEmployeeList() { 18 | return employeeList; 19 | } 20 | public void setEmployeeList(List employeeList) { 21 | this.employeeList = employeeList; 22 | } 23 | public int getCount() { 24 | return count; 25 | } 26 | public void setCount(int count) { 27 | this.count = count; 28 | } 29 | public void run() 30 | { 31 | int c=0; 32 | for(int i=0;i=salaryLimit) 36 | { 37 | c++; 38 | } 39 | } 40 | setCount(c); 41 | //Fill the code 42 | } 43 | } -------------------------------------------------------------------------------- /java programming/Employee Salary Calculation/Employee.java: -------------------------------------------------------------------------------- 1 | public class Employee { 2 | private int employeeId; 3 | private String employeeName; 4 | private double salary; 5 | private double netSalary; 6 | 7 | public int getEmployeeId() { 8 | return employeeId; 9 | } 10 | 11 | public void setEmployeeId(int employeeId) { 12 | this.employeeId = employeeId; 13 | } 14 | 15 | public String getEmployeeName() { 16 | return employeeName; 17 | } 18 | 19 | public void setEmployeeName(String employeeName) { 20 | this.employeeName = employeeName; 21 | } 22 | 23 | public double getSalary() { 24 | return salary; 25 | } 26 | 27 | public void setSalary(double salary) { 28 | this.salary = salary; 29 | } 30 | 31 | public double getNetSalary() { 32 | return netSalary; 33 | } 34 | 35 | public void setNetSalary(double netSalary) { 36 | this.netSalary = netSalary; 37 | } 38 | 39 | public void calculateNetSalary(int pfPercentage) { 40 | double pf = salary * (double) pfPercentage / 100.0; 41 | netSalary = salary - pf; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /java programming/Employee Salary Calculation/Main.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class Main { 4 | public static Employee getEmployeeDetails() { 5 | Scanner scanner = new Scanner(System.in); 6 | int id; 7 | String name; 8 | double salary; 9 | 10 | System.out.println("Enter Id:"); 11 | id = scanner.nextInt(); 12 | 13 | System.out.println("Enter Name:"); 14 | name = scanner.next(); 15 | 16 | System.out.println("Enter salary:"); 17 | salary = scanner.nextDouble(); 18 | 19 | Employee employee = new Employee(); 20 | employee.setEmployeeId(id); 21 | employee.setEmployeeName(name); 22 | employee.setSalary(salary); 23 | 24 | return employee; 25 | } 26 | 27 | public static int getPFPercentage() { 28 | Scanner scanner = new Scanner(System.in); 29 | System.out.println("Enter PF percentage:"); 30 | return scanner.nextInt(); 31 | } 32 | 33 | public static void main(String[] args) { 34 | Employee employee = getEmployeeDetails(); 35 | int pfp = getPFPercentage(); 36 | employee.calculateNetSalary(pfp); 37 | 38 | System.out.println("Id : " + employee.getEmployeeId()); 39 | System.out.println("Name : " + employee.getEmployeeName()); 40 | System.out.println("Salary : " + employee.getSalary()); 41 | System.out.println("net Salary : " + employee.getNetSalary()); 42 | } 43 | } -------------------------------------------------------------------------------- /java programming/Employee Salary Calculation/READEME.md: -------------------------------------------------------------------------------- 1 | # Employee Salary Calculation 2 | 3 | Create a class Employee with the following private member variables. 4 | 5 | - int employeeId 6 | - String employeeName 7 | - double salary 8 | - double netSalary 9 | 10 | Include appropriate getters and setters method in Employee class. Write the following method in the Employee class: 11 | 12 | `public void calculateNetSalary(int pfpercentage)` - This method should take PF percentage as argument. Deduct the PF amount from the salary and set the netSalary. 13 | 14 | Create a Main class which has the main method which invokes the method to get the input and prints the details as shown in the sample. 15 | 16 | Also write a method : 17 | 18 | - `public static Employee getEmployeeDetails()` - which gets the employee details - id, name and salary, and returns the employee object. 19 | 20 | - `public static int getPFPercentage()` - which gets the PF percentage and returns the same 21 | 22 | In the main method invoke the above two methods, and then call the calculateNetSalary method in Employee class and print the output as shown below. 23 | 24 | > Sample Input 1: 25 | 26 | Enter Id: 27 | 101 28 | Enter Name: 29 | Vivek 30 | Enter salary: 31 | 20000 32 | Enter PF percentage: 33 | 7 34 | 35 | > Sample Output 1: 36 | 37 | Id : 101 38 | Name : Vivek 39 | Salary : 20000.0 40 | Net Salary : 18600.0 41 | -------------------------------------------------------------------------------- /java programming/Factors of a Number/FindFactor.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | import java.util.StringJoiner; 3 | 4 | class FindFactor { 5 | public static void main(String[] args) { 6 | Scanner scanner = new Scanner(System.in); 7 | int num = scanner.nextInt(); 8 | num = Math.abs(num); 9 | 10 | if (num == 0) { 11 | System.out.println("No Factors"); 12 | } else { 13 | StringJoiner stringJoiner = new StringJoiner(", "); 14 | 15 | for (int i = 1; i <= num; ++i) { 16 | if (num % i == 0) { 17 | stringJoiner.add(String.valueOf(i)); 18 | } 19 | } 20 | 21 | System.out.println(stringJoiner.toString()); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /java programming/Factors of a Number/README.md: -------------------------------------------------------------------------------- 1 | # Factors of a Number 2 | 3 | Betsy teaches her daughter to find the factors of a given number. When she provides a number to her daughter, she should tell the factors of that number. Help her to do this, by writing a program. 4 | 5 | Write a class FindFactor.java and write the main method in it. 6 | 7 | ## Note 8 | 9 | > If the input provided is negative, ignore the sign and provide the output. If the input is zero If the input is zero the output should be “No Factors”. 10 | 11 | 12 | > Sample Input 1 : 13 | 14 | 54 15 | 16 | > Sample Output 1 : 17 | 18 | 1, 2, 3, 6, 9, 18, 27, 54 19 | 20 | 21 | > Sample Input 2 : 22 | 23 | -1869 24 | 25 | > Sample Output 2 : 26 | 27 | 1, 3, 7, 21, 89, 267, 623, 1869 -------------------------------------------------------------------------------- /java programming/Find Average Age/README.md: -------------------------------------------------------------------------------- 1 | # Find Average Age 2 | 3 | One of the least Insurance agencies recruited employees for their collection department. Now the HR needs a report as the average age of all the employees working in that department. Write a code to calculate the average age. 4 | 5 | Implement a method **`calculateAverage(int[] age)`** to calculate the average age and return the result to the caller function. 6 | 7 | ## Note 8 | 9 | 1. Age limit should be minimum of 28 years and maximum of 40 years. 10 | 2. Minimum of 2 employees is mandatory to calculate average age, if fails, the output should be "Please enter a valid employee count" 11 | 3. If any of the age is invalid, terminate the process and display "Invalid age encountered!" 12 | 13 | > Sample Input 1: 14 | 15 | Enter total no.of employees: 16 | 3 17 | Enter the age for 3 employees: 18 | 30 19 | 31 20 | 32 21 | 22 | > Sample Output 1: 23 | 24 | The average age is 31.00 25 | 26 | --- 27 | 28 | > Sample Input 2: 29 | 30 | Enter total no.of employees: 31 | 2 32 | Enter the age for 2 employees: 33 | 29 34 | 36 35 | 36 | > Sample Output 2: 37 | 38 | The average age is 32.50 39 | 40 | --- 41 | 42 | > Sample Input 3: 43 | 44 | Enter total no.of employees: 45 | 1 46 | 47 | > Sample Output 3: 48 | 49 | Please enter a valid employee count -------------------------------------------------------------------------------- /java programming/Find Average Age/Test.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class Test { 4 | private static double calculateAverage(int[] age) { 5 | double sum = 0.0; 6 | 7 | for (int i : age) { 8 | sum += i; 9 | } 10 | 11 | return sum / (double) age.length; 12 | } 13 | 14 | public static void main(String[] args) { 15 | Scanner scanner = new Scanner(System.in); 16 | 17 | System.out.println("Enter total no.of employees:"); 18 | int n = scanner.nextInt(); 19 | 20 | if (n < 2) { 21 | System.out.println("Please enter a valid employee count"); 22 | } else { 23 | System.out.println(String.format("Enter the age for %d employees:", n)); 24 | 25 | int[] age = new int[n]; 26 | boolean allValidAge = true; 27 | 28 | for (int i = 0; i < n; ++i) { 29 | int a = scanner.nextInt(); 30 | 31 | if (a < 28 || a > 40) { 32 | allValidAge = false; 33 | break; 34 | } 35 | 36 | age[i] = a; 37 | } 38 | 39 | 40 | if (allValidAge) { 41 | double average = calculateAverage(age); 42 | System.out.println(String.format("The average age is %.2f", average)); 43 | } else { 44 | System.out.println("Invalid age encountered!"); 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /java programming/Find Season/README.md: -------------------------------------------------------------------------------- 1 | # Find Season 2 | 3 | Reaya's teacher has asked her to prepare well for the lesson on seasons. When her teacher tells a month, she needs to say the season corresponding to that month. Write a program to solve the above task. 4 | 5 | Spring - March to May, 6 | Summer - June to August, 7 | Autumn - September to November and, 8 | Winter - December to February. 9 | Month should be in the range 1 to 12. If not the output should be "Invalid month". 10 | 11 | > Sample Input 1: 12 | 13 | Enter the month:11 14 | 15 | > Sample Output 1: 16 | 17 | Season:Autumn 18 | 19 | --- 20 | 21 | > Sample Input 2: 22 | 23 | Enter the month:13 24 | 25 | > Sample Output 2: 26 | Invalid month 27 | 28 | -------------------------------------------------------------------------------- /java programming/Find Season/Season.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | class Season { 4 | private static boolean isSpring(int month) { 5 | return month >= 3 && month <= 5; 6 | } 7 | 8 | private static boolean isSummer(int month) { 9 | return month >= 6 && month <= 8; 10 | } 11 | 12 | private static boolean isAutumn(int month) { 13 | return month >= 9 && month <= 11; 14 | } 15 | 16 | private static boolean isWinter(int month) { 17 | return month == 1 || month == 2 || month == 12; 18 | } 19 | 20 | public static void main(String[] args) { 21 | Scanner scanner = new Scanner(System.in); 22 | int month; 23 | String season = ""; 24 | 25 | System.out.println("Enter the month:"); 26 | month = scanner.nextInt(); 27 | 28 | if (month < 1 || month > 12) { 29 | System.out.println("Invalid month"); 30 | } else { 31 | if (isSpring(month)) { 32 | season = "Spring"; 33 | } else if (isAutumn(month)) { 34 | season = "Autumn"; 35 | } else if (isSummer(month)) { 36 | season = "Summer"; 37 | } else if (isWinter(month)) { 38 | season = "Winter"; 39 | } 40 | 41 | System.out.println("Season:" + season); 42 | } 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /java programming/Find and Replace/ReplaceWord.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | class ReplaceWord { 4 | public static void main(String[] args) { 5 | Scanner scanner = new Scanner(System.in); 6 | String sentence, word, replacement; 7 | 8 | System.out.println("Enter the string:"); 9 | sentence = scanner.nextLine(); 10 | 11 | System.out.println("Enter the word to be searched:"); 12 | word = scanner.nextLine(); 13 | 14 | System.out.println("Enter the word to be replaced:"); 15 | replacement = scanner.nextLine(); 16 | 17 | String replacedSentence = sentence.replace(word, replacement); 18 | 19 | if (replacedSentence.equals(sentence)) { 20 | System.out.println("The word " + word + " not found"); 21 | } else { 22 | System.out.println(replacedSentence); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /java programming/Fruit Basket Estimation/FruitBasket.java: -------------------------------------------------------------------------------- 1 | public class FruitBasket { 2 | private String fruitName; 3 | private int weightInKgs; 4 | private int pricePerKg; 5 | 6 | public String getFruitName() { 7 | return fruitName; 8 | } 9 | public void setFruitName(String fruitName) { 10 | this.fruitName = fruitName; 11 | } 12 | public int getWeightInKgs() { 13 | return weightInKgs; 14 | } 15 | public void setWeightInKgs(int weightInKgs) { 16 | this.weightInKgs = weightInKgs; 17 | } 18 | public int getPricePerKg() { 19 | return pricePerKg; 20 | } 21 | public void setPricePerKg(int pricePerKg) { 22 | this.pricePerKg = pricePerKg; 23 | } 24 | public FruitBasket(String fruitName, int weightInKgs, int pricePerKg) { 25 | super(); 26 | this.fruitName = fruitName; 27 | this.weightInKgs = weightInKgs; 28 | this.pricePerKg = pricePerKg; 29 | } 30 | public FruitBasket() { 31 | super(); 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /java programming/Fruit Basket Estimation/FruitBasketUtility.java: -------------------------------------------------------------------------------- 1 | import java.util.ArrayList; 2 | import java.util.List; 3 | import java.util.stream.Stream; 4 | 5 | public class FruitBasketUtility { 6 | private List fruitBasketList=new ArrayList(); 7 | 8 | public List getFruitBasketList() { 9 | return fruitBasketList; 10 | } 11 | 12 | public void setFruitBasketList(List fruitBasketList) { 13 | this.fruitBasketList = fruitBasketList; 14 | } 15 | 16 | public void addToBasket(FruitBasket fbObj) { 17 | // Fill your code here 18 | fruitBasketList.add(fbObj); 19 | 20 | } 21 | 22 | public int calculateBill(Stream fruitBasketStream) { 23 | 24 | int b[]=new int[1]; 25 | // Fill your code here 26 | fruitBasketStream.forEach(a-> 27 | { 28 | int wt=a.getWeightInKgs(); 29 | int pr=a.getPricePerKg(); 30 | b[0]=b[0]+pr*wt; 31 | }); 32 | return b[0]; 33 | 34 | 35 | 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /java programming/Fuel Consumption Calculator/Main.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | import java.text.*; 3 | 4 | class Main { 5 | private static void calculateFuelConsumption(double liter, double km) { 6 | DecimalFormat decimalFormat = new DecimalFormat("0.00"); 7 | double gallon = liter * 0.2642; 8 | double mile = km * 0.6214; 9 | 10 | double literPerKm = (liter / km) * 100; 11 | double gallonPerKm = mile / gallon; 12 | 13 | System.out.println("Liters/100KM"); 14 | System.out.println(decimalFormat.format(literPerKm)); 15 | System.out.println("Miles/gallons"); 16 | System.out.println(decimalFormat.format(gallonPerKm)); 17 | } 18 | 19 | private static void test(double value) { 20 | if (value <= 0) { 21 | System.out.println((int) value + " is an Invalid Input"); 22 | System.exit(0); 23 | } 24 | } 25 | 26 | public static void main(String[] args) { 27 | Scanner scanner = new Scanner(System.in); 28 | System.out.println("Enter the no of liters to fill the tank"); 29 | double liter = scanner.nextDouble(); 30 | test(liter); 31 | System.out.println("Enter the distance covered"); 32 | double km = scanner.nextDouble(); 33 | test(km); 34 | calculateFuelConsumption(liter, km); 35 | } 36 | } -------------------------------------------------------------------------------- /java programming/Grade Calculation/GradeCalculator.java: -------------------------------------------------------------------------------- 1 | public class GradeCalculator extends Thread { 2 | private String studName; 3 | private char result; 4 | private int[] marks; 5 | 6 | public GradeCalculator(String studName, int[] marks) { 7 | this.studName = studName; 8 | this.marks = marks; 9 | } 10 | 11 | public String getStudName() { 12 | return studName; 13 | } 14 | 15 | public void setStudName(String studName) { 16 | this.studName = studName; 17 | } 18 | 19 | public char getResult() { 20 | return result; 21 | } 22 | 23 | public void setResult(char result) { 24 | this.result = result; 25 | } 26 | 27 | public int[] getMarks() { 28 | return marks; 29 | } 30 | 31 | public void setMarks(int[] marks) { 32 | this.marks = marks; 33 | } 34 | 35 | @Override 36 | public void run() { 37 | int totalMarks = 0; 38 | 39 | for (int mark : marks) { 40 | totalMarks += mark; 41 | } 42 | 43 | if (totalMarks <= 500 && totalMarks >= 400) { 44 | result = 'A'; 45 | } else if (totalMarks < 400 && totalMarks >= 300) { 46 | result = 'B'; 47 | } else if (totalMarks < 300 && totalMarks >= 200) { 48 | result = 'C'; 49 | } else if (totalMarks < 200 && totalMarks >= 0) { 50 | result = 'E'; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /java programming/Grade Calculation/Main.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class Main { 4 | public static void main(String[] args) { 5 | Scanner scanner = new Scanner(System.in); 6 | 7 | System.out.println("Enter the number of Threads:"); 8 | int n = scanner.nextInt(); 9 | 10 | GradeCalculator[] gradeCalculators = new GradeCalculator[n]; 11 | Thread[] threads = new Thread[n]; 12 | 13 | for (int i = 0; i < n; ++i) { 14 | System.out.println("Enter the String:"); 15 | String string = scanner.next(); 16 | String[] strings = string.split(":"); 17 | int[] marks = new int[5]; 18 | 19 | String studName = strings[0]; 20 | 21 | for (int j = 1; j < 6; ++j) { 22 | marks[j - 1] = Integer.parseInt(strings[j]); 23 | } 24 | 25 | gradeCalculators[i] = new GradeCalculator(studName, marks); 26 | threads[i] = new Thread(gradeCalculators[i]); 27 | threads[i].start(); 28 | threads[i].interrupt(); 29 | } 30 | 31 | for (int i = 0; i < n; ++i) { 32 | System.out.println(gradeCalculators[i].getStudName() + ":" + gradeCalculators[i].getResult()); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /java programming/Highest Marks in Each Semester/README.md: -------------------------------------------------------------------------------- 1 | # Highest Mark in Each Semester 2 | 3 | Ram wants to know the maximum marks scored by him in each semester. The mark should be between 0 to 100 ,if goes beyond the range display "You have entered invalid mark." 4 | 5 | > Sample Input 1: 6 | 7 | Enter no of semester: 8 | 3 9 | Enter no of subjects in 1 semester: 10 | 3 11 | Enter no of subjects in 2 semester: 12 | 4 13 | Enter no of subjects in 3 semester: 14 | 2 15 | Marks obtained in semester 1: 16 | 50 17 | 60 18 | 70 19 | Marks obtained in semester 2: 20 | 90 21 | 98 22 | 76 23 | 67 24 | Marks obtained in semester 3: 25 | 89 26 | 76 27 | 28 | > Sample Output 1: 29 | 30 | Maximum mark in 1 semester:70 31 | Maximum mark in 2 semester:98 32 | Maximum mark in 3 semester:89 33 | 34 | 35 | > Sample Input 2: 36 | 37 | Enter no of semester: 38 | 3 39 | Enter no of subjects in 1 semester: 40 | 3 41 | Enter no of subjects in 2 semester: 42 | 4 43 | Enter no of subjects in 3 semester: 44 | 2 45 | Marks obtained in semester 1: 46 | 55 47 | 67 48 | 98 49 | Marks obtained in semester 2: 50 | 67 51 | -98 52 | 53 | 54 | > Sample Output 2: 55 | 56 | You have entered invalid mark. -------------------------------------------------------------------------------- /java programming/Increment Calculation/IncrementCalcuation.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | class IncrementCalculation { 4 | public static void main(String[] args) { 5 | Scanner scanner = new Scanner(System.in); 6 | int salary; 7 | double rating; 8 | 9 | System.out.println("Enter the salary"); 10 | salary = scanner.nextInt(); 11 | System.out.println("Enter the Performance appraisal rating"); 12 | rating = scanner.nextDouble(); 13 | 14 | if (salary <= 0 || rating < 1 || rating > 5) { 15 | System.out.println("Invalid Input"); 16 | } else { 17 | double increment = 0.0; 18 | 19 | if (rating <= 3) { 20 | increment = salary * 10.0 / 100.0; 21 | } else if (rating <= 4) { 22 | increment = salary * 25.0 / 100.0; 23 | } else if (rating <= 5) { 24 | increment = salary * 30.0 / 100.0; 25 | } 26 | 27 | salary += increment; 28 | System.out.println(salary); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /java programming/Increment Calculation/README.md: -------------------------------------------------------------------------------- 1 | # Increment Calculation 2 | 3 | ABC Technologies is in the process of increment the salary of the employees. This increment is done based on their salary and their performance appraisal rating. 4 | 5 | If the appraisal rating is between 1 and 3, the increment is 10% of the salary. 6 | If the appraisal rating is between 3.1 and 4, the increment is 25% of the salary. 7 | If the appraisal rating is between 4.1 and 5, the increment is 30% of the salary. 8 | Help them to do this, by writing a program that displays the incremented salary. 9 | 10 | Write a class "IncrementCalculation.java" and write the main method in it. 11 | 12 | ## Note 13 | 14 | > If either the salary is 0 or negative (or) if the appraisal rating is not in the range 1 to 5 (inclusive), then the output should be “Invalid Input”. 15 | 16 | > Sample Input 1 : 17 | 18 | Enter the salary 19 | 8000 20 | Enter the Performance appraisal rating 21 | 3 22 | 23 | > Sample Output 1 : 24 | 25 | 8800 26 | 27 | 28 | > Sample Input 2 : 29 | 30 | Enter the salary 31 | 7500 32 | Enter the Performance appraisal rating 33 | 4.3 34 | 35 | > Sample Output 2 : 36 | 37 | 9750 38 | 39 | 40 | > Sample Input 3 : 41 | 42 | Enter the salary 43 | -5000 44 | Enter the Performance appraisal rating 45 | 6 46 | 47 | > Sample Output 3 : 48 | 49 | Invalid Input -------------------------------------------------------------------------------- /java programming/InitCap/InitCap.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | import java.util.StringJoiner; 3 | 4 | class InitCap { 5 | public static void main(String[] args) { 6 | Scanner scanner = new Scanner(System.in); 7 | String string; 8 | boolean flag = true; 9 | 10 | System.out.println("Enter the String:"); 11 | string = scanner.nextLine(); 12 | 13 | String[] words = string.split(" "); 14 | 15 | for (int i = 0; i < words.length; ++i) { 16 | String word = words[i]; 17 | char firstLetter = word.charAt(0); 18 | String remaining = word.substring(1); 19 | 20 | if (Character.isLowerCase(firstLetter)) { 21 | flag = false; 22 | firstLetter = Character.toUpperCase(firstLetter); 23 | word = firstLetter + remaining; 24 | words[i] = word; 25 | } 26 | } 27 | 28 | if (!flag) { 29 | StringJoiner stringJoiner = new StringJoiner(" "); 30 | 31 | for (String word : words) { 32 | stringJoiner.add(word); 33 | } 34 | 35 | System.out.println(stringJoiner.toString()); 36 | } else { 37 | System.out.println("First character of each word is already in uppercase"); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /java programming/InitCap/README.md: -------------------------------------------------------------------------------- 1 | # InitCap 2 | 3 | Write a program to convert the first character of each word in a sentence to uppercase. 4 | 5 | If the first character of each word in the given sentence is already in upper case, then print "First character of each word is already in uppercase". 6 | 7 | > Sample Input 1: 8 | 9 | Enter the String: 10 | Work hard to get what you like 11 | 12 | > Sample Output 1: 13 | 14 | Work Hard To Get What You Like 15 | 16 | --- 17 | 18 | > Sample Input 2: 19 | 20 | Enter the String: 21 | Work Hard To Get What You Like 22 | 23 | > Sample Output 2: 24 | 25 | First character of each word is already in uppercase -------------------------------------------------------------------------------- /java programming/Insurance Bazaar/com/utility/Bazaar.java: -------------------------------------------------------------------------------- 1 | package com.utility; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | public class Bazaar { 8 | private Map policyMap; 9 | 10 | public Map getPolicyMap() { 11 | return policyMap; 12 | } 13 | 14 | public void setPolicyMap(Map policyMap) { 15 | this.policyMap = policyMap; 16 | } 17 | 18 | public void addPolicyDetails(int policyId, String policyName) { 19 | policyMap.put(policyId, policyName); 20 | } 21 | 22 | public List searchBasedOnPolicyType(String policyType) { 23 | List policies = new ArrayList<>(); 24 | 25 | for (int policyId : policyMap.keySet()) { 26 | if (policyMap.get(policyId).contains(policyType)) { 27 | policies.add(policyId); 28 | } 29 | } 30 | 31 | return policies; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /java programming/Least Offer/README.md: -------------------------------------------------------------------------------- 1 | # Least offer 2 | 3 | Maya buys “N” no of products from a shop. The shop offers a different percentage of discount on each item. She wants to know the item that has the minimum discount offer, so that she can avoid buying that and save money. 4 | 5 | [Input Format: The first input refers to the no of items; the second input is the item name, price and discount percentage separated by comma(,)] 6 | 7 | Assume the minimum discount offer is in the form of Integer. 8 | 9 | ## Note 10 | 11 | >There can be more than one product with a minimum discount. 12 | 13 | > Sample Input 1: 14 | 15 | 4 16 | mobile,10000,20 17 | shoe,5000,10 18 | watch,6000,15 19 | laptop,35000,5 20 | 21 | > Sample Output 1: 22 | shoe 23 | 24 | ### Explanation 25 | 26 | the discount on the mobile is 2000, the discount on the shoe is 500, the discount on the watch is 900 and the discount on the laptop is 1750. So the discount on the shoe is the minimum. 27 | 28 | --- 29 | 30 | > Sample Input 2: 31 | 32 | 4 33 | Mobile,5000,10 34 | shoe,5000,10 35 | WATCH,5000,10 36 | Laptop,5000,10 37 | 38 | > Sample Output 2: 39 | 40 | Mobile 41 | shoe 42 | WATCH 43 | Laptop -------------------------------------------------------------------------------- /java programming/List of prime numbers/PrimeNumbers.java: -------------------------------------------------------------------------------- 1 | import java.io.BufferedReader; 2 | import java.io.InputStreamReader; 3 | import java.util.Scanner; 4 | import java.util.StringJoiner; 5 | 6 | public class PrimeNumbers { 7 | private static boolean isPrime(int n) { 8 | if (n < 2) { 9 | return false; 10 | } else if (n == 2) { 11 | return true; 12 | } else { 13 | for (int i = 2; i <= (int) Math.sqrt(n); ++i) { 14 | if (n % i == 0) { 15 | return false; 16 | } 17 | } 18 | 19 | return true; 20 | } 21 | } 22 | 23 | public static void main(String[] args) { 24 | Scanner scanner = new Scanner(new BufferedReader(new InputStreamReader(System.in))); 25 | int start = scanner.nextInt(); 26 | int end = scanner.nextInt(); 27 | 28 | if (start <= 0 || start >= end) { 29 | System.out.println("Provide valid input"); 30 | } else { 31 | StringJoiner stringJoiner = new StringJoiner(" "); 32 | 33 | while (start <= end) { 34 | if (isPrime(start)) { 35 | stringJoiner.add(String.valueOf(start)); 36 | } 37 | 38 | ++start; 39 | } 40 | 41 | System.out.println(stringJoiner.toString()); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /java programming/List of prime numbers/README.md: -------------------------------------------------------------------------------- 1 | # List of prime numbers 2 | 3 | To speed up his composition of generating unpredictable rhythms, A.R.Rahman wants the list of prime numbers available in a range of numbers.Can you help him out? 4 | 5 | Write a java program to print all prime numbers in the interval [a,b] (a and b, both inclusive). 6 | 7 | ## Note 8 | 9 | > Input 1 should be lesser than Input 2. Both the inputs should be positive. 10 | > Range must always be greater than zero. 11 | > If any of the condition mentioned above fails, then display "Provide valid input" 12 | > Use a minimum of one for loop and one while loop 13 | 14 | 15 | > Sample Input 1: 16 | 17 | 2 18 | 15 19 | 20 | > Sample Output 1: 21 | 22 | 2 3 5 7 11 13 23 | 24 | 25 | > Sample Input 2: 26 | 27 | 8 28 | 5 29 | 30 | > Sample Output 2: 31 | 32 | Provide valid input -------------------------------------------------------------------------------- /java programming/Lucky Number/LuckyNum.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class LuckyNum { 4 | public static void main(String[] args) { 5 | Scanner scanner = new Scanner(System.in); 6 | int carNo; 7 | 8 | System.out.println("Enter the car no:"); 9 | carNo = scanner.nextInt(); 10 | 11 | if (carNo < 1000 || carNo > 9999) { 12 | System.out.println(carNo + " is not a valid car number"); 13 | } else { 14 | int sum = 0; 15 | 16 | for (char ch : String.valueOf(carNo).toCharArray()) { 17 | sum += Character.digit(ch, 10); 18 | } 19 | 20 | System.out.println(sum); 21 | 22 | if (sum % 3 == 0 || sum % 5 == 0 || sum % 7 == 0) { 23 | System.out.println("Lucky Number"); 24 | } else { 25 | System.out.println("Sorry its not my lucky number"); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /java programming/Lucky Number/README.md: -------------------------------------------------------------------------------- 1 | # Lucky Number 2 | 3 | William planned to choose a four digit lucky number for his car. His lucky numbers are 3,5 and 7. Help him find the number, whose sum is divisible by 3 or 5 or 7. 4 | Provide a valid car number, Fails to provide a valid input then display that number is not a valid car number. 5 | Note : The input other than 4 digit positive number[includes negative and 0] is considered as invalid. 6 | Refer the samples, to read and display the data. 7 | 8 | > Sample Input 1: 9 | Enter the car no:1234 10 | 11 | > Sample Output 1: 12 | Lucky Number 13 | 14 | --- 15 | 16 | > Sample Input 2: 17 | 18 | Enter the car no:1214 19 | 20 | > Sample Output 2: 21 | 22 | Sorry its not my lucky number 23 | 24 | --- 25 | 26 | > Sample Input 3: 27 | 28 | Enter the car no:14 29 | 30 | > Sample Output 3: 31 | 32 | 14 is not a valid car number 33 | 34 | -------------------------------------------------------------------------------- /java programming/Member Manipulation/Library.java: -------------------------------------------------------------------------------- 1 | import java.util.ArrayList; 2 | import java.util.List; 3 | import java.util.stream.Collectors; 4 | 5 | public class Library { 6 | private List memberList = new ArrayList<>(); 7 | 8 | public List getMemberList() { 9 | return memberList; 10 | } 11 | 12 | public void setMemberList(List memberList) { 13 | this.memberList = memberList; 14 | } 15 | 16 | public void addMember(Member member) { 17 | memberList.add(member); 18 | } 19 | 20 | public List viewAllMembers() { 21 | return memberList; 22 | } 23 | 24 | public List viewMembersByAddress(String address) { 25 | return memberList.stream().filter(member -> member.getAddress().contains(address)).collect(Collectors.toList()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /java programming/Member Manipulation/Member.java: -------------------------------------------------------------------------------- 1 | public class Member { 2 | private int memberId; 3 | private String memberName; 4 | private String address; 5 | 6 | public Member() { 7 | } 8 | 9 | public Member(int memberId, String memberName, String address) { 10 | this.memberId = memberId; 11 | this.memberName = memberName; 12 | this.address = address; 13 | } 14 | 15 | public int getMemberId() { 16 | return memberId; 17 | } 18 | 19 | public void setMemberId(int memberId) { 20 | this.memberId = memberId; 21 | } 22 | 23 | public String getMemberName() { 24 | return memberName; 25 | } 26 | 27 | public void setMemberName(String memberName) { 28 | this.memberName = memberName; 29 | } 30 | 31 | public String getAddress() { 32 | return address; 33 | } 34 | 35 | public void setAddress(String address) { 36 | this.address = address; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /java programming/Movie Ticket Calculation/README.md: -------------------------------------------------------------------------------- 1 | # Movie Ticket Calculation 2 | 3 | In a multiplex theater, there is a discount scheme announced where one gets a 10% discount on the total cost of tickets when there is a bulk booking of more than 20 tickets, and a discount of 2% on the total cost of tickets if a special coupon card is submitted. Develop a program to find the total cost as per the scheme. The cost of the king class ticket is Rs.75 and queen class is Rs.150. Refreshments can also be opted by paying an additional of Rs. 50 per member. 4 | Hint: k-king and q-queen and You have to book minimum of 5 tickets and maximum of 40 at a time. If fails display "Minimum of 5 and Maximum of 40 Tickets". If circle is given a value other than 'k' or 'q' the output should be "Invalid Input". 5 | 6 | The ticket cost should be printed exactly to two decimal places. 7 | 8 | > Sample Input 1: 9 | 10 | Enter the no of ticket:35 11 | Do you want refreshment:y 12 | Do you have coupon code:y 13 | Enter the circle:k 14 | 15 | > Sample Output 1: 16 | 17 | Ticket cost:4065.25 18 | 19 | --- 20 | 21 | > Sample Input 2: 22 | 23 | Enter the no of ticket:1 24 | 25 | > Sample Output 2: 26 | 27 | Minimum of 5 and Maximum of 40 Tickets -------------------------------------------------------------------------------- /java programming/Number Palindrome/Palindrome.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class Palindrome { 4 | // private static boolean isPalindrome(int num) { 5 | // String numString = String.valueOf(num); 6 | // String reverse = new StringBuffer(numString).reverse().toString(); 7 | // return reverse.equals(numString); 8 | // } 9 | 10 | private static boolean isPalindrome(int num) { 11 | String numString = String.valueOf(num); 12 | int size = numString.length(); 13 | 14 | for (int i = 0; i < size / 2; ++i) { 15 | if (numString.charAt(i) != numString.charAt(size - i -1)) { 16 | return false; 17 | } 18 | } 19 | 20 | return true; 21 | } 22 | 23 | public static void main(String[] args) { 24 | Scanner scanner = new Scanner(System.in); 25 | int num = scanner.nextInt(); 26 | 27 | if (num < 0) { 28 | System.out.println("Invalid Input"); 29 | } else { 30 | if (isPalindrome1(num)) { 31 | System.out.println("Palindrome"); 32 | } else { 33 | System.out.println("Not a Palindrome"); 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /java programming/Number Palindrome/README.md: -------------------------------------------------------------------------------- 1 | # Number Palindrome 2 | 3 | George and Tintin plays by telling numbers. George says a number to Tintin. Tintin should first reverse the number and check if it is same as the original. If yes, Tintin should say “Palindrome”. If not, he should say “Not a Palindrome”. If the number is negative, print “Invalid Input”. Help Tintin by writing a program. 4 | 5 | > Sample Input 1 : 6 | 7 | 21212 8 | 9 | > Sample Output 1 : 10 | 11 | Palindrome 12 | 13 | 14 | > Sample Input 2 : 15 | 16 | 6186 17 | 18 | > Sample Output 2 : 19 | 20 | Not a Palindrome -------------------------------------------------------------------------------- /java programming/Number of New Words/UniqueWords.java: -------------------------------------------------------------------------------- 1 | import java.util.Arrays; 2 | import java.util.List; 3 | import java.util.Scanner; 4 | import java.util.stream.Collectors; 5 | import java.util.stream.IntStream; 6 | 7 | public class UniqueWords { 8 | public static void main(String[] args) { 9 | Scanner scanner = new Scanner(System.in); 10 | 11 | System.out.println("Enter Student's Article"); 12 | String article = scanner.nextLine(); 13 | String[] allWords = article.split("[,;:.?! ]"); 14 | List words = Arrays.stream(allWords) 15 | .filter(string -> !string.isEmpty()) 16 | .collect(Collectors.toList()); 17 | List uniqueWords = words.stream() 18 | .map(String::toLowerCase) 19 | .distinct() 20 | .sorted() 21 | .collect(Collectors.toList()); 22 | 23 | System.out.println("Number of words " + words.size()); 24 | System.out.println("Number of unique words " + uniqueWords.size()); 25 | System.out.println("The words are"); 26 | 27 | IntStream.range(0, uniqueWords.size()) 28 | .forEach(i -> System.out.println(String.format("%d. %s", (i + 1), uniqueWords.get(i)))); 29 | 30 | scanner.close(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /java programming/Numerology number/README.md: -------------------------------------------------------------------------------- 1 | # Numerology number 2 | 3 | Harry is very much interested in learning numerology with a programming Language. Help Harry to implement this task. 4 | Write a java program to find the sum of the digits and the numerology number(Multi-digit numbers are added and reduced to a single digit), followed by the total number of odd numbers and the total number of even numbers. Assume input is greater than zero and less than 10000000. 5 | 6 | For example, if the given number is 7654 then, 7 | 8 | Sum of digits: 22 (7+6+5+4) 9 | 10 | Numerology number: 4 ((7+6+5+4 =22 => 2+2) sum of digits is again added and reduced to a single digit). 11 | 12 | Number of odd numbers: 2 13 | 14 | Number of even numbers: 2 15 | 16 | 17 | > Sample input: 18 | 19 | Enter the number 20 | 86347 21 | 22 | > Sample output: 23 | 24 | Sum of digits 25 | 28 26 | Numerology number 27 | 1 28 | Number of odd numbers 29 | 2 30 | Number of even numbers 31 | 3 32 | 33 | ### Explaination: 34 | 35 | Sum of digit = 28 36 | 37 | Numberogoy number = 1 : 28 => (2 + 8) = 10 => (1 + 0) = 1 38 | 39 | -------------------------------------------------------------------------------- /java programming/Numerology/README.md: -------------------------------------------------------------------------------- 1 | # Numerology 2 | 3 | Write a program to find the numerological value for a given name. 4 | Note: Store the numerological number and the corresponding character in a 2-D array(2*26). Always the given name should be in capital case ,else the name is not valid. Check for the valid name,if the name is invalid print the message "Invalid name".There should not be any space in the name provided. 5 | For example: 6 | A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 7 | 1 2 3 4 5 8 3 5 1 1 2 3 4 5 7 8 1 2 3 4 6 6 6 5 1 7 8 | 9 | > Sample Input 1: 10 | 11 | Enter your name: 12 | SUDHA 13 | 14 | > Sample Output 1: 15 | 16 | Your numerology no is:19 17 | 18 | --- 19 | 20 | > Sample Input 2: 21 | 22 | Enter your name: 23 | kiran 24 | 25 | > Sample Output 2: 26 | 27 | Invalid name 28 | 29 | --- 30 | 31 | > Sample Input 3: 32 | 33 | Enter your name: 34 | ANI34 35 | 36 | > Sample Output 3: 37 | 38 | Invalid name -------------------------------------------------------------------------------- /java programming/Palindrome/Palindrome.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | class Palindrome { 4 | private static boolean isCorrectInput(String word) { 5 | char[] chars = word.toCharArray(); 6 | 7 | for (char ch : chars) { 8 | if (!Character.isLetter(ch)) { 9 | return false; 10 | } 11 | } 12 | 13 | return true; 14 | } 15 | 16 | public static void main(String[] args) { 17 | Scanner scanner = new Scanner(System.in); 18 | System.out.println("Enter the word :"); 19 | String input = scanner.nextLine(); 20 | String word = input.toLowerCase(); 21 | 22 | if (isCorrectInput(word)) { 23 | String reverse = new StringBuffer(word).reverse().toString(); 24 | boolean isPalindrome = word.equals(reverse); 25 | 26 | if (isPalindrome) { 27 | System.out.println(input + " is a palindrome"); 28 | } else { 29 | System.out.println(input + " is not a palindrome"); 30 | } 31 | } else { 32 | System.out.println("Invalid Input"); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /java programming/Palindrome/README.md: -------------------------------------------------------------------------------- 1 | # Palindrome 2 | 3 | Astrologist believes that having a palindromic name is very auspicious . As we all know, a palindrome is a word that can be read the same way in either direction.There should not be a space or any special character in the word entered. If yes, display "Invalid Input". Write a Java program to determine whether a given word is a palindrome or not. 4 | 5 | > Sample Input 1: 6 | 7 | Enter the word : 8 | Malayalam 9 | 10 | > Sample Output 1: 11 | 12 | Malayalam is a Palindrome 13 | 14 | --- 15 | 16 | > Sample Input 2: 17 | 18 | Enter the word : 19 | Apple 20 | 21 | > Sample Output 2: 22 | 23 | Apple is not a Palindrome 24 | 25 | --- 26 | 27 | > Sample Input 3: 28 | 29 | Enter the word : 30 | no on 31 | 32 | > Sample Output 3: 33 | 34 | Invalid Input 35 | 36 | --- 37 | 38 | > Sample Input 4: 39 | 40 | Enter the word : 41 | @nnn 42 | 43 | > Sample Output 4: 44 | 45 | Invalid Input -------------------------------------------------------------------------------- /java programming/Participant List Manipulation/Participant.java: -------------------------------------------------------------------------------- 1 | public class Participant { 2 | private String participantName; 3 | private String departmentName; 4 | private String collegeName; 5 | 6 | public String getParticipantName() { 7 | return participantName; 8 | } 9 | 10 | public void setParticipantName(String participantName) { 11 | this.participantName = participantName; 12 | } 13 | 14 | public String getDepartmentName() { 15 | return departmentName; 16 | } 17 | 18 | public void setDepartmentName(String departmentName) { 19 | this.departmentName = departmentName; 20 | } 21 | 22 | public String getCollegeName() { 23 | return collegeName; 24 | } 25 | 26 | public void setCollegeName(String collegeName) { 27 | this.collegeName = collegeName; 28 | } 29 | 30 | @Override 31 | public String toString() { 32 | return participantName + " " + departmentName + " " + collegeName; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /java programming/Participant List Manipulation/ParticipantUtility.java: -------------------------------------------------------------------------------- 1 | import java.util.ArrayList; 2 | import java.util.Comparator; 3 | import java.util.List; 4 | import java.util.stream.Stream; 5 | 6 | public class ParticipantUtility { 7 | private List participantList = new ArrayList<>(); 8 | 9 | public List getParticipantList() { 10 | return participantList; 11 | } 12 | 13 | public void setParticipantList(List participantList) { 14 | this.participantList = participantList; 15 | } 16 | 17 | public void addParticipant(Participant participant) { 18 | participantList.add(participant); 19 | } 20 | 21 | public Stream viewAllParticipants(String departmentName, String collegeName) { 22 | return participantList.stream() 23 | .filter(participant -> participant.getCollegeName().equals(collegeName) && 24 | participant.getDepartmentName().equals(departmentName)) 25 | .sorted(Comparator.comparing(Participant::getParticipantName)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /java programming/Password Generation/README.md: -------------------------------------------------------------------------------- 1 | # Password Generation 2 | 3 | IDFC, a leading Bank sector offers online shopping to their customers, To avail this offer, the customer will have to generate a security code, for the first time usage of his card to purchase online. 4 | 5 | Hint to generate a security code is as follows : 6 | 7 | Minimum of 8 Characters 8 | Must contain atleast one uppercase, one lowercase and one special character. 9 | Only the special characters @,*,# are allowed. 10 | The code fails to meet the criteria, will response with an error message as shown in the sample output. 11 | 12 | Develop an application to implement this scenario. 13 | 14 | Write a public class Main with the main method. Write the code to get the input, validate and print the output. 15 | 16 | > Sample Input 1: 17 | 18 | Generate your Security Code 19 | Ab12345@ 20 | 21 | > Sample Output 1: 22 | 23 | Security Code Generated Successfully 24 | 25 | --- 26 | 27 | > Sample Input 2: 28 | 29 | Generate your Security Code 30 | S1995p123 31 | 32 | > Sample Output 2: 33 | 34 | Invalid Security Code, Try Again! -------------------------------------------------------------------------------- /java programming/Persist Employee/Employee.java: -------------------------------------------------------------------------------- 1 | import java.io.Serializable; 2 | 3 | public class Employee implements Serializable { 4 | private int employeeId; 5 | private String name; 6 | private float appraisalRating; 7 | 8 | public Employee(int employeeId, String name, float appraisalRating) { 9 | this.employeeId = employeeId; 10 | this.name = name; 11 | this.appraisalRating = appraisalRating; 12 | } 13 | 14 | public int getEmployeeId() { 15 | return employeeId; 16 | } 17 | 18 | public void setEmployeeId(int employeeId) { 19 | this.employeeId = employeeId; 20 | } 21 | 22 | public String getName() { 23 | return name; 24 | } 25 | 26 | public void setName(String name) { 27 | this.name = name; 28 | } 29 | 30 | public float getAppraisalRating() { 31 | return appraisalRating; 32 | } 33 | 34 | public void setAppraisalRating(float appraisalRating) { 35 | this.appraisalRating = appraisalRating; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /java programming/Persist Employee/EmployeeUtility.java: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | import java.util.ArrayList; 3 | 4 | public class EmployeeUtility { 5 | public boolean addEmployee(String fileName, ArrayList employeeList) { 6 | try { 7 | FileOutputStream fileOutputStream = new FileOutputStream(fileName); 8 | ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream); 9 | objectOutputStream.writeObject(employeeList); 10 | 11 | return true; 12 | } catch (IOException ignore) { 13 | } 14 | 15 | return false; 16 | } 17 | 18 | public Employee viewEmployeeById(String fileName, int employeeId) { 19 | try { 20 | FileInputStream fileInputStream = new FileInputStream(fileName); 21 | ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream); 22 | ArrayList employees = (ArrayList) objectInputStream.readObject(); 23 | 24 | for (Employee employee : employees) { 25 | if (employee.getEmployeeId() == employeeId) { 26 | return employee; 27 | } 28 | } 29 | } catch (IOException | ClassNotFoundException ignore) {} 30 | 31 | return null; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /java programming/Persist Employee/Main.java: -------------------------------------------------------------------------------- 1 | import java.util.ArrayList; 2 | import java.util.Arrays; 3 | 4 | public class Main { 5 | public static void main(String[] args) { 6 | Employee employee = new Employee(101, "Ritam", 9.5f); 7 | Employee employee1 = new Employee(102, "Asif", 8.5f); 8 | ArrayList employees = new ArrayList<>(Arrays.asList(employee, employee1)); 9 | EmployeeUtility employeeUtility = new EmployeeUtility(); 10 | employeeUtility.addEmployee("database.emp", employees); 11 | Employee employee2 = employeeUtility.viewEmployeeById("database.emp", 101); 12 | System.out.println(employee2.getName()); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /java programming/PhoneBook Manipulation/Contact.java: -------------------------------------------------------------------------------- 1 | public class Contact { 2 | private String firstName; 3 | private String lastName; 4 | private long phoneNumber; 5 | private String emailId; 6 | 7 | public Contact(String firstName, String lastName, long phoneNumber, String emailId) { 8 | this.firstName = firstName; 9 | this.lastName = lastName; 10 | this.phoneNumber = phoneNumber; 11 | this.emailId = emailId; 12 | } 13 | 14 | public String getFirstName() { 15 | return firstName; 16 | } 17 | 18 | public void setFirstName(String firstName) { 19 | this.firstName = firstName; 20 | } 21 | 22 | public String getLastName() { 23 | return lastName; 24 | } 25 | 26 | public void setLastName(String lastName) { 27 | this.lastName = lastName; 28 | } 29 | 30 | public long getPhoneNumber() { 31 | return phoneNumber; 32 | } 33 | 34 | public void setPhoneNumber(long phoneNumber) { 35 | this.phoneNumber = phoneNumber; 36 | } 37 | 38 | public String getEmailId() { 39 | return emailId; 40 | } 41 | 42 | public void setEmailId(String emailId) { 43 | this.emailId = emailId; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /java programming/PhoneBook Manipulation/PhoneBook.java: -------------------------------------------------------------------------------- 1 | import java.util.ArrayList; 2 | import java.util.List; 3 | 4 | public class PhoneBook { 5 | private List phoneBook = new ArrayList<>(); 6 | 7 | public List getPhoneBook() { 8 | return phoneBook; 9 | } 10 | 11 | public void setPhoneBook(List phoneBook) { 12 | this.phoneBook = phoneBook; 13 | } 14 | 15 | public void addContact(Contact contact) { 16 | phoneBook.add(contact); 17 | } 18 | 19 | public List viewAllContacts() { 20 | return phoneBook; 21 | } 22 | 23 | public Contact viewContactGivenPhone(long phoneNumber) { 24 | for (Contact contact : phoneBook) { 25 | if (contact.getPhoneNumber() == phoneNumber) { 26 | return contact; 27 | } 28 | } 29 | 30 | return null; 31 | } 32 | 33 | public boolean removeContact(long phoneNumber) { 34 | Contact contact = viewContactGivenPhone(phoneNumber); 35 | 36 | if (contact == null) { 37 | return false; 38 | } { 39 | return phoneBook.remove(contact); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /java programming/Placement Enrollment Count/main.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | import java.util.stream.Stream; 3 | 4 | public class Main { 5 | 6 | public static void main(String[] args) { 7 | 8 | Scanner sc=new Scanner(System.in); 9 | //Fill your code here 10 | System.out.println("Enter all roll numbers separated by comma"); 11 | Stream st = Main.getRollNumbers(sc.nextLine()); 12 | System.out.println("Enter the department name acronym"); 13 | String dept = sc.nextLine(); 14 | int result = Main.getCount(st,dept); 15 | if(result == 0){ 16 | System.out.println("No students from "+dept); 17 | } 18 | else{ 19 | System.out.println("Number of students in "+dept+" is "+result); 20 | } 21 | 22 | } 23 | 24 | public static Stream getRollNumbers(String rollNumbers) { 25 | //Fill your code here 26 | String arr[] =rollNumbers.split(","); 27 | List rolllist = Arrays.asList(arr); 28 | return rolllist.stream(); 29 | 30 | 31 | } 32 | 33 | public static int getCount(Stream rollNumberStream, String dept) { 34 | //Fill your code here 35 | 36 | int count = (int)rollNumberStream.filter(s->s.substring(0,2).equalsIgnoreCase(dept)).count(); 37 | return count; 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /java programming/Placement Enrollment Count/question.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/java programming/Placement Enrollment Count/question.pdf -------------------------------------------------------------------------------- /java programming/Player Selection System_JDBC/DB.java: -------------------------------------------------------------------------------- 1 | import java.io.FileInputStream; 2 | import java.io.IOException; 3 | import java.sql.Connection; 4 | import java.sql.DriverManager; 5 | import java.sql.SQLException; 6 | import java.util.Properties; 7 | 8 | public class DB { 9 | 10 | private static Connection con = null; 11 | private static Properties props = new Properties(); 12 | 13 | 14 | //ENSURE YOU DON'T CHANGE THE BELOW CODE WHEN YOU SUBMIT 15 | public static Connection getConnection() throws ClassNotFoundException, SQLException { 16 | try{ 17 | 18 | FileInputStream fis = null; 19 | fis = new FileInputStream("database.properties"); 20 | props.load(fis); 21 | 22 | // load the Driver Class 23 | Class.forName(props.getProperty("DB_DRIVER_CLASS")); 24 | 25 | // create the connection now 26 | con = DriverManager.getConnection(props.getProperty("DB_URL"),props.getProperty("DB_USERNAME"),props.getProperty("DB_PASSWORD")); 27 | } 28 | catch(IOException e){ 29 | e.printStackTrace(); 30 | } 31 | return con; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /java programming/Player Selection System_JDBC/Main.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | public class Main { 4 | public static void main(String[] args) { 5 | 6 | // fill your code here 7 | 8 | Scanner s = new Scanner(System.in); 9 | 10 | System.out.println("Enter the minimum height"); 11 | double minHeight = s.nextDouble(); 12 | 13 | System.out.println("Enter the maximum weight"); 14 | double maxWeight = s.nextDouble(); 15 | s.close(); 16 | 17 | PlayerSelectionSystem pss = new PlayerSelectionSystem(); 18 | 19 | List playerList = pss.playersBasedOnHeightWeight(minHeight, maxWeight); 20 | 21 | if (playerList.isEmpty()) { 22 | System.out.printf("No players are with minimum height of %.1f and maximum weight of %.1f", minHeight, 23 | maxWeight); 24 | return; 25 | } 26 | 27 | for (String player : playerList) { 28 | System.out.println(player); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /java programming/Player Selection System_JDBC/Player.java: -------------------------------------------------------------------------------- 1 | public class Player { 2 | 3 | private int playerId; 4 | private String playerName; 5 | private double height; 6 | private double weight; 7 | public int getPlayerId() { 8 | return playerId; 9 | } 10 | public void setPlayerId(int playerId) { 11 | this.playerId = playerId; 12 | } 13 | public String getPlayerName() { 14 | return playerName; 15 | } 16 | public void setPlayerName(String playerName) { 17 | this.playerName = playerName; 18 | } 19 | public double getHeight() { 20 | return height; 21 | } 22 | public void setHeight(double height) { 23 | this.height = height; 24 | } 25 | public double getWeight() { 26 | return weight; 27 | } 28 | public void setWeight(double weight) { 29 | this.weight = weight; 30 | } 31 | public Player(int playerId, String playerName, double height, double weight) { 32 | super(); 33 | this.playerId = playerId; 34 | this.playerName = playerName; 35 | this.height = height; 36 | this.weight = weight; 37 | } 38 | 39 | 40 | } -------------------------------------------------------------------------------- /java programming/Player Selection System_JDBC/PlayerSelectionSystem.java: -------------------------------------------------------------------------------- 1 | import java.sql.Connection; 2 | import java.sql.ResultSet; 3 | import java.sql.SQLException; 4 | import java.sql.Statement; 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | public class PlayerSelectionSystem { 9 | 10 | public List playersBasedOnHeightWeight(double minHeight, double maxWeight) { 11 | 12 | // Fill your code here 13 | 14 | List playerList = new ArrayList(); 15 | 16 | try { 17 | Connection con = DB.getConnection(); 18 | 19 | String query = "SELECT * FROM player WHERE height >= " + minHeight + " AND weight <= " + maxWeight 20 | + " ORDER BY playerName"; 21 | 22 | Statement st = con.createStatement(); 23 | ResultSet rs = st.executeQuery(query); 24 | 25 | while (rs.next()) { 26 | playerList.add(rs.getString("playerName")); 27 | } 28 | 29 | st.close(); 30 | con.close(); 31 | 32 | } catch (ClassNotFoundException | SQLException e) { 33 | e.printStackTrace(); 34 | } 35 | 36 | return playerList; 37 | } 38 | } -------------------------------------------------------------------------------- /java programming/Player Selection System_JDBC/database.properties: -------------------------------------------------------------------------------- 1 | #IF NEEDED, YOU CAN MODIFY THIS PROPERTY FILE 2 | #ENSURE YOU ARE NOT CHANGING THE NAME OF THE PROPERTY 3 | #YOU CAN CHANGE THE VALUE OF THE PROPERTY 4 | #LOAD THE DETAILS OF DRIVER CLASS, URL, USERNAME AND PASSWORD IN DB.java using this properties file only. 5 | #Do not hard code the values in DB.java. 6 | 7 | DB_DRIVER_CLASS=com.mysql.jdbc.Driver 8 | DB_URL=jdbc:mysql://localhost:3306/pss 9 | DB_USERNAME=root 10 | DB_PASSWORD= 11 | -------------------------------------------------------------------------------- /java programming/Print unique characters/README.md: -------------------------------------------------------------------------------- 1 | # Print unique characters 2 | 3 | Write a program to print all the unique characters in a given sentence. 4 | 5 | The sentence should have only alphabets . 6 | 7 | If the sentence is not valid display the message "Invalid Sentence". 8 | 9 | If unique characters are not found print "No unique characters". 10 | 11 | If unique characters are found print those characters as shown in sample output. 12 | 13 | > Sample Input 1: 14 | 15 | Enter the sentence: 16 | java is an object oriented programming language 17 | 18 | > Sample Output 1: 19 | 20 | Unique characters: 21 | v 22 | s 23 | b 24 | c 25 | d 26 | p 27 | l 28 | u 29 | 30 | --- 31 | 32 | > Sample Input 2: 33 | 34 | Welcome to 12house 35 | 36 | > Sample Output 2: 37 | 38 | Invalid Sentence -------------------------------------------------------------------------------- /java programming/Register a Candidate - User defined Exception(with throw and throws)/Candidate.java: -------------------------------------------------------------------------------- 1 | public class Candidate { 2 | private String name; 3 | private String gender; 4 | private double expectedSalary; 5 | 6 | public String getName() { 7 | return name; 8 | } 9 | 10 | public void setName(String name) { 11 | this.name = name; 12 | } 13 | 14 | public String getGender() { 15 | return gender; 16 | } 17 | 18 | public void setGender(String gender) { 19 | this.gender = gender; 20 | } 21 | 22 | public double getExpectedSalary() { 23 | return expectedSalary; 24 | } 25 | 26 | public void setExpectedSalary(double expectedSalary) { 27 | this.expectedSalary = expectedSalary; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /java programming/Register a Candidate - User defined Exception(with throw and throws)/InvalidSalaryException.java: -------------------------------------------------------------------------------- 1 | public class InvalidSalaryException extends Exception { 2 | public InvalidSalaryException(String message) { 3 | super(message); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /java programming/Register a Candidate - User defined Exception(with throw and throws)/Main.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class Main { 4 | public static Candidate getCandidateDetails() throws InvalidSalaryException { 5 | Scanner scanner = new Scanner(System.in); 6 | 7 | System.out.println("Enter the candidate Details"); 8 | 9 | System.out.println("Name"); 10 | String name = scanner.next(); 11 | 12 | System.out.println("Gender"); 13 | String gender = scanner.next(); 14 | 15 | System.out.println("Expected Salary"); 16 | double salary = scanner.nextDouble(); 17 | 18 | if (salary < 10000) { 19 | throw new InvalidSalaryException("Registration Failed. Salary cannot be less than 10000."); 20 | } else { 21 | Candidate candidate = new Candidate(); 22 | candidate.setName(name); 23 | candidate.setGender(gender); 24 | candidate.setExpectedSalary(salary); 25 | 26 | return candidate; 27 | } 28 | } 29 | 30 | public static void main(String[] args) { 31 | try { 32 | Candidate candidate = getCandidateDetails(); 33 | System.out.println("Registration Successful"); 34 | } catch (InvalidSalaryException e) { 35 | System.out.println(e.getMessage()); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /java programming/Retrieve ID and Price of mobiles with in the range/DB.java: -------------------------------------------------------------------------------- 1 | import java.io.FileInputStream; 2 | import java.io.IOException; 3 | import java.sql.Connection; 4 | import java.sql.DriverManager; 5 | import java.sql.SQLException; 6 | import java.util.Properties; 7 | 8 | public class DB { 9 | private static Connection connection = null; 10 | private static Properties properties = new Properties(); 11 | 12 | public static Connection getConnection() throws ClassNotFoundException, SQLException { 13 | try{ 14 | FileInputStream fileInputStream = new FileInputStream("database.properties"); 15 | properties.load(fileInputStream); 16 | Class.forName(properties.getProperty("DB_DRIVER_CLASS")); 17 | connection = DriverManager.getConnection(properties.getProperty("DB_URL"), properties.getProperty("DB_USERNAME"), properties.getProperty("DB_PASSWORD")); 18 | } 19 | catch(IOException e){ 20 | e.printStackTrace(); 21 | } 22 | 23 | return connection; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /java programming/Retrieve ID and Price of mobiles with in the range/Main.java: -------------------------------------------------------------------------------- 1 | import java.util.Map; 2 | import java.util.Scanner; 3 | 4 | 5 | public class Main { 6 | public static void main(String[] args) { 7 | Scanner scanner = new Scanner(System.in); 8 | MobileManagementSystem mobileManagementSystem = new MobileManagementSystem(); 9 | 10 | System.out.println("Enter the minimum range"); 11 | int minRange = scanner.nextInt(); 12 | System.out.println("Enter the maximum range"); 13 | int maxRange = scanner.nextInt(); 14 | 15 | Map mobiles = mobileManagementSystem.viewMobileWithInTheRange(minRange, maxRange); 16 | 17 | if (mobiles.isEmpty()) { 18 | System.out.println("No mobiles found for the given range\n" + 19 | "\n"); 20 | } else { 21 | mobiles.forEach((key, value) -> System.out.println(key + ":" + value)); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /java programming/Retrieve ID and Price of mobiles with in the range/MobileManagementSystem.java: -------------------------------------------------------------------------------- 1 | import java.sql.Connection; 2 | import java.sql.PreparedStatement; 3 | import java.sql.ResultSet; 4 | import java.sql.SQLException; 5 | import java.util.LinkedHashMap; 6 | import java.util.Map; 7 | 8 | public class MobileManagementSystem { 9 | public Map viewMobileWithInTheRange(int minRange, int maxRange) { 10 | Map mobiles = new LinkedHashMap<>(); 11 | 12 | try { 13 | Connection connection = DB.getConnection(); 14 | PreparedStatement preparedStatement = connection.prepareStatement( 15 | "select productId, price\n" + 16 | "from mobile\n" + 17 | "where price between ? and ?\n" + 18 | "order by productId;" 19 | ); 20 | preparedStatement.setInt(1, minRange); 21 | preparedStatement.setInt(2, maxRange); 22 | 23 | ResultSet resultSet = preparedStatement.executeQuery(); 24 | 25 | while (resultSet.next()) { 26 | int productId = resultSet.getInt(1); 27 | int price = resultSet.getInt(2); 28 | mobiles.put(productId, price); 29 | } 30 | } catch (ClassNotFoundException | SQLException e) { 31 | e.printStackTrace(); 32 | } 33 | 34 | return mobiles; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /java programming/Retrieve ID and Price of mobiles with in the range/database.properties.txt: -------------------------------------------------------------------------------- 1 | DB_DRIVER_CLASS=com.mysql.jdbc.Driver 2 | DB_URL=jdbc:mysql://localhost:3306/testbase 3 | DB_USERNAME=ritam 4 | DB_PASSWORD=password 5 | -------------------------------------------------------------------------------- /java programming/Retrieve ID and Price of mobiles with in the range/script.sql: -------------------------------------------------------------------------------- 1 | create table mobile 2 | ( 3 | productId int, 4 | brandName varchar(30), 5 | modelName varchar(30), 6 | memory varchar(10), 7 | price int, 8 | colour varchar(30) 9 | ); 10 | 11 | desc mobile; 12 | 13 | insert into mobile 14 | values (104, "Redmi", "Note7Pro", "128GB", 11999, "Nebula Red/Black/Neptune Blue"), 15 | (146, "Lenovo", "K9", "32GB", 5999, "Black/Blue"), 16 | (951, "Samsung", "A50", "64GB", 20999, "Black/White/Blue"), 17 | (964, "Samsung", "S9", "128GB", 61900, "Black/Coral Blue/Lilac Purple"); 18 | 19 | select * 20 | from mobile; 21 | 22 | select productId, price 23 | from mobile 24 | where price between 5000 and 20000 25 | order by productId; 26 | 27 | truncate mobile; -------------------------------------------------------------------------------- /java programming/Retrieve customer count based on loan type/DB.java: -------------------------------------------------------------------------------- 1 | import java.io.FileInputStream; 2 | import java.io.IOException; 3 | import java.sql.Connection; 4 | import java.sql.DriverManager; 5 | import java.sql.SQLException; 6 | import java.util.Properties; 7 | 8 | public class DB { 9 | private static Connection connection = null; 10 | private static Properties properties = new Properties(); 11 | 12 | public static Connection getConnection() throws ClassNotFoundException, SQLException { 13 | try{ 14 | FileInputStream fileInputStream = new FileInputStream("database.properties"); 15 | properties.load(fileInputStream); 16 | Class.forName(properties.getProperty("DB_DRIVER_CLASS")); 17 | connection = DriverManager.getConnection(properties.getProperty("DB_URL"), properties.getProperty("DB_USERNAME"), properties.getProperty("DB_PASSWORD")); 18 | } 19 | catch(IOException e){ 20 | e.printStackTrace(); 21 | } 22 | 23 | return connection; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /java programming/Retrieve customer count based on loan type/LoanManagementSystem.java: -------------------------------------------------------------------------------- 1 | import java.sql.Connection; 2 | import java.sql.PreparedStatement; 3 | import java.sql.ResultSet; 4 | import java.sql.SQLException; 5 | 6 | public class LoanManagementSystem { 7 | public int viewLoanCountBasedOnType(String loanType) { 8 | int count = 0; 9 | 10 | try { 11 | Connection connection = DB.getConnection(); 12 | PreparedStatement preparedStatement = connection.prepareStatement( 13 | "select count(loanId)\n" + 14 | "from loan\n" + 15 | "where loanType = ?;" 16 | ); 17 | preparedStatement.setString(1, loanType); 18 | ResultSet resultSet = preparedStatement.executeQuery(); 19 | 20 | while (resultSet.next()) { 21 | count = resultSet.getInt(1); 22 | } 23 | } catch (ClassNotFoundException | SQLException e) { 24 | e.printStackTrace(); 25 | } 26 | 27 | return count; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /java programming/Retrieve customer count based on loan type/Main.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | 4 | public class Main { 5 | public static void main(String[] args) { 6 | Scanner scanner = new Scanner(System.in); 7 | LoanManagementSystem loanManagementSystem = new LoanManagementSystem(); 8 | 9 | while (true) { 10 | System.out.println("Enter the type of loan to be searched"); 11 | String loanType = scanner.next(); 12 | int count = loanManagementSystem.viewLoanCountBasedOnType(loanType); 13 | 14 | if (count > 0) { 15 | System.out.println(String.format("Number of customers who have taken %s loan : %d", loanType, count)); 16 | } else { 17 | System.out.println(String.format("No customer has acquired %s loan", loanType)); 18 | } 19 | 20 | System.out.println("Do you want to searched again the loan type (yes/no)"); 21 | String input = scanner.next(); 22 | 23 | if (input.equalsIgnoreCase("no")) { 24 | System.out.println("Thank you for using the Application"); 25 | break; 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /java programming/Retrieve customer count based on loan type/database.properties.txt: -------------------------------------------------------------------------------- 1 | DB_DRIVER_CLASS=com.mysql.jdbc.Driver 2 | DB_URL=jdbc:mysql://localhost:3306/testbase 3 | DB_USERNAME=ritam 4 | DB_PASSWORD=password 5 | -------------------------------------------------------------------------------- /java programming/Retrieve customer count based on loan type/script.sql: -------------------------------------------------------------------------------- 1 | create table loan 2 | ( 3 | loanId int, 4 | accHolderName varchar(30), 5 | loanType varchar(30), 6 | contactNumber varchar(30), 7 | rateOfInterest double(6, 2), 8 | tenureOfLoan double(6, 2) 9 | ); 10 | 11 | desc loan; 12 | 13 | insert into loan 14 | values (25, "Jordan", "Education", 9865007313, 10.45, 4), 15 | (88, "Kaushik", "Vehicle", 9965655073, 8.70, 7), 16 | (142, "Rohith", "Education", 9758462310, 10.45, 2.5), 17 | (845, "Adam Haynes", "Home", 7373848565, 7.90, 15), 18 | (1021, "Tamil Iniya", "Education", 9876543210, 10.45, 5), 19 | (1654, "Imam Azad", "Personal", 8451203694, 11.25, 5), 20 | (2578, "James", "Gold", 9154762358, 9.15, 1); 21 | 22 | select * from loan; 23 | 24 | select count(loanId) 25 | from loan 26 | where loanType = "Home"; -------------------------------------------------------------------------------- /java programming/Retriving Data from file/FileDemo.java: -------------------------------------------------------------------------------- 1 | import java.io.File; 2 | import java.io.FileReader; 3 | import java.io.IOException; 4 | 5 | public class FileDemo { 6 | public static void main(String[] args) { 7 | try { 8 | FileReader fileReader = new FileReader(new File("log.txt")); 9 | int n; 10 | StringBuilder stringBuilder = new StringBuilder(); 11 | 12 | while ((n = fileReader.read()) != -1) { 13 | stringBuilder.append((char) n); 14 | } 15 | 16 | System.out.println(stringBuilder.toString()); 17 | } catch (IOException e) { 18 | e.printStackTrace(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /java programming/Retriving Data from file/README.md: -------------------------------------------------------------------------------- 1 | # Retrieving Data from file 2 | 3 | Allen started working with I/O in java. Allan's mam has written some contents in the log.txt file. Help Allen to write a java code to display the contents of the file in the console. 4 | -------------------------------------------------------------------------------- /java programming/Retriving Data from file/log.txt: -------------------------------------------------------------------------------- 1 | Welcome to the learning of Streams -------------------------------------------------------------------------------- /java programming/Search a Course/Course.java: -------------------------------------------------------------------------------- 1 | import java.util.HashSet; 2 | import java.util.Scanner; 3 | import java.util.Set; 4 | 5 | class Course { 6 | public static void main(String[] args) { 7 | Scanner scanner = new Scanner(System.in); 8 | int n; 9 | 10 | System.out.println("Enter no of course:"); 11 | n = scanner.nextInt(); 12 | 13 | if (n <= 0) { 14 | System.out.println("Invalid Range"); 15 | } else { 16 | Set courses = new HashSet<>(); 17 | 18 | System.out.println("Enter course names:"); 19 | 20 | for (int i = 0; i < n; ++i) { 21 | String course = scanner.next(); 22 | courses.add(course); 23 | } 24 | 25 | System.out.println("Enter the course to be searched:"); 26 | String courseToBeSearched = scanner.next(); 27 | 28 | if (courses.contains(courseToBeSearched)) { 29 | System.out.println(courseToBeSearched + " course is available"); 30 | } else { 31 | System.out.println(courseToBeSearched + " course is not available"); 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /java programming/Search a Course/README.md: -------------------------------------------------------------------------------- 1 | # Search a Course 2 | 3 | IIHT institution is offering a variety of courses to students. Students have a facility to check whether a particular course is available in the institution. Write a program to help the institution accomplish this task. If the number is less than or equal to zero display "Invalid Range". 4 | 5 | Assume maximum number of courses is 20. 6 | 7 | > Sample Input 1: 8 | 9 | Enter no of course: 10 | 5 11 | Enter course names: 12 | Java 13 | Oracle 14 | C++ 15 | Mysql 16 | Dotnet 17 | Enter the course to be searched: 18 | C++ 19 | 20 | > Sample Output 1: 21 | 22 | C++ course is available 23 | 24 | --- 25 | 26 | > Sample Input 2: 27 | 28 | Enter no of course: 29 | 3 30 | Enter course names: 31 | Java 32 | Oracle 33 | Dotnet 34 | Enter the course to be searched: 35 | C++ 36 | 37 | > Sample Output 2: 38 | 39 | C++ course is not available 40 | 41 | --- 42 | 43 | > Sample Input 3: 44 | 45 | Enter no of course: 46 | 0 47 | 48 | > Sample Output 3: 49 | 50 | Invalid Range -------------------------------------------------------------------------------- /java programming/Search for Trains - JDBC/DB.java: -------------------------------------------------------------------------------- 1 | import java.io.FileInputStream; 2 | import java.io.IOException; 3 | import java.sql.Connection; 4 | import java.sql.DriverManager; 5 | import java.sql.SQLException; 6 | import java.util.Properties; 7 | 8 | public class DB { 9 | 10 | private static Connection con = null; 11 | private static Properties props = new Properties(); 12 | 13 | 14 | //ENSURE YOU DON'T CHANGE THE BELOW CODE WHEN YOU SUBMIT 15 | public static Connection getConnection() throws ClassNotFoundException, SQLException { 16 | try{ 17 | 18 | FileInputStream fis = null; 19 | fis = new FileInputStream("database.properties"); 20 | props.load(fis); 21 | 22 | // load the Driver Class 23 | Class.forName(props.getProperty("DB_DRIVER_CLASS")); 24 | 25 | // create the connection now 26 | con = DriverManager.getConnection(props.getProperty("DB_URL"),props.getProperty("DB_USERNAME"),props.getProperty("DB_PASSWORD")); 27 | } 28 | catch(IOException e){ 29 | e.printStackTrace(); 30 | } 31 | return con; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /java programming/Search for Trains - JDBC/Database.properties: -------------------------------------------------------------------------------- 1 | #IF NEEDED, YOU CAN MODIFY THIS PROPERTY FILE 2 | #ENSURE YOU ARE NOT CHANGING THE NAME OF THE PROPERTY 3 | #YOU CAN CHANGE THE VALUE OF THE PROPERTY 4 | #LOAD THE DETAILS OF DRIVER CLASS, URL, USERNAME AND PASSWORD IN DB.java using this properties file only. 5 | #Do not hard code the values in DB.java. 6 | 7 | DB_DRIVER_CLASS=com.mysql.jdbc.Driver 8 | DB_URL=jdbc:mysql://localhost:3306/tms 9 | DB_USERNAME=root 10 | DB_PASSWORD= 11 | -------------------------------------------------------------------------------- /java programming/Search for Trains - JDBC/Main.java: -------------------------------------------------------------------------------- 1 | import java.util.ArrayList; 2 | import java.util.Scanner; 3 | 4 | public class Main { 5 | public static void main(String[] args) { 6 | Scanner s = new Scanner(System.in); 7 | // fill your code here 8 | 9 | System.out.println("Enter the source"); 10 | String source = s.next(); 11 | 12 | System.out.println("Enter the destination"); 13 | String destination = s.next(); 14 | 15 | System.out.println("Enter the coach type"); 16 | String coachType = s.next(); 17 | s.close(); 18 | 19 | if (coachType.equalsIgnoreCase("AC1") || coachType.equalsIgnoreCase("AC2") || coachType.equalsIgnoreCase("AC3") 20 | || coachType.equalsIgnoreCase("Sleeper") || coachType.equalsIgnoreCase("Seater")) { 21 | 22 | TrainManagementSystem tms = new TrainManagementSystem(); 23 | ArrayList trainList = tms.viewTrain(coachType, source, destination); 24 | 25 | if (trainList.isEmpty()) { 26 | System.out.println("No trains found"); 27 | return; 28 | } 29 | 30 | for (Train train : trainList) { 31 | System.out.println(train.getTrainNumber() + " " + train.getTrainName()); 32 | } 33 | return; 34 | } 35 | System.out.println("Invalid Coach Type"); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /java programming/Search for Trains - JDBC/question.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/java programming/Search for Trains - JDBC/question.pdf -------------------------------------------------------------------------------- /java programming/Shape - Area Volume Calculator/Cube.java: -------------------------------------------------------------------------------- 1 | public class Cube extends Shape implements Spatial { 2 | private double length; 3 | private double width; 4 | private double height; 5 | 6 | public double getLength() { 7 | return length; 8 | } 9 | 10 | public void setLength(double length) { 11 | this.length = length; 12 | } 13 | 14 | public double getWidth() { 15 | return width; 16 | } 17 | 18 | public void setWidth(double width) { 19 | this.width = width; 20 | } 21 | 22 | public double getHeight() { 23 | return height; 24 | } 25 | 26 | public void setHeight(double height) { 27 | this.height = height; 28 | } 29 | 30 | @Override 31 | public double area() { 32 | return 2 * (length * width + length * height + height * width); 33 | } 34 | 35 | @Override 36 | public double volume() { 37 | return height * width * length; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /java programming/Shape - Area Volume Calculator/Rectangle.java: -------------------------------------------------------------------------------- 1 | public class Rectangle extends Shape { 2 | private double length; 3 | private double width; 4 | 5 | public double getLength() { 6 | return length; 7 | } 8 | 9 | public void setLength(double length) { 10 | this.length = length; 11 | } 12 | 13 | public double getWidth() { 14 | return width; 15 | } 16 | 17 | public void setWidth(double width) { 18 | this.width = width; 19 | } 20 | 21 | @Override 22 | public double area() { 23 | return length * width; 24 | } 25 | 26 | @Override 27 | public double volume() { 28 | return -1; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /java programming/Shape - Area Volume Calculator/Shape.java: -------------------------------------------------------------------------------- 1 | public abstract class Shape { 2 | public abstract double area(); 3 | 4 | public abstract double volume(); 5 | } 6 | 7 | 8 | -------------------------------------------------------------------------------- /java programming/Shape - Area Volume Calculator/Spatial.java: -------------------------------------------------------------------------------- 1 | public interface Spatial { 2 | } 3 | -------------------------------------------------------------------------------- /java programming/Shape - Area Volume Calculator/Sphere.java: -------------------------------------------------------------------------------- 1 | public class Sphere extends Shape implements Spatial { 2 | private double radius; 3 | 4 | public double getRadius() { 5 | return radius; 6 | } 7 | 8 | public void setRadius(double radius) { 9 | this.radius = radius; 10 | } 11 | 12 | @Override 13 | public double area() { 14 | return 4.0 * Math.PI * Math.pow(radius, 2); 15 | } 16 | 17 | @Override 18 | public double volume() { 19 | return (4.0 * Math.PI * radius * radius * radius) / 3; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /java programming/Shape - Area Volume Calculator/Triangle.java: -------------------------------------------------------------------------------- 1 | public class Triangle extends Shape { 2 | private double base; 3 | private double height; 4 | 5 | public double getBase() { 6 | return base; 7 | } 8 | 9 | public void setBase(double base) { 10 | this.base = base; 11 | } 12 | 13 | public double getHeight() { 14 | return height; 15 | } 16 | 17 | public void setHeight(double height) { 18 | this.height = height; 19 | } 20 | 21 | @Override 22 | public double area() { 23 | return 0.5 * base * height; 24 | } 25 | 26 | @Override 27 | public double volume() { 28 | return -1; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /java programming/String Concatenation/javacode.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | class Authority 3 | { 4 | public static void main (String[] args) { 5 | Scanner sc=new Scanner(System.in); 6 | System.out.println("Inmate's name:"); 7 | String name=sc.nextLine(); 8 | System.out.println("Inmate's father's name:"); 9 | String fname=sc.nextLine(); 10 | name=name.concat(" ").concat(fname); 11 | char []chars=name.toCharArray(); 12 | for(char c:chars) 13 | { 14 | if(Character.isDigit(c)||c=='+'||c=='!'||c=='@'||c=='#'||c=='%'||c=='$'||c=='^'||c=='&'||c=='*') 15 | { 16 | System.out.println("Invalid name"); 17 | System.exit(0); 18 | } 19 | } 20 | System.out.println(name.toUpperCase()); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /java programming/String Concatenation/question.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/java programming/String Concatenation/question.pdf -------------------------------------------------------------------------------- /java programming/Students Details - Constructor/Student.java: -------------------------------------------------------------------------------- 1 | public class Student { 2 | private int studentId; 3 | private String studentName; 4 | private String studentAddress; 5 | private String collegeName; 6 | 7 | public Student(int studentId, String studentName, String studentAddress, String collegeName) { 8 | this.studentId = studentId; 9 | this.studentName = studentName; 10 | this.studentAddress = studentAddress; 11 | this.collegeName = collegeName; 12 | } 13 | 14 | public Student(int studentId, String studentName, String studentAddress) { 15 | this.studentId = studentId; 16 | this.studentName = studentName; 17 | this.studentAddress = studentAddress; 18 | this.collegeName = "NIT"; 19 | } 20 | 21 | public int getStudentId() { 22 | return studentId; 23 | } 24 | 25 | public String getStudentName() { 26 | return studentName; 27 | } 28 | 29 | public String getStudentAddress() { 30 | return studentAddress; 31 | } 32 | 33 | public String getCollegeName() { 34 | return collegeName; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /java programming/Substitution Cipher Technique/README.md: -------------------------------------------------------------------------------- 1 | # Substitution Cipher Technique 2 | 3 | Ava sitting in the first row wants to send a secret message to her friend Mia who is sitting in the last row. She wrote a secret message in a piece of paper and passed it through her classmates. Ava has used a substitution cipher technique where every letter is replaced with the 7th alphabet before the letter in the alphabet series. Since Mia already knows the technique she easily got the exact message. 4 | 5 | The encrypted text (input) may have numbers or special characters along with letters. If so, ignore those and convert only the letters. If space occurs between the words of input, it must occur in output also. If no letters, then there is `“No hidden message”`. 6 | 7 | Develop a java application that accepts the secret message to decrypt and print the actual message to the screen. Input consists of the encrypted text. 8 | 9 | > Sample Input 1 10 | 11 | Enter the encrypted text: 12 | Pukph 13 | 14 | > Sample Output 1 15 | Decrypted text: 16 | India 17 | 18 | --- 19 | 20 | > Sample Input 2 21 | Enter the encrypted text: 22 | Z23hcl @d$3#haly 23 | 24 | > Sample Output 2 25 | Decrypted text: 26 | Save water 27 | 28 | --- 29 | 30 | > Sample Input 3 31 | Enter the encrypted text: 32 | @67$89##^^ 33 | 34 | > Sample Output 3 35 | No hidden message -------------------------------------------------------------------------------- /java programming/Ticket Price Calculation - Static/Main.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class Main { 4 | public static void main(String[] args) { 5 | Scanner scanner = new Scanner(System.in); 6 | 7 | System.out.println("Enter no of bookings:"); 8 | int bookings = scanner.nextInt(); 9 | 10 | System.out.println("Enter the available tickets:"); 11 | int availableTickets = scanner.nextInt(); 12 | 13 | Ticket ticket = new Ticket(); 14 | ticket.setAvailableTickets(availableTickets); 15 | 16 | for (int i = 0; i < bookings; ++i) { 17 | System.out.println("Enter the ticketid:"); 18 | int ticketId = scanner.nextInt(); 19 | 20 | System.out.println("Enter the price:"); 21 | int price = scanner.nextInt(); 22 | 23 | System.out.println("Enter the no of tickets:"); 24 | int tickets = scanner.nextInt(); 25 | 26 | ticket.setTicketid(ticketId); 27 | ticket.setPrice(price); 28 | 29 | System.out.println("Available tickets: " + ticket.getAvailableTickets()); 30 | 31 | int cost = ticket.calculateTicketCost(tickets); 32 | System.out.println("Total amount:" + cost); 33 | System.out.println("Available ticket after booking:" + ticket.getAvailableTickets()); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /java programming/Ticket Price Calculation - Static/README.md: -------------------------------------------------------------------------------- 1 | # Ticket Price Calculation - Static 2 | 3 | 4 | Create a class Ticket with the following private variables 5 | 6 | - int ticketid; 7 | - int price; 8 | - static int availableTickets; 9 | 10 | Include getters and setters methods in the Ticket class. 11 | 12 | AvailableTickets should hold only positive value. Zero and negative values are not allowed.(This logic should be checked inside the corresponding setter method) 13 | 14 | Write the following method in the Ticket class: 15 | 16 | `public int calculateTicketCost(int nooftickets)` —this method should check the ticket availability, If the tickets are available, reduce the nooftickets from availableTickets and calculate the total amount as nooftickets*price and return the total amount. If the tickets are not available, this method should return -1. 17 | 18 | Write a main method in the Main class to test the application. 19 | 20 | > Sample input and output 21 | 22 | Enter no of bookings: 23 | 2 24 | Enter the available tickets: 25 | 25 26 | Enter the ticketid: 27 | 123 28 | Enter the price: 29 | 100 30 | Enter the no of tickets: 31 | 5 32 | Available tickets: 25 33 | Total amount:500 34 | Available ticket after booking:20 35 | Enter the ticketid: 36 | 124 37 | Enter the price: 38 | 100 39 | Enter the no of tickets: 40 | 2 41 | Available tickets: 20 42 | Total amount:200 43 | Available ticket after booking:18 -------------------------------------------------------------------------------- /java programming/Ticket Price Calculation - Static/Ticket.java: -------------------------------------------------------------------------------- 1 | public class Ticket { 2 | private int ticketid; 3 | private int price; 4 | private static int availableTickets; 5 | 6 | public int getTicketid() { 7 | return ticketid; 8 | } 9 | 10 | public void setTicketid(int ticketid) { 11 | this.ticketid = ticketid; 12 | } 13 | 14 | public int getPrice() { 15 | return price; 16 | } 17 | 18 | public void setPrice(int price) { 19 | this.price = price; 20 | } 21 | 22 | public static int getAvailableTickets() { 23 | return availableTickets; 24 | } 25 | 26 | public static void setAvailableTickets(int availableTickets) { 27 | if (availableTickets > 0) { 28 | Ticket.availableTickets = availableTickets; 29 | } 30 | } 31 | 32 | public int calculateTicketCost(int bookings) { 33 | if (bookings <= availableTickets) { 34 | availableTickets -= bookings; 35 | return bookings * price; 36 | } else { 37 | return -1; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /java programming/Travel Agency/CommissionInfo.java: -------------------------------------------------------------------------------- 1 | public interface CommissionInfo { 2 | public double calculateCommissionAmount(Ticket ticketObj); 3 | 4 | // Fill the code here 5 | 6 | } 7 | -------------------------------------------------------------------------------- /java programming/Travel Agency/Ticket.java: -------------------------------------------------------------------------------- 1 | public class Ticket { 2 | private long pnrNo; 3 | private String passengerName; 4 | private int seatNo; 5 | private String classType; 6 | private double ticketFare; 7 | 8 | 9 | public long getPnrNo() { 10 | return pnrNo; 11 | } 12 | public void setPnrNo(long pnrNo) { 13 | this.pnrNo = pnrNo; 14 | } 15 | public String getPassengerName() { 16 | return passengerName; 17 | } 18 | public void setPassengerName(String passengerName) { 19 | this.passengerName = passengerName; 20 | } 21 | public int getSeatNo() { 22 | return seatNo; 23 | } 24 | public void setSeatNo(int seatNo) { 25 | this.seatNo = seatNo; 26 | } 27 | public String getClassType() { 28 | return classType; 29 | } 30 | public void setClassType(String classType) { 31 | this.classType = classType; 32 | } 33 | public double getTicketFare() { 34 | return ticketFare; 35 | } 36 | public void setTicketFare(double ticketFare) { 37 | this.ticketFare = ticketFare; 38 | } 39 | public Ticket(){ 40 | 41 | } 42 | 43 | 44 | public Ticket( long pnrNo,String passengerName,int seatNo, String classType, double ticketFare){ 45 | this.pnrNo = pnrNo; 46 | this.passengerName = passengerName; 47 | this.seatNo = seatNo; 48 | this.classType = classType; 49 | this.ticketFare = ticketFare; 50 | } 51 | 52 | // Write the 5 argument constructor 53 | 54 | } 55 | -------------------------------------------------------------------------------- /java programming/Travel Agency/question.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/java programming/Travel Agency/question.pdf -------------------------------------------------------------------------------- /java programming/Validate Name/Validate.java: -------------------------------------------------------------------------------- 1 | public interface Validate { 2 | boolean validateName(String name); 3 | } 4 | -------------------------------------------------------------------------------- /java programming/Validate PAN/PanCard.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | import java.util.regex.Matcher; 3 | import java.util.regex.Pattern; 4 | 5 | class PanCard { 6 | public static void main(String[] args) { 7 | Scanner scanner = new Scanner(System.in); 8 | Pattern pattern = Pattern.compile("^[A-Z]{5}(\\d){4}[A-Z]$"); 9 | String panNo; 10 | 11 | System.out.println("Enter the PAN no:"); 12 | panNo = scanner.next(); 13 | 14 | Matcher matcher = pattern.matcher(panNo); 15 | 16 | if (matcher.matches()) { 17 | System.out.println("Valid PAN no"); 18 | } else { 19 | System.out.println("Invalid PAN no"); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /java programming/Validate PAN/README.md: -------------------------------------------------------------------------------- 1 | # Validate PAN 2 | 3 | Write a program to check the PAN card no is valid or not. Generally a PAN no is a mix of both numbers and alphabets. It should have exactly 10 characters, in which, the first 5 characters should be upper case, the next 4 should be numbers, and last one should be an upper case character. If the PAN no doesn't match the pattern print "Invalid PAN no". 4 | 5 | > Sample Input 1: 6 | 7 | Enter the PAN no: 8 | ASDFG7896K 9 | 10 | > Sample Output 1: 11 | 12 | Valid PAN no 13 | 14 | --- 15 | 16 | > Sample Input 2: 17 | 18 | Enter the PAN no: 19 | 7896ABC8K 20 | 21 | > Sample Output 2: 22 | 23 | Invalid PAN no -------------------------------------------------------------------------------- /java programming/Vehicle-Loan-Insurance - Use Interface/Insurance.java: -------------------------------------------------------------------------------- 1 | public interface Insurance { 2 | double takeInsurance(); 3 | } 4 | -------------------------------------------------------------------------------- /java programming/Vehicle-Loan-Insurance - Use Interface/Loan.java: -------------------------------------------------------------------------------- 1 | public interface Loan { 2 | double issueLoan(); 3 | } 4 | -------------------------------------------------------------------------------- /java programming/Vehicle-Loan-Insurance - Use Interface/Main.java: -------------------------------------------------------------------------------- 1 | public class Main { 2 | public static void main(String[] args) { 3 | Vehicle vehicle = new Vehicle("WB3535", "Hero Spender Plus", "2 wheeler", 80000); 4 | System.out.println(vehicle.issueLoan()); 5 | System.out.println(vehicle.takeInsurance()); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /java programming/ZeeZee Bank/Account.java: -------------------------------------------------------------------------------- 1 | public class Account { 2 | private long accountNumber; 3 | private double balanceAmount; 4 | 5 | public Account(long accountNumber, double balanceAmount) { 6 | this.accountNumber = accountNumber; 7 | this.balanceAmount = balanceAmount; 8 | } 9 | 10 | public long getAccountNumber() { 11 | return accountNumber; 12 | } 13 | 14 | public void setAccountNumber(long accountNumber) { 15 | this.accountNumber = accountNumber; 16 | } 17 | 18 | public double getBalanceAmount() { 19 | return balanceAmount; 20 | } 21 | 22 | public void setBalanceAmount(double balanceAmount) { 23 | this.balanceAmount = balanceAmount; 24 | } 25 | 26 | public void deposit(double depositAmount) { 27 | balanceAmount += depositAmount; 28 | } 29 | 30 | public boolean withdraw(double withdrawAmount) { 31 | if (withdrawAmount <= balanceAmount) { 32 | balanceAmount -= withdrawAmount; 33 | return true; 34 | } 35 | 36 | return false; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /java programming/ZeeZee Bank/Main.java: -------------------------------------------------------------------------------- 1 | import java.text.DecimalFormat; 2 | import java.util.Scanner; 3 | 4 | public class Main { 5 | public static void main(String[] args) { 6 | Scanner scanner = new Scanner(System.in); 7 | DecimalFormat decimalFormat = new DecimalFormat("0.00"); 8 | 9 | System.out.println("Enter the account number:"); 10 | long accountNumber = scanner.nextLong(); 11 | 12 | System.out.println("Enter initial balance:"); 13 | double balanceAmount = scanner.nextDouble(); 14 | 15 | Account account = new Account(accountNumber, balanceAmount); 16 | 17 | System.out.println("Enter the amount to be deposited:"); 18 | double depositAmount = scanner.nextDouble(); 19 | account.deposit(depositAmount); 20 | double availableBalance = account.getBalanceAmount(); 21 | 22 | System.out.println("Available balance is:" + decimalFormat.format(availableBalance)); 23 | 24 | System.out.println("Enter the amount to be withdrawn:"); 25 | double withdrawAmount = scanner.nextDouble(); 26 | boolean isWithdrawn = account.withdraw(withdrawAmount); 27 | availableBalance = account.getBalanceAmount(); 28 | 29 | if (!isWithdrawn) { 30 | System.out.println("Insufficient balance"); 31 | } 32 | 33 | System.out.println("Available balance is:" + decimalFormat.format(availableBalance)); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /java programming/ZeeZee Bank/README.md: -------------------------------------------------------------------------------- 1 | # ZeeZee Bank 2 | 3 | > Sample Input and Output 1: 4 | 5 | Enter the account number: 6 | 9876543210 7 | Enter initial balance: 8 | 15000 9 | Enter the amount to be deposited: 10 | 1500 11 | Available balance is:16500.00 12 | Enter the amount to be withdrawn: 13 | 500 14 | Available balance is:16000.00 15 | 16 | > Sample Input and Output 2: 17 | 18 | Enter the account number: 19 | 9876543210 20 | Enter initial balance: 21 | 15000 22 | Enter the amount to be deposited: 23 | 1500 24 | Available balance is:16500.00 25 | Enter the amount to be withdrawn: 26 | 18500 27 | Insufficient balance 28 | Available balance is:16500.00 -------------------------------------------------------------------------------- /java programming/uwu.txt: -------------------------------------------------------------------------------- 1 | ENJOY THE JAVA 2 | -------------------------------------------------------------------------------- /java_script/emp experience.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | class Employee 3 | { 4 | constructor(name,designation,year_of_experience){ 5 | this.name=name; 6 | this.designation=designation; 7 | this.year_of_experience=year_of_experience; 8 | } 9 | } 10 | 11 | function createEmployee(name, designation, year_of_experience) 12 | { 13 | let obj=new Employee(name,designation,year_of_experience) 14 | return obj; 15 | 16 | } 17 | function displayEmployee(name,designation,year_of_experience){ 18 | let obj=createEmployee(name,designation,year_of_experience) 19 | if(validateObject(obj)){ 20 | let currentDate=new Date() 21 | let actual_year_of_experience=currentDate.getFullYear()-obj.year_of_experience-2; 22 | let result=obj.name+" is serving the position of "+obj.designation+" since "+actual_year_of_experience; 23 | console.log(result); 24 | return result; 25 | } 26 | } 27 | displayEmployee("Jerold","Manager",15); 28 | function validateObject(employee) 29 | { 30 | if(employee instanceof Employee){ 31 | return true; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /java_script/placing order for cake.txt: -------------------------------------------------------------------------------- 1 | 2 | function OrderCake(str) { 3 | var kg=parseInt(str.slice(0,4))/1000; 4 | var name=str.slice(4,str.length-3) 5 | var orderid=str.slice(str.length-3,str.length) 6 | var price=Math.round(kg*450) 7 | var result="Your order for "+Math.ceil(kg)+" kg "+name+" cake has been taken. You are requested to pay Rs. "+price+" on the order no "+orderid; 8 | 9 | console.log(result) 10 | return result 11 | } 12 | OrderCake("5848ButterBlast485") -------------------------------------------------------------------------------- /java_script/unique character.txt: -------------------------------------------------------------------------------- 1 | function modifyString(str) 2 | { 3 | var removeWhiteSpace=str.replace(/\s+/g, ''); 4 | return removeWhiteSpace.toLowerCase(); 5 | } 6 | 7 | function uniqueCharacters(str) 8 | { 9 | var s=modifyString(str); 10 | var result=new Set(s) 11 | result=Array.from(result).join('') 12 | return result 13 | 14 | } 15 | console.log(uniqueCharacters("Welcome to the Javascript course")); -------------------------------------------------------------------------------- /java_script/validate email.txt: -------------------------------------------------------------------------------- 1 | function validateEmail(email) 2 | { 3 | var reg = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/; 4 | if (reg.test(email)){ 5 | return ("Valid email address!"); 6 | } 7 | else{ 8 | return ("Invalid email address!"); 9 | } 10 | } 11 | console.log(validateEmail('info123@example.com')); 12 | console.log(validateEmail('abc-defmail.com')); -------------------------------------------------------------------------------- /java_script/word play.txt: -------------------------------------------------------------------------------- 1 | function wordPlay(number){ 2 | //fill the code 3 | if(number > 50) return "Range is High"; 4 | else if(number < 1) return "Not Valid"; 5 | else{ 6 | var res = ""; 7 | for(var i=1;i<=number;++i) 8 | { 9 | if(i%3 === 0 && i%5 === 0) 10 | { 11 | res +=" Jump"; 12 | } 13 | else if(i % 3 === 0) 14 | { 15 | res += " Tap"; 16 | } 17 | else if(i % 5 === 0) 18 | { 19 | res += " Clap"; 20 | } 21 | else{ 22 | res += " "+i; 23 | } 24 | } 25 | return res; 26 | } 27 | } 28 | console.log(wordPlay(16)); 29 | console.log(wordPlay(-16)); -------------------------------------------------------------------------------- /jquery/error message.txt: -------------------------------------------------------------------------------- 1 | the HTML part: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | the JS part: 24 | 25 | 26 | //WRITE YOUR jQUERY CODE HRE 27 | 28 | $("#btn-id").click(function(){ 29 | $.ajax({ 30 | url:'employee.json', 31 | dataType:'json', 32 | success: function(data){ 33 | $("#err-id").html('Success Message: File found'); 34 | }, 35 | statusCode:{ 36 | 404: function() { 37 | $("#err-id").html('Error Message: Not found'); 38 | } 39 | } 40 | }); 41 | }); -------------------------------------------------------------------------------- /jquery/get json data.txt: -------------------------------------------------------------------------------- 1 | the HTML part: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | The jQuery Example 10 | 11 | 12 | 13 | 14 |
15 | 16 |
17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | the JS part: 28 | 29 | 30 | $("#btn-id").click(function() { 31 | $.getJSON("https://reqres.in/api/users?page=2", function(json) { 32 | $("#data-id").html('') 33 | json.data.forEach(function(jd) { 34 | $("#data-id").append(jd.id + "--" + jd.email + '
'); 35 | }) 36 | }); 37 | }); -------------------------------------------------------------------------------- /jquery/ice cream flovour.txt: -------------------------------------------------------------------------------- 1 | the HTML part: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | jQuery Select Element by Compound Selector 11 | 12 | 13 | 14 | 15 |

ICE CREAM TYPES

16 |

Choose Your Flavours

17 |
    18 |
  • Moon Mist
  • 19 |
  • Moose Tracks
  • 20 |
  • Raspberry Ripple
  • 21 |
22 |
    23 |
  • Purple Cow
  • 24 |
  • Snow White
  • 25 |
  • Sherbet Cooler
  • 26 |
27 |
    28 |
  • Oyster Ice Cream
  • 29 |
  • Hokey Pokey
  • 30 |
  • Blue Moon
  • 31 |
32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | the JS part: 41 | 42 | 43 | // WRITE YOUR CODE HERE 44 | 45 | $("p").css({"color":"orange"}); 46 | $("p:nth-child(2)").css({"font-size":"50%"}); 47 | $(".flavours li").css({"background-color":"lightblue","font-size":"120%"}); 48 | $("#icecreamfloats li").css({"background-color":"orange"}); -------------------------------------------------------------------------------- /jquery/load jquery.txt: -------------------------------------------------------------------------------- 1 | the HTML part: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Test if jQuery is loaded 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | the JS part: 25 | 26 | 27 | $(document).ready(function(){ 28 | $("#msg").html("

jQuery is loaded!!!

"); 29 | 30 | }); -------------------------------------------------------------------------------- /jquery/select the boxes.txt: -------------------------------------------------------------------------------- 1 | the HTML part: 2 | 3 | 4 | 5 | 6 | 7 |
8 | Red 9 | Green 10 | Blue 11 | Black
12 |
0 boxes are checked
13 |
14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | the JS part: 26 | 27 | $("input[type=checkbox]").on("click",function(){ 28 | var checkCount = $('input:checkbox:checked').length; 29 | if(checkCount<=1) 30 | $('#result').html(checkCount+' box is checked'); 31 | else 32 | $('#result').html(checkCount+' boxes are checked'); 33 | }); -------------------------------------------------------------------------------- /jquery/three divition.txt: -------------------------------------------------------------------------------- 1 | the HTML part: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 16 | 17 | 18 | 19 | 20 | 21 |
22 |

Distributed Artificial Intelligence (DAI)

23 |
24 |
25 |

Artificial Super Intelligence (ASI)

26 |
27 |
28 |

Intelligence Amplification (IA))

29 |
30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | The JS part: 41 | 42 | 43 | $('#button1').click(function(){ 44 | $("div[name$='DAIntelligence']").css( "background", "yellow" ); 45 | $("div[name$='ASI_Intelligence']").css( "background", "yellow" ); 46 | }); -------------------------------------------------------------------------------- /jquery/wellcome msg.txt: -------------------------------------------------------------------------------- 1 | The HTML part: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | Enter your name: 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | The JS part: 23 | 24 | 25 | $("#btnId").click(function() { 26 | var name = $("#txt").val(); 27 | $("#address").html('"

Welcome '+name+'!"

'); 28 | }); -------------------------------------------------------------------------------- /microservice/MS_HANDSON-01.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/microservice/MS_HANDSON-01.zip -------------------------------------------------------------------------------- /microservice/MS_HANDSON-02.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/microservice/MS_HANDSON-02.zip -------------------------------------------------------------------------------- /microservice/MS_HANDSON-03.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/microservice/MS_HANDSON-03.zip -------------------------------------------------------------------------------- /microservice/read.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /react/ReactJS-HOL_001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/react/ReactJS-HOL_001.zip -------------------------------------------------------------------------------- /react/ReactJS-HOL_002.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/react/ReactJS-HOL_002.zip -------------------------------------------------------------------------------- /react/ReactJS-HOL_003.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/react/ReactJS-HOL_003.zip -------------------------------------------------------------------------------- /react/ReactJS-HOL_004.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/react/ReactJS-HOL_004.zip -------------------------------------------------------------------------------- /react/ReactJS-HOL_005.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/react/ReactJS-HOL_005.zip -------------------------------------------------------------------------------- /react/ReactJS-HOL_006.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/react/ReactJS-HOL_006.zip -------------------------------------------------------------------------------- /react/ReactJS-HOL_007.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/react/ReactJS-HOL_007.zip -------------------------------------------------------------------------------- /react/ReactJS-HOL_008.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/react/ReactJS-HOL_008.zip -------------------------------------------------------------------------------- /react/ReactJS-HOL_009.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/react/ReactJS-HOL_009.zip -------------------------------------------------------------------------------- /react/ReactJS-HOL_010.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/react/ReactJS-HOL_010.zip -------------------------------------------------------------------------------- /react/ReactJS-HOL_011.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/react/ReactJS-HOL_011.zip -------------------------------------------------------------------------------- /react/ReactJS-HOL_012.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/react/ReactJS-HOL_012.zip -------------------------------------------------------------------------------- /react/ReactJS-HOL_013.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/react/ReactJS-HOL_013.zip -------------------------------------------------------------------------------- /react/read.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring data/04 - 01 Spring-data-jpa-Hands on.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/spring data/04 - 01 Spring-data-jpa-Hands on.zip -------------------------------------------------------------------------------- /spring data/04 - 02 Spring-data-jpa-Hands on.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/spring data/04 - 02 Spring-data-jpa-Hands on.zip -------------------------------------------------------------------------------- /spring data/04 - 03 Spring-data-jpa-Hands on.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/spring data/04 - 03 Spring-data-jpa-Hands on.zip -------------------------------------------------------------------------------- /spring data/read.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring rest/03-01-spring-rest-handson.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/spring rest/03-01-spring-rest-handson.zip -------------------------------------------------------------------------------- /spring rest/03-02-spring-rest-handson.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/spring rest/03-02-spring-rest-handson.zip -------------------------------------------------------------------------------- /spring rest/03-03-spring-rest-handson.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/spring rest/03-03-spring-rest-handson.zip -------------------------------------------------------------------------------- /spring rest/03-04-spring-rest-handson.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/spring rest/03-04-spring-rest-handson.zip -------------------------------------------------------------------------------- /spring rest/JWT-handson (1).zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devraj2000/learning_path_JF/2fb982d598615ad20a50f19802f136f9a941c469/spring rest/JWT-handson (1).zip -------------------------------------------------------------------------------- /spring rest/read.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /unix and shell scripting/copy_complete_directrory.sh: -------------------------------------------------------------------------------- 1 | cp -ir mydir/colors/basic mydir/colors/blended mydir/shape 2 | -------------------------------------------------------------------------------- /unix and shell scripting/copy_directrory.sh: -------------------------------------------------------------------------------- 1 | cp -rf livingthings/birds livingthings/plants 2 | -------------------------------------------------------------------------------- /unix and shell scripting/copy_file5.sh: -------------------------------------------------------------------------------- 1 | cp livingthings/birds/flyingbirds/eider livingthings/animals/mammals 2 | -------------------------------------------------------------------------------- /unix and shell scripting/copy_file6.sh: -------------------------------------------------------------------------------- 1 | cp livingthings/birds/flyingbirds/eagle livingthings/birds/nonflyingbirds 2 | -------------------------------------------------------------------------------- /unix and shell scripting/find_string7.sh: -------------------------------------------------------------------------------- 1 | grep ^echo teknoscript.txt 2 | -------------------------------------------------------------------------------- /unix and shell scripting/find_string8.sh: -------------------------------------------------------------------------------- 1 | grep -v ^# teknoscript.txt 2 | -------------------------------------------------------------------------------- /unix and shell scripting/grep_command1.sh: -------------------------------------------------------------------------------- 1 | grep ';$' employee.txt 2 | -------------------------------------------------------------------------------- /unix and shell scripting/grep_command2.sh: -------------------------------------------------------------------------------- 1 | grep -v ';$' employee.txt 2 | -------------------------------------------------------------------------------- /unix and shell scripting/list_of_files2.sh: -------------------------------------------------------------------------------- 1 | ls -r 2 | -------------------------------------------------------------------------------- /unix and shell scripting/list_of_files3.sh: -------------------------------------------------------------------------------- 1 | #provide the option to list the contents of the current directories in comma seperated fashion 2 | ls -m 3 | -------------------------------------------------------------------------------- /unix and shell scripting/move_file1.sh: -------------------------------------------------------------------------------- 1 | mv mydir/animals/mammals/dog mydir/shape 2 | -------------------------------------------------------------------------------- /unix and shell scripting/move_file2.sh: -------------------------------------------------------------------------------- 1 | mv mydir/animals/reptiles/snakes mydir/shape 2 | -------------------------------------------------------------------------------- /unix and shell scripting/pattern_printing.sh: -------------------------------------------------------------------------------- 1 | for ((i=1;i<=5;i++)) 2 | do 3 | for ((j=1;j<=i;j++)) 4 | do 5 | echo -e "$i\c" 6 | done 7 | echo "" 8 | done 9 | -------------------------------------------------------------------------------- /unix and shell scripting/script_to_count.sh: -------------------------------------------------------------------------------- 1 | file="$1" 2 | w=`cat $file | wc -w` 3 | c=`cat $file | wc -c` 4 | l=`grep -c "." $file` 5 | echo "Number of characters in $file is $c" 6 | echo "Number of words in $file is $w" 7 | echo "Number of lines in $file is $l" 8 | -------------------------------------------------------------------------------- /unix and shell scripting/shellScripting.sh: -------------------------------------------------------------------------------- 1 | while read line 2 | do 3 | if [[ $line =~ Male$ ]] 4 | then 5 | printf '%s\n' "$line" >> male_nominee.txt 6 | fi 7 | if [[ $line =~ Female$ ]] 8 | then 9 | printf '%s\n' "$line" >> female_nominee.txt 10 | fi 11 | done < names.txt 12 | --------------------------------------------------------------------------------