Java Programming: Experiment 1 (codes)

click to download SE IT/ Sem 3/ Rev 2016/ Java Programming/ Experiment 1 (codes) (rar file)

i) Write a Java program to understand how to accept input using Scanner or BufferedReader and print output using System.out.println statement. (ScannerTest.java, BufferedReaderTest.java)
ii) Write a Java program to display the default value of all primitive data types
in Java. (DefValues.java)
iii) Write a Java program that prints all real solutions to the quadratic equation
ax2+bx+c = 0. Read in a, b, c and use the quadratic formula. If the discriminate b2-
4ac is negative, display a message stating that there are no real solutions. (QuadEq.java)
iv) Write a java program to test whether string is palindrome or not (Palindrome.java)
v) Write a java program to count number of alphabets, digits, special symbols,
blank spaces and words from the given sentence. (SentenceContent.java)
vi) Write a java program to count number of vowels and consonants from the given
strings. (VowelsConsonants.java)
vii) Write a Menu driven program in java to implement simple banking application. Application should read the customer name, account number, initial balance, rate of interest, contact number and address field etc. Application should have following
methods.
1. createAccount()
2. deposit()
3. withdraw()
4. computeInterest()
5. displayBalance() (Account.java)
viii) Write a menu driven Java program which will read a number and should implement the following methods
1. factorial()
2. reverse()
3. testArmstrong()
4. testPalindrome()
5. testPrime()
6. fibonacciSeries() (NumericOps.java)
ix) Write a Java program to demonstrate Method overloading. (MethodOverloading.java)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s