Docsity

syllabus for java programming, Schemes and Mind Maps of Java Programming

Toggle sidebar
bg1
Course Code
Course Title
L
T
P
C
BACSE102 Problem Solving using Java 0 0 4 2
Pre
-
requisite
Nil
1
Course Objectives
To introduce the fundamental concepts of object-oriented programming using the Java
language, including data types, control structures, and basic programming constructs
To enable students to design and implement Java programs utilizing classes, objects,
inheritance, polymorphism, and interfaces to build modular and reusable code
To equip students with a comprehensive understanding of Java's exception handling
and multithreading capabilities. Java's File Object, input/output (I/O) streams and to
equip students with the skills to leverage generic programming and the Java Collection
Framework with Databases
Course Outcomes
Develop basic Java programs utilizing fundamental programming constructs, object-
oriented principles such as classes, objects, inheritance, and polymorphism
Implement robust and efficient Java applications by applying exception handling
techniques, managing concurrent execution using threads, and performing file
input/output operations.
Utilize the Java Collection Framework, including Lists and Maps, along with generic
programming concepts to effectively manage and manipulate data within Java
applications.
Indicative Experiments
1.
a. Calculating Interest for Financing Options, Bobby is a financial analyst
working for a construction company. He is tasked with evaluating two
financing options for funding a new construction project. Each option
involves different principal amounts and annual interest rates. Write a
program for him that takes the principal amounts and interest rates for
both financing options as input and calculates the respective interests for
the financial options.
Note: Multiply the principal amount by the annual interest rate and then
divide by 100 to find the total interest paid
b. Three-Digit Number Analysis: Sum of Digits and Parity Check. Alex is
teaching a class on number properties and wants to create an exercise
for his students. He needs a program that takes a three-digit number as
2 hours
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download syllabus for java programming and more Schemes and Mind Maps Java Programming in PDF only on Docsity!

Course Code Course Title L T P C BACSE102 Problem Solving using Java 0 0 4 2 Pre-requisite Nil Syllabus Version 1 Course Objectives To introduce the fundamental concepts of object-oriented programming using the Java language, including data types, control structures, and basic programming constructs To enable students to design and implement Java programs utilizing classes, objects, inheritance, polymorphism, and interfaces to build modular and reusable code To equip students with a comprehensive understanding of Java's exception handling and multithreading capabilities. Java's File Object, input/output (I/O) streams and to equip students with the skills to leverage generic programming and the Java Collection Framework with Databases Course Outcomes Develop basic Java programs utilizing fundamental programming constructs, object- oriented principles such as classes, objects, inheritance, and polymorphism Implement robust and efficient Java applications by applying exception handling techniques, managing concurrent execution using threads, and performing file input/output operations. Utilize the Java Collection Framework, including Lists and Maps, along with generic programming concepts to effectively manage and manipulate data within Java applications. Indicative Experiments

a. Calculating Interest for Financing Options, Bobby is a financial analyst working for a construction company. He is tasked with evaluating two financing options for funding a new construction project. Each option involves different principal amounts and annual interest rates. Write a program for him that takes the principal amounts and interest rates for both financing options as input and calculates the respective interests for the financial options. Note: Multiply the principal amount by the annual interest rate and then divide by 100 to find the total interest paid b. Three-Digit Number Analysis: Sum of Digits and Parity Check. Alex is teaching a class on number properties and wants to create an exercise for his students. He needs a program that takes a three-digit number as 2 hours

input, calculates the sum of its digits, and determines whether the sum is even or odd. Write a program to assist Alex in this task. c. Generating Prime Numbers Within a Specified Range. Arun is tasked with creating a program that prints prime numbers within a given range. The program should take two integers, start and end, as input, and output the prime numbers between these two values (inclusive). Help Arun to complete the task using a 'for' loop.

a.Calculating Total Distance from Merged Daily Step Counts You are given the number of steps a person takes on two consecutive days. Your task is to merge the step counts from both days and calculate the total distance the person covers, assuming that each step covers a fixed distance of 1 unit. Write a program that takes the step counts for the two days as input, merges them, calculates the total distance covered and outputs the result. b. Identifying and Locating Prime Numbers in a 2D Grid Yashna is creating a program to analyse a 2D grid, identifying prime numbers and printing their coordinates. The input consists of the grid's dimensions and elements. The program's output displays the coordinates of each prime number found in the grid, aiding in the exploration of numerical patterns. Can you assist Yashna in creating the program? 2 hours

