We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 711a507 commit 6bce757Copy full SHA for 6bce757
1 file changed
src/lab_06/Lab_06_01.java
@@ -0,0 +1,17 @@
1
+package lab_06;
2
+/*
3
+Requirement:
4
+Given input string: "2hrs and 5 minutes"
5
+Please calculate how many minutes in total
6
+ */
7
+public class Lab_06_01 {
8
+ public static void main(String[] args) {
9
+ String myInputTime = new String("2 hours and 5 mintues");
10
+ char hourvalue = myInputTime.charAt(0);
11
+ char mintuesvalue = myInputTime.charAt(12);
12
+ int myHour = Integer.parseInt(String.valueOf(hourvalue));
13
+ int myMintues = Integer.parseInt(String.valueOf(mintuesvalue));
14
+ int mintuesCovert = (myHour * 60);
15
+ System.out.println("Totlal mintues is " + (mintuesCovert + myMintues));
16
+ }
17
+}
0 commit comments