This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class WeightClass { | |
boolean isWeightOneHundred(int oneHundred){return oneHundred == 100;} | |
public static void main(String[] args) { | |
WeightClass start = new WeightClass(); | |
int releaseWeight =5; | |
if (start.isWeightOneHundred(releaseWeight)){ | |
System.out.println("System Stops..."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package node; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class Help { | |
static class Person { | |
private String name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this gist gives you a glimpse of how to use Inheritance, polymorphm and interfaces | |
interface Bouncable{ | |
void bounce(); | |
int getBounceFactor(); | |
String getBallName(String name); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# taking user input from the user | |
space ="\n" | |
print space | |
one = input("enter the first number ") | |
two = input("enter the second number ") | |
three = input("enter the third number ") | |
four = input("enter the fourth number ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#getting typeOf | |
space = "\n" | |
# assigning an Integer | |
integer = 13 | |
print "The variable type of integer variable is : ",type(integer) | |
print "The integer number is :",integer,space |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this program takes a string to be replaced | |
# by another string in ceratina char(index) | |
# and return the new string/ word. | |
words = raw_input("enter a name:") | |
print words |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# days of the week represented in numbers | |
# this program takes an inputs from the user | |
# and a number is assagned with a day in the week | |
daysOfTheWeek = input("enter a number between a 1 and 7: ") | |
if (daysOfTheWeek == 1): | |
print "Monday" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
space = "\n" | |
# this program counts the number of floats numbers that are greater than 25.0 | |
# and returns a string. | |
floatone =float(input("Enter the First float number: ")) | |
floattwo =float(input("Enter the Second float number: ")) | |
floatthree =float(input("Enter the Third float number: ")) | |
floatfour =float(input("Enter the Fourth float number: ")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# taking user input from the user | |
space ="\n" | |
print space | |
one = input("enter the first number ") | |
two = input("enter the second number ") | |
three = input("enter the third number ") | |
four = input("enter the fourth number ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this program will take in the scores and return the graades with | |
# appropriate comment. | |
final_mark = input("plese enter Your mark:") | |
if final_mark <= 60 : | |
print "Contact your e-tutor urgently." |
NewerOlder