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.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Take note of the various variables and their data types. Write a brief summary i
* Variable name
* Its data type
* and example values you can assign them.
* Varible names types i played with are Primitive types,specifiers and their outputs. A messed up specifier i had to change was != to ==. %B%N was precent boolean and new line and its how i changed true or false in the code
*

Next give TWO example variable names and TWO example variable assignments that are **WRONG** and explain why.
* Hint: your IDE can help you discover wrong assignments or variable names!
Expand Down
12 changes: 6 additions & 6 deletions src/LikeAGirl.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 bad = 1;
int good = 1;
int bad = 2;
// 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
Expand All @@ -44,12 +44,12 @@ public static void main(String[] args) {

System.out.println(
String.format(scriptTemplateLine5, answer,
(answer == good) ?
(answer == bad) ?
String.format(ansGood, dEmotionalDamage) : String.format(ansBad, emotionalDamage)
)
);

trueOrFalse = (answer != good); // if answer == 1 (i.e. good), then trueOrFalse should be False
trueOrFalse = (answer == good); // if answer == 1 (i.e. good), then trueOrFalse should be False
System.out.printf("Did you answer like a nice person? %B%n", trueOrFalse);
}
}