diff --git a/src/PrintfFormat.java b/src/PrintfFormat.java new file mode 100644 index 0000000..9dddeeb --- /dev/null +++ b/src/PrintfFormat.java @@ -0,0 +1,13 @@ +/** + * @author Trevor Hartman + * @author Alexei Iachkov + * @version 1 + * @date 1-3-24 + */ +//identifying errors +public class PrintfFormat { + public static void main(String[] args) { + double yarbles = 1400; + System.out.printf("printf %f, %d", yarbles); + } +} diff --git a/src/TempConvert.java b/src/TempConvert.java new file mode 100644 index 0000000..e12b8b8 --- /dev/null +++ b/src/TempConvert.java @@ -0,0 +1,26 @@ +/** + * @author Trevor Hartman + * @author Alexei Iachkov + * @version 1 + * @date 1-3-24 + */ +//import scanner +import java.util.Scanner; +public class TempConvert { + public static void main(String[] args) { + + //prompt user for input + System.out.print("Enter a temperature in celsius:"); + + //read input + Scanner in = new Scanner(System.in); + + //convert celsius to fahrenheit + double celsius = in.nextDouble(); + double fahrenheit = celsius * 9/5 + 32; + + //print converted result + System.out.printf("%.1f C = %.1f F", celsius, fahrenheit); + + } +} diff --git a/src/TimeConvert.java b/src/TimeConvert.java new file mode 100644 index 0000000..4278768 --- /dev/null +++ b/src/TimeConvert.java @@ -0,0 +1,30 @@ +/** + * @author Trevor Hartman + * @author Alexei Iachkov + * @version 1 + * @date 1-3-24 + */ +//import scanner +import java.util.Scanner; +public class TimeConvert { + public static void main(String[] args) { + + //prompt user for input + System.out.println("Enter a total number of seconds:"); + + //read input + Scanner in = new Scanner(System.in); + int total = in.nextInt(); + + //conversions + int totaltime = in.nextInt(); + int hours = totaltime / (60*60); + int minutes = totaltime % (60*60) / 60; + int seconds = totaltime % 60; + + //print converted result + System.out.printf("%d seconds = %d hours, %d minutes, and %d seconds", totaltime, hours, minutes, seconds); + + + } +} diff --git a/src/error 1.PNG b/src/error 1.PNG new file mode 100644 index 0000000..f95669e Binary files /dev/null and b/src/error 1.PNG differ diff --git a/src/error 2.PNG b/src/error 2.PNG new file mode 100644 index 0000000..b413913 Binary files /dev/null and b/src/error 2.PNG differ diff --git a/src/error 3.PNG b/src/error 3.PNG new file mode 100644 index 0000000..f552100 Binary files /dev/null and b/src/error 3.PNG differ