From 5ea0ab6272277357c847ce324582e08cff58d134 Mon Sep 17 00:00:00 2001 From: Sudipto Mallick Date: Wed, 10 Jan 2024 13:53:54 +0530 Subject: Incorporate changes to Java assignment #5 Updating assignment as directed --- java/output/AddTwoNumbers.typ | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'java/output/AddTwoNumbers.typ') diff --git a/java/output/AddTwoNumbers.typ b/java/output/AddTwoNumbers.typ index 0d3da48..c7102f4 100644 --- a/java/output/AddTwoNumbers.typ +++ b/java/output/AddTwoNumbers.typ @@ -1,35 +1,14 @@ #import "/template.typ": highlight-output -==== Taking input from command line arguments #highlight-output[``` -$ java AddTwoNumbersCLI -Usage: AddTwoNumbersCLI first-number second-number -$ java AddTwoNumbersCLI 5 7 +$ java AddTwoNumbersCLI 5 7 Taking input from CLI arguments: 5.0 + 7.0 = 12.0 -```] -==== Taking input using `java.util.Scanner` -#highlight-output[``` -$ java AddTwoNumbersScan Taking input using java.util.Scanner: -Enter first number: 12 +Enter first number: 12 Enter second number: 7.3 12.0 + 7.3 = 19.3 -$ java AddTwoNumbersScan -Taking input using java.util.Scanner: -Enter first number: 5.1 -Enter second number: 2c -Invalid numbers -```] -==== Taking input using `java.io.BufferedReader` -#highlight-output[``` -$ java AddTwoNumbersBuf Taking input using java.io.BufferedReader: Enter first number: 11.1 Enter second number: 9.6 11.1 + 9.6 = 20.7 -$ java AddTwoNumbersBuf -Taking input using java.io.BufferedReader: -Enter first number: 78 -Enter second number: ab -Invalid numbers ```] -- cgit 1.4.1-2-gfad0