Java and Python Programming Skills Report
Java and Python Programming Skills Report
2024-2025
Submitted to : Submitted by :
Dr. Suman Sharma SAURABH MISHRA
Asscociate Professor 21ESKEC059
Department of ECE ECE
SKIT M & G, Jaipur Batch – AG3
1
ACKNOWLEGEMENT
There are always some key personalities whose roles are vital for the successful completion
of any work. However, it would not have been possible to complete this work without the
kind support and help of many individuals and organization. I would like to extend sincere
thanks to all of them.
I am highly indebted to my mentors Dr. Suman Sharma , Associate Professor for their
guidance and constant supervision as well as for providing necessary information regarding
the Skill Development & also for their support in completing the Skill Development Lab. I
would like to thank Dr. Suman Sharma , Associate Professor, Department of Electronics and
Communication, SKIT M & G, Jaipur for their kind support and guidance to complete my
Skill Development Successfully. They helped us throughout the Lab . Their excellent
guidance has been instrumental in making this training a success.
I would like to thank Prof. (Dr.) Mukesh Arora, Professor & Head, Department of Electronics
and communication, SKIT M & G, Jaipur for providing me the opportunity to enhance my
skills in various domain in consistent direction and the adequate means and support
to pursue this Lab .
Finally earnest and sincere thanks to all the Faculty members of Electronics Communication
Department, SKIT M & G, Jaipur for their direct and indirect support in the completion of
this Lab .
Last but not least, we sincerely express our deepest gratitude to our families wholehearted
support and encouragement to us to take up this course. In addition, a very special thanks to
our colleagues and friends for their support.
SAURABH MISHRA
2
Acknowledgement 2
Table of Content 3
Introduction (Java Programming) 4
Theory ……
Project 14
References 18
Theory ……
Project 27
28
References
3
INTRODUCTION TO JAVA
Java is a popular and versatile high-level programming language that was first introduced by James
Gosling at Sun Microsystems in 1995 and later enhanced by Oracle Corporation. Java was primarily
created to enable platform independence and improve code maintainability. With a syntax inspired by
C and C++, Java allows developers to write structured and portable code, making it suitable for a
wide range of applications. It is a compiled and interpreted language, where source code is first
compiled into bytecode and then executed by the Java Virtual Machine (JVM). This enables Java
programs to run on any system that has a compatible JVM, giving rise to its well-known philosophy
of "Write Once, Run Anywhere."
FIGURE 1
Java is a high-level, object-oriented, and general-purpose language designed for ease of use and
understanding. It favors English-based keywords over complex symbols and follows strict
syntax rules that promote clean and reliable code. Although Java is not traditionally considered
a scripting language, it includes tools like JShell for interactive execution, introduced in Java 9.
Java’s object-oriented nature encourages developers to group data and behaviors into reusable
components called objects, supporting core principles such as encapsulation, inheritance,
polymorphism, and abstraction. Due to its readable syntax, robust standard library, and
widespread use in enterprise, mobile, and web development, Java is considered an excellent
language for beginners and professionals alike. From Android apps to enterprise-level backends,
Java continues to be a cornerstone in the world of software development.
4
JAVA FEATURES
Java is simple to learn, especially for those familiar with programming concepts, as it has a clean and
organized structure with a syntax similar to C and C++. This makes it easier for beginners to
understand and use the language effectively. Java code is also simple to read, thanks to its clear
object-oriented design and consistent conventions, which enhance code clarity and maintainability.
Maintaining Java programs is straightforward because of its structured approach, built-in memory
management, and exception handling features. Java provides a rich and comprehensive standard
library that supports everything from data structures and file handling to networking and graphical
user interfaces. This vast library is highly portable and works across different platforms.
Java supports a portable environment, meaning code written on one system can run on any other
system with a Java Virtual Machine (JVM). This cross-platform capability is a major strength of Java.
Additionally, tools like JShell (introduced in Java 9) allow developers to interactively test and debug
small pieces of code in real time, adding an interactive feature to Java’s development process.
FIGURE 2
5
WHAT EXACTLY JAVA IS?
Unlike dynamically typed languages, Java is statically typed, which means variables must be
explicitly declared before use. Java source code is compiled into bytecode using the Java compiler
and then executed by the JVM, which enables cross-platform compatibility similar to languages like
C# and Kotlin. Java includes essential programming constructs for executing sequential, conditional,
and loop-based instructions, making it suitable for writing everything from simple scripts to complex
algorithms.
Java supports multiple programming paradigms, including structured, object-oriented, and concurrent
programming. It is highly versatile—commonly used for building desktop applications, web servers,
enterprise software, Android apps, and more. Java provides a powerful standard library that includes
robust support for networking, file I/O, data structures, multithreading, and graphical user interfaces.
It also features strong memory management with built-in garbage collection that helps developers
avoid memory leaks.
Furthermore, Java integrates well with other technologies and languages through APIs and
frameworks, and can work with C/C++ using the Java Native Interface (JNI). With its strong typing,
automatic memory management, platform independence, and a rich ecosystem, Java continues to be a
top choice for developers across various domains, from enterprise systems to mobile applications.
6
JAVA INTERFACES
IntelliJ IDEA – A powerful and feature-rich IDE for Java development, available in both free
(Community) and paid (Ultimate) editions. It offers advanced code completion, refactoring tools, and
deep integration with build systems like Maven and Gradle.
Eclipse – A popular open-source IDE widely used in Java development. It supports a wide range of
plugins, making it suitable for developing Java-based web, desktop, and enterprise applications.
NetBeans – Another open-source IDE officially supported by Oracle. NetBeans provides robust tools
for Java SE, Java EE, and JavaFX development, along with drag-and-drop GUI design capabilities.
FIGURE 3
VS Code – A lightweight and highly extensible code editor with strong Java support through
extensions.
7
JAVA SYNTAX AND STRUCTURE
The basic structure of a Java program follows a specific and consistent format. Every Java program
begins with a class declaration, which acts as a container for the code. A class is declared using the
class keyword followed by the class name, and the body of the class is enclosed within curly braces
{}. The main method serves as the entry point of any standalone Java application and is written as
public static void main(String[] args). This method is where the program starts executing.
Java has several strict syntax rules that must be followed. It is case-sensitive, meaning Variable,
variable, and VARIABLE would be treated as different identifiers. Every statement in Java ends with
a semicolon (;), and braces {} are used to define blocks of code, such as in loops, methods, and class
definitions. Proper nesting and indentation help in readability but are not enforced by the compiler.
FIGURE 4
Java also supports comments to improve code readability. Single-line comments start with //,
while multi-line comments are written between /* and */. These comments are ignored by the
compiler and are used by developers to describe the logic or temporarily disable code.
Understanding and following these syntax rules and structures is essential for writing clean
and error-free Java programs.
8
VARIABLES, DATA TYPES AND OPERATORS
In Java, variables are used to store data that can be manipulated during program execution. Every
variable in Java must be declared with a specific data type. Java supports two main categories of data
types: primitive and non-primitive. Primitive data types include int for integers, float and double for
decimal numbers, char for single characters, and boolean for true/false values. These are the most
basic types and are not derived from any other object.
Non-primitive data types refer to more complex structures like String, Array, and user-defined
objects. These types are created using classes and can store multiple values or perform more
advanced operations. For example, String is used to handle sequences of characters, while Arrays can
store multiple values of the same type.
FIGURE 5
Variables must be declared and initialized before they are used. A typical declaration looks like int
age = 25; or String name = "John";. Java also supports a variety of operators for performing actions
on variables and values. These include arithmetic operators (+, -, *, /, %), relational operators
(==, !=, >, <, >=, <=), and logical operators (&&, ||, !). These operators are essential for performing
calculations, making decisions, and controlling the flow of the program. Understanding how
variables, data types, and operators work together is crucial for writing effective Java code.
9
CONTROL STATEMENTS
Control statements in Java are used to manage the flow of execution within a program, allowing
decisions and repetition based on conditions. Conditional statements help in executing specific
blocks of code depending on certain conditions. The if statement checks whether a condition is true
and executes a block of code if it is. The if-else statement provides an alternative block to run when
the condition is false. For handling multiple conditions, the switch statement is useful, especially
when evaluating a single variable against multiple constant values.
Loops are used to repeat a set of statements until a particular condition is met. The for loop is ideal
when the number of iterations is known, whereas the while loop checks the condition before each
iteration and is used when the number of iterations is uncertain. The do-while loop is similar to while,
but it guarantees that the loop body will execute at least once because the condition is evaluated after
the execution. Java also provides break and continue statements for loop control.
FIGURE 6
10
LOOPING
In Java, for loops allow you to execute a block of code a specific number of times,
making them ideal for iterating over arrays, collections, or performing repetitive tasks.
For example, a for loop can be used to iterate through an array of values, process each
element, and perform calculations or checks based on the data. Java also supports the
enhanced for loop (also known as the for-each loop), which is particularly useful for
iterating through elements in arrays and collections without using an index.
FIGURE 7
11
The Program Development Process (Control Flow)
SYNTAX ERRORS
INPUT OUTPUT
FIGURE 8
12
INTEGER OPERATORS
FIGURE 9
13
PROJECT MODULE
14
AIM : To make a program on java for Inventory Management System
/*
* Inventory Management System
* Description: Tracks product inventory with CRUD operations
* Author: [Your Name]
* Date: [Today's Date]
*/
import [Link];
import [Link];
import [Link];
15
boolean running = true;
while (running) {
[Link]("\nMenu:");
[Link]("1. Add Product");
[Link]("2. View Product");
[Link]("3. Update Product");
[Link]("4. Delete Product");
[Link]("5. List All Products");
[Link]("6. Generate Inventory Report");
[Link]("7. Exit");
[Link]("Enter your choice (1-7): ");
switch (choice) {
case 1:
addProduct();
break;
case 2:
viewProduct();
break;
case 3:
updateProduct();
break;
case 4:
deleteProduct();
break;
case 5:
listProducts();
break;
case 6:
generateReport();
break;
case 7:
running = false;
16
[Link]("Exiting Inventory System.
Goodbye!");
break;
default:
[Link]("Invalid choice. Please try again.");
}
}
[Link]();
}
if ([Link](id)) {
[Link]("Product ID already exists!");
return;
}
[Link]("\nProduct Details:");
[Link]("ID: " + id);
[Link]("Name: " + [Link]);
[Link]("Quantity: " + [Link]);
[Link]("Price: $%.2f\n", [Link]);
[Link]("Total Value: $%.2f\n", ([Link] *
[Link]));
}
if () {
[Link]("Product not found!");
return;
}
[Link]("Current Details:");
[Link]("1. Name: " + [Link]);
[Link]("2. Quantity: " + [Link]);
[Link]("3. Price: $%.2f\n", [Link]);
[Link]("What to update? (1-3, 0 to cancel): ");
switch (field) {
case 0:
return;
case 1:
18
[Link]("Enter new name: ");
[Link] = [Link]();
break;
case 2:
[Link]("Enter new quantity: ");
[Link] = [Link]();
break;
case 3:
[Link]("Enter new price: ");
[Link] = [Link]();
break;
default:
[Link]("Invalid choice.");
return;
}
if ([Link](id) != null) {
[Link]("Product deleted successfully!");
} else {
[Link]("Product not found!");
}
}
[Link]("\nCurrent Inventory:");
19
[Link]("ID\tName\t\tQty\tPrice\tTotal Value");
[Link](" ");
int totalItems = 0;
double totalValue = 0;
double highestValue = 0;
String highestValueProduct = "";
[Link]("\nINVENTORY REPORT");
[Link](" --------------- ");
[Link]("Total Products: " + [Link]());
[Link]("Total Items: " + totalItems);
20
[Link]("Total Inventory Value: $%.2f\n", totalValue);
[Link]("Average Product Value: $%.2f\n",
(totalValue / [Link]()));
[Link]("Highest Value Product: " +
highestValueProduct +
" ($" + [Link]("%.2f", highestValue) + ")");
}
}
21
REFERENCE LINKS
1) [Link]/java
2) [Link]/openjdk
3) [Link]/java
4) [Link]/java
22
INTRODUCTION TO PYTHON
Python is a widely used general-purpose, high level programming language. It was initially
designed by Guido van Rossum in 1991 and developed by Python Software Foundation . It was
mainly developed for emphasis on code readability, and its syntax allows programmer
to express concepts in fewer lines of code.
Python is a programming language that lets you work quickly and integrate systems more
efficiently.
Python is a high-level, interpreted, interactive and object - oriented scripting language.
Python designed to be highly readable. It uses English keywords frequently where as other
languages use punctuation, and it has fewer syntactical constructions than other languages.
FIGURE 1
5
PYTHON FEATURES
Easy-to-learn − Python has few keywords, simple structure, and a clearly defined syntax. This
allows the student to pick up the language quickly.
Easy-to-read − Python code is more clearly defined and visible to the eyes.
Easy-to-maintain − Python's source code is fairly easy-to-maintain.
A broad standard library − Python's bulk of the library is very portable andcross-platform
compatible on UNIX, Windows, and Macintosh.
Interactive Mode − Python has support for an interactive mode which allows interactive
testing and debugging of snippets of code.
Portable − Python can run on a wide variety of hardware platforms and has the same
interface on all platforms.
FIGURE 2
Extendable − You can add low-level modules to the Python interpreter. These modules
enable programmers to add to or customize their tools to be more efficient.
Databases − Python provides interfaces to all major commercial databases.
6
WHAT PYTHON ACTUALLY IS ?
Examples: FORTRAN, COBOL, Lisp, Basic, Pascal, C, C++, Java, C#, Python, …
Usually, one or more algorithms written in a programming language that can be translated run
on a real machine
We sometimes call programs software.
It provides very high- level dynamic data types and supports dynamic type checking.
It supports automatic garbage collection
7
PYTHON INTERFACES
FIGURE 3
8
LISTS
Think of a list as a stack of cards, on which your information is written. The information stays
in the order you place it in until you modify that order. Methods return a string or subset of
the list or modify the list to add or remove components. Written as var[index], index refers
to order within set (think card number, starting at 0) . You can step through lists as part of a
loop.
FIGURE 4
Lists are one of 4 built-in data types in Python used to store collections of
data, the other 3 are Tuple, Set, and Dictionary, all with different qualities
and usage.
9
TUPLES
Like a list, tuples are iterable arrays of objects. Tuples are immutable – once unchangeable
To add or remove items, you must redeclare . Example uses of tuples County Names Land
FIGURE 5
Tuple is one of 4 built-in data types in Python used to store collections of data, the other 3 are
List, Set, and Dictionary, all with different qualities and usage.A tuple is a collection which is
ordered and unchangeable.
10
Indentation and Blocks
If Python uses whitespace and indents to denote blocks of code we can use it.
Lines of code that begin a block end in a colon: .Lines within the code block
are indented at the same level.
To end a code block, remove the indentation .You'll want blocks of code that
run only when certain conditions are met.
FIGURE 6
11
LOOPING WITH FOR
For allows you to loop over a block of code a set number For is great for .
manipulating lists:
a = ['cat', 'window', 'defenestrate']
for x in a:
print x, len(x)
Results:
FIGURE 7
We could use a for loop to perform geoprocessing tasks on each layer in a list
We could get a list of features in a feature class and loop over each, checking
attributes . Anything in a sequence list can be used in a For [Link] be sure
to modify the list while looping.
12
The Program Development Process (Control Flow)
Python is also a piece of software called an interpreter. The interpreter is the program you’ll
need to run Python code and scripts. Technically, the interpreter is a layer of software that
works between your program and your computer hardware to get your code running
SYNTAX ERRORS
INPUT OUTPUT
FIGURE 8
13
INTEGER OPERATORS
FIGURE 9
14
PROJECT MODULE
JARVIS 1.0
15
AIM : To make a program on python for running a personal assistant .
engine = [Link]('sapi5')
voices = [Link]('voices')
# print(voices[1].id)
[Link]('voice', voices[1])
def speak(audio):
[Link](audio)
[Link]()
def wishMe():
hour = int([Link]().hour)
if hour>=0 and hour<12:
speak("Good Morning Saurabh !")
16
else:
speak("Good Evening Saurabh !")
def takeCommand():
#It takes microphone input from the user and returns string output
r = [Link]()
with [Link]() as source:
print("Listening...")
r.pause_threshold = 1
audio = [Link](source)
try:
print("Recognizing...")
query = r.recognize_google(audio, language='en-in')
print(f"User said: {query}\n")
except Exception as e:
# print(e)
speak("Say that again please...")
return "None"
return query
17
def sendEmail(to, content):
server = [Link]('[Link]', 587)
[Link]()
[Link]()
[Link]('youremail@[Link]', 'your-password')
[Link]('youremail@[Link]', to, content)
[Link]()
18
elif 'open stackoverflow' in query:
[Link]("[Link]")
19
elif 'the time' in query:
strTime = [Link]().strftime("%H:%M:%S")
speak(f"Sir, the time is {strTime}")
except Exception as e:
print(e)
speak("Sorry sir. I am not able to send this email")
20
REFERENCE LINKS
1) [Link]
2) [Link]
3) [Link]
4) [Link]
5) [Link]
21