Professional Documents
Culture Documents
Lab Report – 02
Course Code: CSC-384
Course Name: Programming In Java Lab
Submitted to:
Naeem Mia
Lecturer, Department of Computer Science and
Engineering.
Submitted by:
Name: Sabbir Hossain
ID: 22103119
Section: F
Semester: Spring -2024
Program: BCSE
Submission Date: 17-02-2024
Experiment :1
Objective: Finding the total amount after 6 months with interest without using
any loop.
Algorithm:
• Import the necessary Java utilities package.
• Define a class named LabTask1.
• Declare the main method within the LabTask1 class.
• Create a Scanner object named 'input' to read user input from the console.
• Display a prompt asking the user to enter their salary.
• Read and store the user's salary as a double variable named 'salary'.
• Define a constant variable 'interest' with the value 1 + 0.004875.
• Calculate the salary after the first month by multiplying the salary with the
'interest' and store it in 'salaryAfterFirstMonth'.
• Repeat steps 8 for the second, third, fourth, fifth, and sixth months, updating
the 'salary' variable each time.
• Calculate 'salaryAfterSecondMonth'
• Calculate 'salaryAfterThirdMonth'
• Calculate 'salaryAfterFourthMonth'
• Calculate 'salaryAfterFifthMonth'
• Calculate 'salaryAfterSixthMonth'
• Display the final calculated salary after the sixth month to the user.
Code:
package labtask;
import java.util.*;
public class LabTask1 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
}
}
Output:
Experiment :2
Code:
package LabTask;
public class LabTask4 {
public static void main(String[] args) {
int n =1;
int r=5;
for (int i = 1; i<=r ; i++)
{
}
System.out.println();
}
}
}
Output: