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>
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ 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..

### **Error Images**
![error01.png](..%2F..%2FOneDrive%2FPictures%2FScreenshots%2Ferror01.png)
![error02.png](..%2F..%2FOneDrive%2FPictures%2FScreenshots%2Ferror02.png)
![error03.png](..%2F..%2FOneDrive%2FPictures%2FScreenshots%2Ferror03.png)
---

## Part 2: Celsius to Fahrenheit Converter
Expand Down
Binary file added 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 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 error03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions src/SecondsConverter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
Quinn McKay
1/31/2024
Part 3 of Java Lab 03
*/

import java.util.Scanner;

public class SecondsConverter {

public static void main(String[] args){
int seconds;
int hours, minutes, remainder_minutes, remainder_seconds;
final int seconds_per_minute = 60;
final int minutes_per_hour = 60;
Scanner time = new Scanner(System.in);

System.out.print("How many seconds? ");
seconds = time.nextInt();

minutes = (seconds / seconds_per_minute);
hours = (minutes / minutes_per_hour);
remainder_minutes = (minutes % minutes_per_hour);
remainder_seconds = (seconds % seconds_per_minute);

System.out.printf("%d seconds = %d hours, %d minutes, and %d seconds", seconds, hours, remainder_minutes, remainder_seconds);



}
}
18 changes: 18 additions & 0 deletions src/java/Part1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
Quinn McKay
1/31/2024
Part 1 of Java Lab 03
*/

public class Part1 {
public static void main(String [] args) {

int a = 5;
double b = 3.67;

System.out.printf("Number = %f", a);
System.out.printf("Number = %d", b);
System.out.printf("Number = %d + %f", a);

}
}
23 changes: 23 additions & 0 deletions src/java/TempConverter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
Quinn McKay
1/31/2024
Part 2 of Java Lab 03
*/

import java.util.Scanner;
public class TempConverter {

public static void main(String[] args) {
int c;
double f;
Scanner celsius = new Scanner(System.in);

System.out.print("Enter Celsius: ");
c = celsius.nextInt();
f = c * 1.8 + 32;

System.out.printf("%d Celsius = %.1f Fahrenheit.", c, f);


}
}