0% found this document useful (0 votes)
62 views

Logbook Programming'

This document is a student logbook containing details of their practical work completed over 9 weeks for their Principles of Programming II Java course. It includes summaries of 15 programs completed each week that demonstrate various Java programming concepts like using print statements, formatting output, user input, number formatting, GUI interfaces, string methods, loops, and more. The logbook documents the student's name, ID, and details of the practical work and programs completed each date.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

Logbook Programming'

This document is a student logbook containing details of their practical work completed over 9 weeks for their Principles of Programming II Java course. It includes summaries of 15 programs completed each week that demonstrate various Java programming concepts like using print statements, formatting output, user input, number formatting, GUI interfaces, string methods, loops, and more. The logbook documents the student's name, ID, and details of the practical work and programs completed each date.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Student Logbook

For

Principle of Programming II

JAVA
PROGRAMMING
LAB PRACTICALS

Second Year Students

Dept: Software Engineering & IT

2022

Student Details

Name: ALHASSAN ABUBAKAR SADIQ


Student ID No.: 201203075

Week One
Day: FRIDAY Date:

Practical Work Done Remark


Installation of Installation of Java Development Kits(JDK) and then
Java Installation of Different Integrated Development
Development Environment(IDE) like: Apache NetBeans, Eclipse, Visual
Kit(JDK) and Studio Code, Sublime Text etc.
Integrated
Development
Environment
(IDE)
Creation of Creation of a test project was done to get acquainted with
Test Project • Auto suggestions and auto fill,
• Creation of class, variables and methods and,
• Debugging
• Compilation
Programs A program was written to show the use of the print() and
using print println() statement and the use of data types like int and the
statements use of post-incrementation.
Program to Program was written to produce tabulated output using
create escape sequences.
tabulated
output
Program to The program demonstrates the use of the Scanner class which
demonstrate is used to get user input.
the use of
Scanner
Class
Week Two
Day: FRIDAY Date:_______________________________

Practical Work Done Remark


Program to This program demonstrates number formatting using the
demonstrate NumberFormat.getCurrencyInstance() keyword to add
number currency signs to numbers
formatting
Program to This program demonstrates the decimal value formatting
demonstrate using DecimalFormat keyword to change the number of
Decimal values before a decimal point and after and the pattern of the
value decimal values.
formatting
Program to This program demonstrates delimitation between words using
Demonstrate the keyboard.useDelimiter keyword and keyboard.nextLine()
Delimiter keyword to get rid of rest of line.
between
words
Program to This program demonstrates the self-service system using the
Demonstrate Scanner class, nextInt() and nextDouble() keywords and
Self-Service demonstration of data type conversion and number
System formatting.

Week Three
Day: FRIDAY Date:
Practical Work Done Remark
Program to This program demonstrates the Grocery point of sale in order
demonstrate to output an invoice of items bought with tax rate of 6.25%.
Grocery The program uses the Scanner Class, nextLine(),nextInt() and
Point of Sale nextDouble() keywords, the use of escape sequences and
decimal number formatting

Week Four
Day: FRIDAY Date:

Practical Work Done Remark


Program to This program creates a Graphical User Interface(GUI) with a
demonstrate menu that allows the user to add colors to a window frame
Graphical using a grid layout. The program uses the ActionListener
user interface libraries.
(GUI)
Week Five
Day: FRIDAY Date:

Practical Work Done Remark


Midterm Examinations

Week Six
Day: FRIDAY Date:

Practical Work Done Remark


