diff --git a/.idea/misc.xml b/.idea/misc.xml index 639900d..172df7b 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/Java-Lab-003.iml b/Java-Lab-003.iml index b46c0dd..e1006ff 100644 --- a/Java-Lab-003.iml +++ b/Java-Lab-003.iml @@ -5,6 +5,7 @@ + \ No newline at end of file diff --git a/README.md b/README.md index cdcf86f..ae4b2c6 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,9 @@ For each of the issues above, screenshot and add the error images to this repo n ### **Note:** Your answers to this exercise should be added using Markdown into the project's `README.md` file so that they get committed with the project's code.. - +![1.](error01.png) +![2.](error02.png) +![3.](error03.png) --- ## Part 2: Celsius to Fahrenheit Converter diff --git a/error01.png b/error01.png new file mode 100644 index 0000000..4076ea1 Binary files /dev/null and b/error01.png differ diff --git a/error02.png b/error02.png new file mode 100644 index 0000000..24b2184 Binary files /dev/null and b/error02.png differ diff --git a/error03.png b/error03.png new file mode 100644 index 0000000..417d15e Binary files /dev/null and b/error03.png differ diff --git a/src/TempConvert.java b/src/TempConvert.java new file mode 100644 index 0000000..4eaf135 --- /dev/null +++ b/src/TempConvert.java @@ -0,0 +1,17 @@ +import java.util.Scanner; +public class TempConvert { + public static void main (String[] args) { + + System.out.print("Enter temperature in Celsius:"); + double celsius; + double fahrenheit; + Scanner scan = new Scanner(System.in); + celsius = scan.nextDouble(); + + fahrenheit = celsius * 9 / 5 + 32; + + //System.out.printf("Temperature in Fahrenheit: %.1f", + fahrenheit); + System.out.printf(" %.1f C in Fahrenheit is %.1f F", celsius, fahrenheit); + + } +} diff --git a/src/TimeConvert.java b/src/TimeConvert.java new file mode 100644 index 0000000..11acdd7 --- /dev/null +++ b/src/TimeConvert.java @@ -0,0 +1,18 @@ +import java.util.Scanner; +public class TimeConvert { + public static void main (String[] args) { + + System.out.print("Enter number of seconds:"); + int totalSec; + Scanner scan = new Scanner(System.in); + totalSec = scan.nextInt(); + + int hours = totalSec / 3600; + int remainSec = totalSec % 3600; + int minutes = remainSec / 60; + int seconds = remainSec % 60; + + System.out.printf("%d seconds = %d hours, %d minutes, %d seconds", totalSec, hours, minutes, seconds); + + } +}