Skip to content
Open

done #36

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
1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Binary file added img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 17 additions & 8 deletions src/LikeAGirl.java
Original file line number Diff line number Diff line change
@@ -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) - <a href="https://www.youtube.com/watch?v=5yLXrWLvwAo">Like a Girl</a>
* @param args Command line arguments [The source file path, The target file path, ...]
**/
Expand All @@ -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
Expand All @@ -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());

Expand All @@ -53,3 +59,6 @@ public static void main(String[] args) {
System.out.printf("Did you answer like a nice person? %B%n", trueOrFalse);
}
}