Difference between revisions of "Summer 2021: Programming in Java Lab"

From MKWiki
Jump to navigation Jump to search
Line 3: Line 3:
 
* Basic Programs [[Java Programs Bank| List ]]
 
* Basic Programs [[Java Programs Bank| List ]]
  
== '''Lab 1: Getting Started''' ( week of 04<sup>th</sup> January 2021 ) ==
+
== '''Lab 1: Getting Started''' ( week of 05<sup>th</sup> April 2021 ) ==
 
{| class="wikitable" style="text-align: left; width: 100%";  
 
{| class="wikitable" style="text-align: left; width: 100%";  
 
|-
 
|-
Line 27: Line 27:
 
     *  *  *  *  
 
     *  *  *  *  
 
|| Practice Set No. 5 ||
 
|| Practice Set No. 5 ||
|}
 
 
== '''Lab 2: ''' ( week of 11<sup>th</sup> January 2021 ) ==
 
{| class="wikitable" style="text-align: left; width: 100%";
 
|-
 
! Q. NO. 
 
! Program 
 
! Lab Exercise No. 
 
! Remarks
 
|-
 
| style="width: 8%"  | 1
 
| style="width: 60%" | WAP to find the sum of digits of a given number. [ Sample input: 12345, output:15 ]
 
| style="width: 15%" | Practice Set  No. 1 ||
 
|-
 
| 2 || WAP to reverse the digits of a given number. [ Sample input: 12345, output:54321 ] || Practice Set No. 2||
 
|-
 
| 3 || Write program to print the k<sup>th</sup> digit from last. [ Sample input 23617 and k=4 output 3 ] || Practice Set No. 3||
 
|}
 
 
== '''Lab 3: ''' ( week of 18<sup>th</sup> January 2021 ) ==
 
{| class="wikitable" style="text-align: left; width: 100%";
 
|-
 
! Q. NO. 
 
! Program 
 
! Lab Exercise No. 
 
! Remarks
 
|-
 
| style="width: 8%"  | 1
 
| style="width: 60%" | WAP to find the largest of n natural numbers.
 
| style="width: 15%" | Practice Set No. 1 ||
 
|-
 
| 2 || WAP to print the sum and product of digits of an Integer and reverse the Integer. || Practice Set No. 2 ||
 
|-
 
| 3 || Write a menu driven program for following: <br>
 
(a) Display a Fibonacci series <br>
 
(b) ComputeFactorial of a number <br>
 
(c) WAP to check whether a given number is odd or even. <br>
 
(d) WAP to check whether a given string is palindrome or not. 
 
|| Practice Set No. 3 ||
 
|}
 
 
== '''Lab 4: ''' ( week of 25<sup>th</sup> January 2021 ) ==
 
{| class="wikitable" style="text-align: left; width: 100%";
 
|-
 
! Q. NO. 
 
! Program 
 
! Lab Exercise No. 
 
! Remarks
 
|-
 
| style="width: 8%"  | 1
 
| style="width: 60%" | Write a program to create an array of 10 integers. Accept values from the user in that array. Input another number from the user and find out how many numbers are equal to the number passed, how many are greater and how many are less than the number passed.
 
| style="width: 15%" | Practice Set  No. 1 ||
 
|-
 
| 2 || Write a program that will prompt the user for a list of 5 prices. Compute the average of the prices and find out all the prices that are higher than the calculated average. || Practice Set  No. 2 ||
 
|-
 
| 3 || Write a program to input N numbers in an array and print out the Armstrong numbers from the set. || Practice Set  No. 3 ||
 
 
|-
 
| 4 || Write a program for following matrix operations: <br>
 
(a) Input the elements of Matrices from user <br>
 
(b) Addition of two matrices <br>
 
(c) Multiplication of two matrices <br>
 
(d) Transpose of a Matrix.
 
|| Practice Set No. 4 ||
 
|}
 
 
== '''Lab 5: ''' ( week of 01<sup>st</sup> February 2021 ) ==
 
{| class="wikitable" style="text-align: left; width: 100%";
 
|-
 
! Q. NO. 
 
! Program 
 
! Lab Exercise No. 
 
! Remarks
 
|-
 
| style="width: 8%"  | 1
 
| style="width: 60%" | 5-6 Programs based on Lecture 3.
 
| style="width: 15%" | Practice Set Lect(3)||
 
|}
 
 
== '''Lab 6: ''' ( week of 08<sup>th</sup> February 2021 ) ==
 
{| class="wikitable" style="text-align: left; width: 100%";
 
|-
 
! Q. NO. 
 
! Program 
 
! Lab Exercise No. 
 
! Remarks
 
|-
 
| style="width: 8%"  | 1
 
| style="width: 60%" | 4-5 Programs based on Lecture 4.
 
| style="width: 15%" | Practice Set Lect(4)||
 
|}
 
 
== '''Lab 7,8,9: ''' ( week of 15<sup>th</sup>,22<sup>nd</sup> February & 1<sup>st</sup> March ) ==
 
{| class="wikitable" style="text-align: left; width: 100%";
 
|-
 
! Q. NO. 
 
! Program 
 
! Lab Exercise No. 
 
! Remarks
 
|-
 
| style="width: 8%"  | 1
 
| style="width: 60%" | Complete all the previous exercises.
 
| style="width: 15%" | ( Lab01-Lab06 )||
 
 
|}
 
|}

Revision as of 10:35, 8 April 2021

Resources

  • Basic building block(syntax) tutorial from cs.princeton.edu
  • Basic Programs List

Lab 1: Getting Started ( week of 05th April 2021 )

Q. NO. Program Lab Exercise No. Remarks
1 WAP to find the sum of any number of integers entered as command line arguments. Practice Set No. 1
2 WAP to find whether the given number is even or odd. Practice Set No. 2
3 WAP to find the factorial of a given number. Practice Set No. 3
4 WAP to check whether the given number is prime or not. Practice Set No. 4
5 WAP to print the following pattern using nested for loop:
    *
    *  *
    *  *  *
    *  *  *  * 
Practice Set No. 5