diff options
author | Sudipto Mallick <smlckz@termux-alpine> | 2024-01-27 11:33:43 +0000 |
---|---|---|
committer | Sudipto Mallick <smlckz@termux-alpine> | 2024-01-27 11:34:11 +0000 |
commit | cd6a9243c056710794549a1ab5d51fbdd082ce2e (patch) | |
tree | f3f4df42bcfa96b9d6ef48da2b33be148adfdd2b /java/output | |
parent | 1db2841d10c6920eba89f1e55eb3c90aa770ad07 (diff) | |
download | zadania-cd6a9243c056710794549a1ab5d51fbdd082ce2e.tar.gz |
Complete Java assignments #7-13
Diffstat (limited to 'java/output')
-rw-r--r-- | java/output/BankAccountExample.typ | 124 | ||||
-rw-r--r-- | java/output/ComplexCalculations.typ | 20 | ||||
-rw-r--r-- | java/output/FindNumberInArray.typ | 15 | ||||
-rw-r--r-- | java/output/ShapeAreaCalculations.typ | 40 | ||||
-rw-r--r-- | java/output/StudentsArray.typ | 55 |
5 files changed, 254 insertions, 0 deletions
diff --git a/java/output/BankAccountExample.typ b/java/output/BankAccountExample.typ new file mode 100644 index 0000000..779f5ff --- /dev/null +++ b/java/output/BankAccountExample.typ @@ -0,0 +1,124 @@ +#import "/template.typ": highlight-output +#highlight-output[``` +$ java BankAccountExample +Menu-driven program for operating bank accounts: +Menu: + 1. Create bank account + 2. Display bank account details + 3. Deposit money + 4. Withdraw money + 5. Close bank account + 6. Exit + +Enter your choice: 1 +Enter details of bank account: + Name: Lee Heoksoo + Address: Sindang-dong, Seoul + Account No.: 120045387091 + Balance: 71623500 +Menu: + 1. Create bank account + 2. Display bank account details + 3. Deposit money + 4. Withdraw money + 5. Close bank account + 6. Exit + +Enter your choice: 2 +Enter account number: 120045387091 +Customer details: + Name: Lee Heoksoo + Address: Sindang-dong, Seoul + Account Number: 120045387091 + Balance: 71623500.00 + +Menu: + 1. Create bank account + 2. Display bank account details + 3. Deposit money + 4. Withdraw money + 5. Close bank account + 6. Exit + +Enter your choice: 1 +Enter details of bank account: + Name: Axel Schauer + Address: Eidelstedt, Hamburg + Account No.: 582978 + Balance: 36400 +Menu: + 1. Create bank account + 2. Display bank account details + 3. Deposit money + 4. Withdraw money + 5. Close bank account + 6. Exit + +Enter your choice: 4 +Enter account number: 42000 +Could not find a bank account with the given account number. +Try again. + +Menu: + 1. Create bank account + 2. Display bank account details + 3. Deposit money + 4. Withdraw money + 5. Close bank account + 6. Exit + +Enter your choice: 4 +Enter account number: 4200 +Could not find a bank account with the given account number. +Try again. + +Menu: + 1. Create bank account + 2. Display bank account details + 3. Deposit money + 4. Withdraw money + 5. Close bank account + 6. Exit + +Enter your choice: 3 +Enter account number: 12000 +Could not find a bank account with the given account number. +Try again. + +Menu: + 1. Create bank account + 2. Display bank account details + 3. Deposit money + 4. Withdraw money + 5. Close bank account + 6. Exit + +Enter your choice: 5 +Enter account number: 582978 +Are you sure about closing your account (y/n): y +Account closing successful. +Menu: + 1. Create bank account + 2. Display bank account details + 3. Deposit money + 4. Withdraw money + 5. Close bank account + 6. Exit + +Enter your choice: 2 +Enter account number: 582978 +Could not find a bank account with the given account number. +Try again. + +Menu: + 1. Create bank account + 2. Display bank account details + 3. Deposit money + 4. Withdraw money + 5. Close bank account + 6. Exit + +Enter your choice: 6 +Bye. +```] + diff --git a/java/output/ComplexCalculations.typ b/java/output/ComplexCalculations.typ new file mode 100644 index 0000000..1b10fe7 --- /dev/null +++ b/java/output/ComplexCalculations.typ @@ -0,0 +1,20 @@ +#import "/template.typ": highlight-output +#highlight-output[``` +$ java ComplexCalculations +First complex number:- + Enter real part: 2 + Enter imaginary part: -3 +Second complex number:- + Enter real part: 5 + Enter imaginary part: 2 +(2.0 - 3.0i) + (5.0 + 2.0i) = 7.0 - 1.0i +$ java ComplexCalculations +First complex number:- + Enter real part: 1.5 + Enter imaginary part: -6.5 +Second complex number:- + Enter real part: 4.23 + Enter imaginary part: 3.7 +(1.5 - 6.5i) + (4.23 + 3.7i) = 5.73 - 2.8i +```] + diff --git a/java/output/FindNumberInArray.typ b/java/output/FindNumberInArray.typ new file mode 100644 index 0000000..9b71bb4 --- /dev/null +++ b/java/output/FindNumberInArray.typ @@ -0,0 +1,15 @@ +#import "/template.typ": highlight-output +#highlight-output[``` +$ java FindNumberInArray +Enter length: 5 +Enter array elements: 4 7 3 2 9 +Given: An array of numbers with 5 elements: 4.0 7.0 3.0 2.0 9.0 +Enter element to find in array: 7 +The number 7.0 was found in the array at position 2. +$ java FindNumberInArray +Enter length: 4 +Enter array elements: 5 9 0 3 +Given: An array of numbers with 4 elements: 5.0 9.0 0.0 3.0 +Enter element to find in array: 4 +Could not find the number 4.0 in the array. +```] diff --git a/java/output/ShapeAreaCalculations.typ b/java/output/ShapeAreaCalculations.typ new file mode 100644 index 0000000..05f14e6 --- /dev/null +++ b/java/output/ShapeAreaCalculations.typ @@ -0,0 +1,40 @@ +#import "/template.typ": highlight-output +#highlight-output[``` +$ java ShapeAreaCalculations +Choose the shape: +1. Triangle +2. Rectangle +3. Square +4. Circle +Enter your choice: 1 +Enter sides: 6 8 10 +Area of a triangle: 24.0 +$ java ShapeAreaCalculations +Choose the shape: +1. Triangle +2. Rectangle +3. Square +4. Circle +Enter your choice: 2 +Enter length and width: 23 14 +Area of a rectangle: 322 +$ java ShapeAreaCalculations +Choose the shape: +1. Triangle +2. Rectangle +3. Square +4. Circle +Enter your choice: 3 +Enter side length: 7 +Area of a square: 49 +$ java ShapeAreaCalculations +Choose the shape: +1. Triangle +2. Rectangle +3. Square +4. Circle +Enter your choice: 4 +Enter radius: 5 +Area of a square: 78.53981633974483 +```] + diff --git a/java/output/StudentsArray.typ b/java/output/StudentsArray.typ new file mode 100644 index 0000000..358a15b --- /dev/null +++ b/java/output/StudentsArray.typ @@ -0,0 +1,55 @@ +#import "/template.typ": highlight-output +#highlight-output[``` +$ java StudentsArray +Enter the number of students: +2 +Enter the details of the students: +For student 1: Enter the details of the student: +Enter Roll no.: 1 +Enter name: Lee Haseol +Enter stream: Science +For subject 1: Enter details of subject: +Enter title: Physics +Enter theory marks: 94 +For subject 2: Enter details of subject: +Enter title: Chemistry +Enter theory marks: 96 +For subject 3: Enter details of subject: +Enter title: Mathematics +Enter theory marks: 98 +For student 2: Enter the details of the student: +Enter Roll no.: 43 +Enter name: Lin Feng +Enter stream: Arts +For subject 1: Enter details of subject: +Enter title: History +Enter theory marks: 47 +For subject 2: Enter details of subject: +Enter title: Caligraphy +Enter theory marks: 56 +For subject 3: Enter details of subject: +Enter title: Philosophy +Enter theory marks: 72 +Displaying the details of the students: + +For student 1: +Student details: + Roll No.: 1 + Name: Lee Haseol + Stream: Science + Marks obtained in Physics: 94 + Marks obtained in Chemistry: 96 + Marks obtained in Mathematics: 98 + Average percentage: 96.00% + +For student 2: +Student details: + Roll No.: 43 + Name: Lin Feng + Stream: Arts + Marks obtained in History: 47 + Marks obtained in Caligraphy: 56 + Marks obtained in Philosophy: 72 + Average percentage: 58.33% +```] + |