Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/PrintfFormat.java
Original file line number Diff line number Diff line change
@@ -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);
}
}
26 changes: 26 additions & 0 deletions src/TempConvert.java
Original file line number Diff line number Diff line change
@@ -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);

}
}
30 changes: 30 additions & 0 deletions src/TimeConvert.java
Original file line number Diff line number Diff line change
@@ -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);


}
}
Binary file added src/error 1.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/error 2.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/error 3.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.