diff --git a/.idea/misc.xml b/.idea/misc.xml index 03f397c..ca950ab 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/README.md b/README.md index b866789..c88becc 100644 --- a/README.md +++ b/README.md @@ -74,3 +74,25 @@ Pick several of the Java format specifiers below and define variables of the cor * Push it to your Remote/origin branch (i.e. GitHub: Feature1 -> origin/Feature1) * Then issue a Pull request to my instructor branch * Make sure to **COPY** the Pull request URL and submit it for the lab/assignment. + +Part 2 + +The data and the variable name: + +Data Type: Boolean +Example values: True, False + + +Data Type Float +Example values: 50.00000, 100,00000 + + +Incorrect variables names and assignments + +234Hamza +Data type is incorrect variable name +Assignment: 234Hamza = “invalid” is wrong because variable names cannot start with a digit + +Class +Data type: this is an incorrect variable name. +Assignment: ‘class = “Math” is wrong because “class” is reserved keyword in many programming languages. diff --git a/img.png b/img.png new file mode 100644 index 0000000..f141e90 Binary files /dev/null and b/img.png differ diff --git a/img_1.png b/img_1.png new file mode 100644 index 0000000..33f7795 Binary files /dev/null and b/img_1.png differ diff --git a/img_2.png b/img_2.png new file mode 100644 index 0000000..33f7795 Binary files /dev/null and b/img_2.png differ diff --git a/src/LikeAGirl.java b/src/LikeAGirl.java index 30b943b..e617305 100644 --- a/src/LikeAGirl.java +++ b/src/LikeAGirl.java @@ -1,7 +1,13 @@ + + import java.util.Scanner; -public class LikeAGirl { + + +class LikeAgirl { /** + * @authore Mr. Hartman + * @student Naqibullah Haiwadpal * "Like a Girl," Super Bowl XLIX (2015) - Like a Girl * @param args Command line arguments [The source file path, The target file path, ...] **/ @@ -15,13 +21,13 @@ public static void main(String[] args) { String scriptTemplateLine5 = "You answered %d%n%s."; String ansGood = "Always wants to change that.%nEmotional Damage %f"; String ansBad = "Good for you.%nEmotional Damage %f"; - String likeAGirl = "Like a Girl"; + String LikeAboy = "Like a boy"; // integer variable - int good = 0; + int good= 2; int bad = 1; // 32 bit floating point variable - float emotionalDamage = 0.0f; // 32 Bit, but it does exist! + float emotionalDamage = 50.0f; // 32 Bit, but it does exist! // double precision floating point variable double dEmotionalDamage = 100.0; // Double precision // boolean variable @@ -30,15 +36,15 @@ public static void main(String[] args) { Scanner s = new Scanner(System.in); System.out.println( - String.format(scriptTemplateLine1, likeAGirl)); + String.format(scriptTemplateLine1, LikeAboy)); // Example of using printf and platform specific line separator "%n" to // format instead of String.format - System.out.printf(scriptTemplateLine2, likeAGirl); + System.out.printf(scriptTemplateLine2, LikeAboy); - System.out.println(String.format(scriptTemplateLine3, likeAGirl)); + System.out.println(String.format(scriptTemplateLine3, LikeAboy)); - System.out.printf(scriptTemplateLine4, likeAGirl, good, bad); + System.out.printf(scriptTemplateLine4, LikeAboy, good, bad); int answer = Integer.parseInt(s.nextLine()); @@ -53,3 +59,6 @@ public static void main(String[] args) { System.out.printf("Did you answer like a nice person? %B%n", trueOrFalse); } } + + +