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: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
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.
17 changes: 17 additions & 0 deletions src/TempConvert.java
Original file line number Diff line number Diff line change
@@ -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);

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

}
}