0% found this document useful (0 votes)
3 views4 pages

Java Practice Set Linked in

The document outlines a Java Skill Practice Set divided into five levels, ranging from basic logic to file handling and mini projects. Each level includes specific tasks such as calculating sums of even and odd numbers, reversing words in a sentence, and implementing classes for a student marks system and a library management system. A suggested plan for completing the tasks over several days is also provided, along with tips for using various Java features effectively.

Uploaded by

Kumar Anil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views4 pages

Java Practice Set Linked in

The document outlines a Java Skill Practice Set divided into five levels, ranging from basic logic to file handling and mini projects. Each level includes specific tasks such as calculating sums of even and odd numbers, reversing words in a sentence, and implementing classes for a student marks system and a library management system. A suggested plan for completing the tasks over several days is also provided, along with tips for using various Java features effectively.

Uploaded by

Kumar Anil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Java Skill Practice Set (Post-LinkedIn Course)

🔹 Level 1 – Basics + Logic

1. Even or Odd Sum

Description: Read N integers from the user. Print the sum of even and odd numbers separately. Input: 5
numbers: 2 3 6 7 8 Output:

Even Sum = 16
Odd Sum = 10

Test Cases:

• Input: 1 2 3 4 5 → Output: Even Sum = 6, Odd Sum = 9


• Input: 0 0 0 → Output: Even Sum = 0, Odd Sum = 0

2. Reverse Words in a Sentence

Description: Reverse the order of words in a sentence. Input: "Java is fun" Output:
"fun is Java" Test Cases:

• Input: "Hello World" → Output: "World Hello"


• Input: "One Two Three" → Output: "Three Two One"

3. Prime Checker using Method

Description: Implement isPrime(int n) method. Input: 29 Output:

29 is a Prime number.

Test Cases:

• Input: 10 → Output: Not Prime


• Input: 13 → Output: Prime

1
🔹 Level 2 – OOP and Classes

4. Student Marks System

Description: Create a Student class with name, rollNo, and marks of 3 subjects. Add methods to calculate
total, average, and grade. Bonus: Display topper among multiple students. Test Cases:

• 3 Students: Display names and who has highest average.

5. Bank Account Class

Description: Implement a class with deposit, withdraw, and checkBalance methods. Prevent overdrawing.
Test Case:

• Deposit: 1000
• Withdraw: 500
• Check Balance: 500
• Try withdrawing 1000 → Show error

🔹 Level 3 – Arrays, Collections

6. Frequency in Array (Without Map)

Input: 1 2 2 3 1 Output:

1 occurs 2 times
2 occurs 2 times
3 occurs 1 time

7. Word Frequency using HashMap

Input: "apple banana apple orange banana apple" Output:

apple: 3
banana: 2
orange: 1

8. Sort Students by Marks

Input: List of Student objects with total marks. Output: Sorted list in descending order by marks. Use
Comparator with Collections.sort() .

2
🔹 Level 4 – File Handling + Exceptions

9. Save Student Data to File

Task: Take input (name, rollNo, marks), save to students.txt Format in File:

Name: John, Roll: 101, Marks: 78, 88, 91

10. Read File and Display Records

Task: Read from students.txt and display nicely. Output:

Student Record:
John - Roll No: 101 - Marks: 78, 88, 91

🔹 Level 5 – Mini Project

11. Library Management System

Classes:

• Book (id, name, author)


• User (id, name)
• Library

Features:

• Add Book
• Issue Book
• Return Book
• Show Available Books
• Save issued records to a file

Test Scenario:

• Add 3 books
• Issue 1 book to a user
• Display available books
• Return book and verify

3
📅 Suggested Plan

• Day 1: Q1, Q2, Q3


• Day 2: Q4
• Day 3: Q5
• Day 4: Q6, Q7
• Day 5: Q8
• Day 6: Q9, Q10
• Day 7-8: Q11 (Project)

Tips:

• Use Scanner for input.


• Use ArrayList , HashMap , File , Exception properly.
• Test with edge cases.

Would you like me to convert this to PDF now?

You might also like