Program calculating This program finds the area of a circle using String
the area of a circle. Methods such as String.concat() Method to
concatenate two strings together or with an integer
data type.
Program to This program uses CharAt()Method to find the index
demonstrate the use of a character in the specified string. For Example,
of CharAt() and CharAt(1) finds the character at index one , and then
length() uses String.length to find the length of a string.
Program to This program uses String.IndexOf() Method to find
demonstrate the use the index of first occurrence of a character supplied
of IndexOf() and searches the string to find the index.
Program to This program displays the last index of a character’s
demonstrate the use last occurrence. It uses the lastIndexOf() Method.
lastIndexOf()
Demonstration of This Program tests if a String starts with a specified
the use of trim(), prefix using the startsWith() method , it then tests if a
startsWith(), and String ends with a specified suffix using the
endsWith( endsWith() method and then uses trim() method to test
for whitespaces at both ends of the String.
Program that uses This program uses the previously mentioned String
SubString() to find Methods to find the first and last occurrence of
positions of String characters of the declared string “s” using indexOf()
objects as well as and lastIndexOf() methods and then converts them to
convert them uppercase using the toUppercase() method.
toUppercase()

Week Seven
Day: FRIDAY Date:

Practical Work Done Remark


A program This program takes the first and last name of users as a
greeting the string data type using the BufferedReader class and displays
users by their it as “Hello+firstname+lastname”e.g “Hello Ahmed Musa”
names. using string concatenation. It uses “throws IOException” to
show that an input/output error can occur while running the
program.
Program The program uses the BufferedReader class to read the input
showing the from the keyboard then InputStreamReader class to convert
binary the input from the keyboard to the character stream,then the
representation readLine() method to read the input from the keyboard,then
of the input parseInt() method to convert the input from the keyboard to
number an integer, then theInteger.toBinaryString() method to
convert the integer to the binary representation.
System.out.println() method is used to print the output to the
screen
Program that The Program Creates a new BufferedReader object. Prompts
demonstrates the user for input. Reads the user's input. Prompts the user
selective for the starting position. Reads the user's input. Prompts the
substrings user for the length of the sub-string. Reads the user's input.
Uses the substring method to get the sub-string.
Prints the sub-string.
Closes the BufferedReader object.
Program that The Program Prompts the user for the magnitude of the
demonstrates Force(Newton) and angle(degrees),Calculates the
Vector components of the force vector F, Displays the components
decomposition. of the force vector F. all by using the Math method and it
also throws IOException

Week Eight
Day: FRIDAY Date:

Practical Work Done Remark


Program that This program throws IOException, it uses the if-construct to
sorts two test if any of the inputs are larger than the other and then
numbers prints the inputs from smallest to largest.
from smallest
to largest
Program that This program uses if - else to select which functions to be
uses an if- operated. It also uses the logical AND operator to test two
else construct conditions which should return true for both conditions.
to choose
which
functions to
be calculated
Program that This program compares primitive data types using ternary
demonstrates operators “?” and “:”. For equal and not equal respectively.
the use of ==
to compare
values of
primitive data
types
Program that This program also uses ternary operators to compare floating
demonstrates point values using the Math method.
floating-point
value
comparison
Program that This program test for comparison between two strings and
demonstrates outputs 0 if they are equal. It uses the comapareTo() method.
compareTo()
method in
action
Program that The program uses the switch construct to convert numbers
demonstrates from base to base i.e., base 2,8,10,and 16 which uses
Number base different cases to test each selected condition.
converter-
based switch
construct

Week Nine
Day: FRIDAY Date:

Practical Work Done Remark


Demonstration This program uses while loop to test a condition as along as
of while loop the given condition is true and ends when q is inputted.
A program that The program uses the while loop to find the average of
demonstrates numbers while using different String Methods like
averaging of CharAt().and also the logical AND operator
number using
while loop
A guessing This program uses the math method to randomize numbers
game program for the user to guess and while loop to continue the
using while guessing loop as long as the input is incorrect
loop
Demonstration The program uses for loop to find the average of numbers.
of for loop
A program that It factorizes inputted numbers using the for and while loop
finds prime
factors of an
input integer
using for loop
A program that The Program finds the order of recurrence using for loop
calculating
term values in
a first-order
recurrence
relation using
for loop
A program that The program uses nested for loops to test the number of
demonstrates possible solutions to the given equation a2+b2+c2=200
finding all
possible
solutions to
a2+b2+c2=200
using nested
for loop

Week Ten
Day: FRIDAY Date:

Practical Work Done Remark


Program to The code is written to calculate the angle between two
find angles vectors. It implements the Java Math Methods by using
between two trigonometric values like: cos, sin and tan. It uses user
vectors defined methods
Program that The code uses arrays to counts the frequency of a character in
demonstrates a string and outputs it using String Methods such as,
the use of an CharAt() and length().
array to
improved
digit
frequency
counting
Program that The program demonstrates how arrays are passed on from
demonstrates different methods to the main method. It shows what goes in
how arrays and out of the method.
are passed to
a method
Program that The program uses the Math. Random() method to generate
demonstrates random numbers and inputs them in an array.
how a
method
returned
value as
array.
Program that The program finds the minimum and maximum values in an
demonstrates array and outputs them .It uses the Arrays.toString() method.
methods that
find
minimum
and
maximum of
array
elements
Program that The program searches an array for a value and return the
sequentially index where it is found at as an output. It uses the
searches an Arrays.toString() method.
array
Program that The program sorts elements in array either in increasing or
uses selection decreasing order and outputs the sorted array. It uses the
sort on array Arrays.toString() method.
elements

Week Eleven
Day: FRIDAY Date:

Practical Work Done Remark


Program that The program uses accessor retrieves input from the
demonstrates MyPoint class and mutator methods uses input gotten from
use of various the accessor methods using the “this” keyword. It finds the
methods of the distance from one point to another.
MyPoint class.
Program that The program inserts and removes elements at specified
uses static indexes in the array.
keyword for
static methods
inside a utility
class.
Program that The program uses mutator methods to create an instance of
demonstrates a class(Object).
creation of
instances of its
own class
Program testing The program uses accessor and mutator methods to find
a data type the complex form of numbers by:
presenting • Subtraction, addition and division
complex • Finds the conjugate and magnitude
numbers
Program that The program illustrates inheritance and polymorphism
demonstrates using superclasses and subclasses. It retrieves methods
inheritance and from superclasses and passes them to the subclasses and
polymorphism uses them in the main method to find the type of book
concept using a inputted as a string whether it is rare, used or regular and
book shop use gets the price. If the books are more than two books it
case calculates the prices of the books using a discounted price.

You might also like