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
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Java-Lab-003.iml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
31 changes: 31 additions & 0 deletions src/TempConvert.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import java.util.Scanner;
/**
*
* @author Trevor Hartman
* @author Eliot Rodriguez
*
* @since version 1.0
* January 30, 2024
*
*/
public class TempConvert {
static double c;
static double f;
static int secs;
static final int secsInMin = 60;
static final int minsInHour = 60;
static int hours, minutes, seconds;
static Scanner scanner = new Scanner(System.in);
public static void main(String[] args) {
System.out.print("Enter a temperature in Celsius: ");
c = scanner.nextDouble();
f = c * 9.0/5.0 + 32.0;
System.out.printf("%.1f C = %.1f F", c, f);
System.out.print("\nEnter a total number of seconds: ");
secs = scanner.nextInt();
hours = (secs/secsInMin)/minsInHour;
minutes = (secs/secsInMin)-minsInHour;
seconds = secs%secsInMin;
System.out.printf("%d secs = %d hours, %2d minutes, %2d seconds",secs, hours, minutes, seconds);
}
}
Binary file added src/error01.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/error02.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/error03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.