From 7ef3799d56842337b6fea64f8cc3d9af4a750ee5 Mon Sep 17 00:00:00 2001 From: chris shortt Date: Wed, 20 Sep 2023 12:31:00 -0700 Subject: [PATCH 1/2] like a boy. --- .idea/misc.xml | 1 - README.md | 11 +++++++---- src/LikeAGirl.java | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) 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..f40b3a6 100644 --- a/README.md +++ b/README.md @@ -55,15 +55,18 @@ Did you answer like a nice person? FALSE ### Part 2 - Interpretation Take note of the various variables and their data types. Write a brief summary in this section of the README.md file listing the: -* Variable name -* Its data type -* and example values you can assign them. +## -----------------------homework section----------------------------- +* Variable name ---->integer variable int example int x +* Its data type----> a data type than can store WHOLE numbers +* and example values you can assign them.---> integers between -2147483648 to 2147483648 Next give TWO example variable names and TWO example variable assignments that are **WRONG** and explain why. +char a doesnt work because it needs to be in quotes char "a" or char "a" = 9 +boolian yes or no is incorrect because in computer language its true or false * Hint: your IDE can help you discover wrong assignments or variable names! ### Part 3 - Bonus: Play around with Java String Format Specifiers. - +I didnt understand how to do this i tried, but need to move on. Pick several of the Java format specifiers below and define variables of the correct type utilize **sout** and **String.format** to view the resulting formats. ![Format Specifiers](JavaStringFormatSpecifiers.png) diff --git a/src/LikeAGirl.java b/src/LikeAGirl.java index 30b943b..350a651 100644 --- a/src/LikeAGirl.java +++ b/src/LikeAGirl.java @@ -15,13 +15,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 likeAGirl = "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 = 050.0f; // 32 Bit, but it does exist! // double precision floating point variable double dEmotionalDamage = 100.0; // Double precision // boolean variable From 521773e9eb2e0560f5c84e4afa4ad066ea0c6ce2 Mon Sep 17 00:00:00 2001 From: chris shortt Date: Wed, 20 Sep 2023 12:31:00 -0700 Subject: [PATCH 2/2] like a boy. --- .idea/misc.xml | 1 - README.md | 11 +++++++---- src/LikeAGirl.java | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) 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..f40b3a6 100644 --- a/README.md +++ b/README.md @@ -55,15 +55,18 @@ Did you answer like a nice person? FALSE ### Part 2 - Interpretation Take note of the various variables and their data types. Write a brief summary in this section of the README.md file listing the: -* Variable name -* Its data type -* and example values you can assign them. +## -----------------------homework section----------------------------- +* Variable name ---->integer variable int example int x +* Its data type----> a data type than can store WHOLE numbers +* and example values you can assign them.---> integers between -2147483648 to 2147483648 Next give TWO example variable names and TWO example variable assignments that are **WRONG** and explain why. +char a doesnt work because it needs to be in quotes char "a" or char "a" = 9 +boolian yes or no is incorrect because in computer language its true or false * Hint: your IDE can help you discover wrong assignments or variable names! ### Part 3 - Bonus: Play around with Java String Format Specifiers. - +I didnt understand how to do this i tried, but need to move on. Pick several of the Java format specifiers below and define variables of the correct type utilize **sout** and **String.format** to view the resulting formats. ![Format Specifiers](JavaStringFormatSpecifiers.png) diff --git a/src/LikeAGirl.java b/src/LikeAGirl.java index 30b943b..350a651 100644 --- a/src/LikeAGirl.java +++ b/src/LikeAGirl.java @@ -15,13 +15,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 likeAGirl = "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 = 050.0f; // 32 Bit, but it does exist! // double precision floating point variable double dEmotionalDamage = 100.0; // Double precision // boolean variable