diff --git a/Week1/A-Introduction to Java/Assignment1a/PrintingMultipleLines.txt b/Week1/A-Introduction to Java/Assignment1a/PrintingMultipleLines.txt new file mode 100644 index 0000000..af3f53a --- /dev/null +++ b/Week1/A-Introduction to Java/Assignment1a/PrintingMultipleLines.txt @@ -0,0 +1,9 @@ +public class SciencePoem { + public static void main(String[] args) { + //Write your code here + //Pay attention to the new line and the ending characters. + + System.out.println("In the realm of atoms and galaxies,\nWhere mysteries unfurl like cosmic seas,\nScience, our guiding star so bright,\nReveals the universe, its boundless light.\n"); + System.out.println("From microcosms to celestial grace,\nInquiring minds explore every space,\nIn the quest for knowledge, we stand tall,\nScience, the greatest adventure of all."); + } +} diff --git a/Week1/A-Introduction to Java/CorrectTheCode.txt b/Week1/A-Introduction to Java/CorrectTheCode.txt new file mode 100644 index 0000000..91d2a5b --- /dev/null +++ b/Week1/A-Introduction to Java/CorrectTheCode.txt @@ -0,0 +1,5 @@ +public class Solution { + public static void main(String[] args){ + System.out.println("You have successfully removed the error"); + } +} diff --git a/Week1/A-Introduction to Java/Print.txt b/Week1/A-Introduction to Java/Print.txt new file mode 100644 index 0000000..d1d33fe --- /dev/null +++ b/Week1/A-Introduction to Java/Print.txt @@ -0,0 +1,7 @@ +public class HelloWorld { + public static void main(String[] args){ + + //Modify this statement + System.out.println("I learnt tricks"); + } +} \ No newline at end of file diff --git a/Week1/A-Introduction to Java/PrintMoreLines.txt b/Week1/A-Introduction to Java/PrintMoreLines.txt new file mode 100644 index 0000000..779fa46 --- /dev/null +++ b/Week1/A-Introduction to Java/PrintMoreLines.txt @@ -0,0 +1,8 @@ +public class SampleProgram { + public static void main(String[] args){ + //Write your code below + + System.out.print("I'm learning Java.\nJava is an object-oriented programming language."); + + } +} \ No newline at end of file diff --git a/Week1/A-Introduction to Java/RemoveError.txt b/Week1/A-Introduction to Java/RemoveError.txt new file mode 100644 index 0000000..a8e2a2c --- /dev/null +++ b/Week1/A-Introduction to Java/RemoveError.txt @@ -0,0 +1,5 @@ +public class HelloWorld { + public static void main(String[] args){ + System.out.println("You have successfully removed the main method error"); + } +} diff --git a/Week1/B-Fundamentals of Java/Assignment1b/CorrectLiteralRepresentation.txt b/Week1/B-Fundamentals of Java/Assignment1b/CorrectLiteralRepresentation.txt new file mode 100644 index 0000000..c8d164c --- /dev/null +++ b/Week1/B-Fundamentals of Java/Assignment1b/CorrectLiteralRepresentation.txt @@ -0,0 +1,22 @@ +public class DebugAndPrintLiterals { + public static void main(String[] args) { + //Write your code here + + //Declare and initialize the variables with proper literal representation + int a=26; + float f=3.1415f; + double d=23.411; + String s="WritingCleanerCode"; + System.out.println(a); + System.out.println(f); + System.out.println(d); + System.out.println(s); + + + + //Print each literal value in new line. + + + + } +} diff --git a/Week1/B-Fundamentals of Java/Assignment1b/LowerCase.txt b/Week1/B-Fundamentals of Java/Assignment1b/LowerCase.txt new file mode 100644 index 0000000..3d0ac5d --- /dev/null +++ b/Week1/B-Fundamentals of Java/Assignment1b/LowerCase.txt @@ -0,0 +1,16 @@ +public class ConvertToLowerCase{ + public static void main(String[] args) { + + String upperCaseString = "I AM LEARNING FUNDAMENTALS OF JAVA"; + + //Convert the above given string into all lowercase using wrapper class method of String + //Use inbuilt feature of String .toLowerCase() + String res=upperCaseString.toLowerCase(); + System.out.println(res); + + + //Print the newly converted lower case string. + + + } +} \ No newline at end of file diff --git a/Week1/B-Fundamentals of Java/Average.txt b/Week1/B-Fundamentals of Java/Average.txt new file mode 100644 index 0000000..4d51140 --- /dev/null +++ b/Week1/B-Fundamentals of Java/Average.txt @@ -0,0 +1,14 @@ + +public class Solution +{ + public static void main(String[] args) { + + int a = 10 ; + int b = 20 ; + int c = 30 ; + // write your code logic and print the result .. + int sum=a+b+c; + int average=sum/3; + System.out.println(average); + } +} \ No newline at end of file diff --git a/Week1/B-Fundamentals of Java/SumOfTwoNumbers.txt b/Week1/B-Fundamentals of Java/SumOfTwoNumbers.txt new file mode 100644 index 0000000..9e7a735 --- /dev/null +++ b/Week1/B-Fundamentals of Java/SumOfTwoNumbers.txt @@ -0,0 +1,12 @@ + +public class Solution +{ + public static void main(String[] args) { + + int a = 10 ; + int b = 20 ; + // write your code logic and print the result .. + System.out.println(a+b); + + } +} \ No newline at end of file