a. Designing a Rectangle Class to Calculate Area and Perimeter. Arun wants to design a program using a class that calculates and prints both the area and perimeter of a rectangle. Define a class named Rectangle to encapsulate the properties and behaviour related to a rectangle. Include two integer variables length and breadth to represent the dimensions of the rectangle. Calculate and print the area and perimeter of the rectangle. Help Arun to design the program b.Developing an ArrayConcatenator Class for Merging Arrays.Help Roshni to complete the program. Input Format The first line of input consists of an integer N, representing the number of elements of the first Roshni is tasked with developing a program for concatenating two arrays provided by the user. To accomplish this, she wants to create a class named ArrayConcatenator. The class includes a constructor to concatenate the elements of the input arrays. She wants to print the elements of the resulting array. The second line consists of N space-separated integers representing the first array elements. The third line consists of an integer M, representing the number of elements of the second array. The fourth line consists of M space-separated integers, representing the second array elements. Output Format: 2 hours

Implement a consume() method to print "Washing machine is consuming electricity." Implement the consume(double capacity) method to calculate the electricity consumption (in kWh) of the washing machine based on its capacity. The formula for electricity consumption is (capacity * 0.05). b. Unique Character Extraction.Ashok needs to implement a program using the java.lang package to process a given string. The goal is to create a program that extracts and displays a new string containing only the unique characters from the provided input string. Ashok should efficiently use the java.lang.StringBuilder class and display the output. Help him to complete the program.

a. Validating Student Grade Input with Multi-Catch Exception Handling. Sampad wants to implement a program that takes input for a student's name and grade, validates the input, and then displays the grade for the given student. The grade should be an integer value. The program should validate the grade using the validateGrade() method. The method should throw an IllegalArgumentException if the grade is less than 0 or greater than 100. If the input is invalid due to a non-integer grade, catch the NumberFormatException and print the built-in exception message. If the input is invalid due to an out-of-range grade, catch the IllegalArgumentException and print the built-in exception message. Catch the exceptions using the multi-catch block. Assist Sampad to implement this program. b. Implementing Custom Exceptions for Time Input Validation.Alice is tasked with creating a program that validates user input for time values (hours, minutes, and seconds). The program should check whether the input values are within the valid range. If any value falls outside the valid range, a custom exception, InvalidHourException, InvalidMinuteException, or InvalidSecondException, should be thrown, indicating which part of the time (hours, minutes, or seconds) is invalid. If no exceptions occur, print "Correct Time - " followed by the time in the format "hours:minutes:seconds." 2 hours

Synchronizing Producer and Consumer Threads with a Shared Message Buffer.A shared resource, a message buffer, needs to be managed by two threads: a Producer and a Consumer. The Producer thread will generate messages and place them into the buffer. The Consumer thread will retrieve and process messages from the buffer. To ensure proper synchronization and avoid issues like the Consumer trying to read from 2 hours

an empty buffer or the Producer overwriting a message before it's consumed, you need to implement inter-thread communication using wait(), notify(), and synchronized blocks. Create a MessageBuffer class that holds a single message. The Producer thread will put a message into this buffer, and the Consumer thread will take a message from it. Implement the necessary synchronization mechanisms so that: The Consumer waits if the buffer is empty.The Producer waits if the buffer is full (i.e., already contains a message that hasn't been consumed).The Producer notifies the Consumer when a new message is available.The Consumer notifies the Producer after consuming a message, indicating the buffer is now empty.Write a Producer class that generates a sequence of messages (e.g., "Message 1", "Message 2", etc.) and puts them into the MessageBuffer.Write a Consumer class that retrieves and prints the messages from the MessageBuffer.Create a Main class to instantiate the MessageBuffer, a Producer thread, and a Consumer thread, and then start both threads.

