Sie sind auf Seite 1von 8

Name: Harwinder Singh Batth

Class: XII Science

Roll Number: 6

Subject: Computer Science

i
ii
Acknowledgement

I would like to express my special thanks of gratitude to my teacher as well as our principal who
gave me the golden opportunity to do this wonderful project on Computer Science, which also
helped me in doing a lot of Research and I came to know about so many new things I am really
thankful to them. Secondly I would also like to thank my parents and friends who helped me a
lot in finalizing this project within the limited time frame.

I would also like to offer special thanks to the site Stack Overflow from where I have derived
much of the codes for the programs so that I could complete this project work.

I would like to thank those who helped me in completing this project and without whom all of
this would not be possible.

iii
Introduction to Java

Java is a simple and yet powerful object oriented programming language and it is in many
respects similar to C++. Java originated at Sun Microsystems, Inc. in 1991. It was conceived by
James Gosling, Patrick Naughton, Chris Warth, Ed Frank, and Mike Sheridan at Sun
Microsystems, Inc.

It was developed to provide a platform-independent programming language. This site gives you
an Introduction to Java Programming accompanied with many java examples. Its a complete
course in java programming for beginners to advanced java.

Unlike many other programming languages including C and C++ when Java is compiled, it is not
compiled into platform specific machine, rather into platform independent byte code. This byte
code is distributed over the web and interpreted by virtual Machine (JVM) on whichever
platform it is being run. Java was designed with a concept of write once and run everywhere.
Java Virtual Machine plays the central role in this concept.

So Java byte codes can be thought of as the machine language of the JVM. A JVM can either
interpret the byte-code one instruction at a time or the byte-code can be compiled further for the
real microprocessor using what is called a just-in-time compiler. The JVM must be implemented
on a particular platform before compiled programs can run on that platform.

Object Oriented Programming is a method of implementation in which programs are organized


as cooperative collection of objects, each of which represents an instance of a class, and whose
classes are all members of a hierarchy of classes united via inheritance relationships.

iv
Index

Sl.no Subject Page Number

1. Pascals Triangle 1-5

2. Print Number in Words 6-10

3. AP Series 11-16

4. Calendar of any Month 17-23

5. Factorial (using Recursion) 24-28

6. Fibonacci Series (using Recursion) 29-33

7. GDC (using Recursion) 34-38

8. Spiral Matrix 39-45

9. Magic Square 46-52

10. Search in Array using Linear Search 53-58

11. Search in Array using Binary Search 59-64

12. Sort in Array using Selection Sort 65-70

13. Sort in Array using Bubble Sort 71-76

14. Convert Decimal Number to Binary 77-81

15. Display Date from Entered Day Number 82-87

16. Create Star Pattern Using String 88-93

17. Check if String is Palindrome 94-98

18. Display the Frequency of Each Character 99-104

19. Find a Word in Entered String 105-109

20. Decode the Entered String 110-116

v
21. Display the Entered String in Alphabetical Order 117-122

22. Count the Number of Vowels and Consonants 123-127

23. Count the Number of Words in a String 128-132

24. Replace all Vowels in a String with * 133-137

25. Generate Sum of Elements of a 5*5 Array 138-143

26. Sum of Each Column of Double Dimensional Array 144-149

27. Find Sum of Diagonals of a 4*4 Array 150-155

28. Calculate the Sales Commission 156-160

29. Convert a Number to Roman Numeral 161-165

30. Convert Celsius to Fahrenheit using Inheritance 166-170

vi
Conclusion

The Java collections framework is one of those areas of the Java language that is slightly
forbidding. As is often the case, it also contains some of the most powerful features of the Java
language! The ArrayList class is very powerful indeed because it reduces the amount of work
required of the programmer.

As you add data, objects of this class just expand automatically and in an efficient fashion. The
automatic expansion helps to avoid issues such as exceeding the boundary of an array. However,
it does introduce issues concerning efficiency because memory must be allocated behind the
scenes.

So, if you're adding many elements, you might notice a performance hit. The class also includes
methods that can be called to improve the efficiency of additions.

The Java collection framework is very powerful and includes numerous capabilities not
mentioned in this article, such as cloning, return values, removing elements, and more.

All of these features are well described in the JDK documentation, and you can refer to them as
you become more familiar with this rich set of classes.

vii
Bibliography

All information in the project is taken from the site Stack Overflow and Quora. The font used is
Alegreya, edited by Harwinder Singh Batth

viii

Das könnte Ihnen auch gefallen