Calculating Final Prices with Tax: File Input and Output.Ella is managing her expenses and wants to calculate the final prices after applying a 10% tax to her purchases. She has a list of item prices that she wants to process. Create a file named prices.txt and write the entered item prices to this file. Then, the program should read from prices.txt, apply a 10% tax to each item, write the taxed amounts to a file named tax.txt, and display the taxed amounts. Input Format: The first line of input consists of an integer N, representing the number of items Ella wants to process.The second line consists of N space-separated double values, representing the price of an item.Output Format:The output displays a double value, representing the taxed amounts, each with two decimal places, separated by a space.Refer to the sample output for formatting specifications.Constraints: this scenario, the test cases fall under the following constraints:1 ≤ N ≤ 10. 2 hours

Basic Sentiment Analysis: Classifying Sentences from File Input. Mr. Styles is working on a sentiment analysis program to understand the sentiments conveyed in various sentences. he needs your assistance in developing a program that analyzes the sentiment of a given sentence and classifies it as positive, negative, or neutral. positive keywords = happy, good, excellent, positive. negative keywords = sad, bad, terrible, negative. Anything else is Neutral. Create a file named input.txt, the input is written into the file input.txt. The program then reads the sentence from input.txt and sentiment analysis is performed based on predefined positive and negative keywords. The classified sentiment (positive, negative, or neutral) is written to a new file named output.txt and displayed. 2 hours

Implementing a Generic Record Holder for Academic Data. A university needs a system to manage different types of academic records, such as student grades and course enrollments. To create a flexible and type-safe system, they want to use generic classes.Design a generic class named RecordHolder that can hold any type of academic record. This class should have the following functionalities: A private instance variable to store the record. A constructor that takes an object of the specific record type and initializes the instance variable. A method named getRecord() that returns the stored record. A method named displayRecordInfo() that prints some relevant information about the record. The implementation of this method will depend on the specific type of record being held. Create two concrete classes to represent different types of academic records: GradeRecord: This class should have private instance variables for studentName (String) and grade (Double). It should have a constructor to initialize these variables and a displayRecordInfo() method that prints: "Grade for [studentName]: [grade]". EnrollmentRecord: This class should have private instance variables for courseName (String) and studentId (Integer). It should have a constructor to initialize these variables and a displayRecordInfo() method that prints: "Student [studentId] is enrolled in [courseName]". In your Main class, demonstrate the use of the RecordHolder generic class with both GradeRecord and EnrollmentRecord objects. Create instances of RecordHolder to hold a GradeRecord and an EnrollmentRecord, and then call the getRecord() and displayRecordInfo() methods on these RecordHolder instances.

Student Registration System using ArrayList in Java. Raman is a computer science teacher who is responsible for registering students for his programming class. He wants to streamline the registration process using a simple program. The program should allow him to input the names of students and later retrieve a student's name based on the index entered. Raman has decided to use an ArrayList to store the names. 2 hours

Calculating Median Temperature from City Data using HashMap. As a data analyst for a weather forecasting agency, you have a HashMap storing temperature data for various cities. Each city's entry consists of temperature readings. Your task is to find and report the median temperature, providing a more representative measure of the overall temperature patterns over a specific period. Note: To calculate the median, sort the numbers in ascending order. If the count is odd, the median is the middle number. If the count is even, the median is the average of the two middle numbers. 2 hours

You are tasked with developing a simple Employee Management System using Java and JDBC. The system should allow users to perform the following operations on employee records stored in a MySQL database Develop a menu-driven program (EmployeeApp.java) that allows users to:

  1. Add Employee
  2. View Employees
  3. Update Employee Salary
  4. Delete Employee
  5. Exit 2 hours Total Laboratory Hours: 60 hours Text Book(s) Marc Loy, Patrick Niemeyer and Daniel Leuck, , "Learning Java, ", O Reilly Media, 5th Edition, 2020 Herbert Schildt and Dr. Danny Coward, " Java: The Complete Reference", McGraw Hill, 13th^ Edition, 2024 Reference Books Kathy Sierra, Bert Bates and Trisha Gee,, " Head First Java", O Reilly Media, 3rd Edition, 2022 Dhruti Shah, "100+ Solutions in Java: A Hands-On Introduction to Programming in Java, ", BPB Publications, 1st^ Edition, 2020