Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View DuncantheeDuncan's full-sized avatar
🏠
Working from home

Phumlani Mthembu DuncantheeDuncan

🏠
Working from home
  • Cape Town, 7441
View GitHub Profile
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...");
package node;
import java.util.HashMap;
import java.util.Map;
public class Help {
static class Person {
private String name;
@DuncantheeDuncan
DuncantheeDuncan / Ball.java
Created September 18, 2019 14:04
this gist gives you a glimpse of how to use Inheritance, polymorphsm and interfaces
// this gist gives you a glimpse of how to use Inheritance, polymorphm and interfaces
interface Bouncable{
void bounce();
int getBounceFactor();
String getBallName(String name);
}
# 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 ")
#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 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
# 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"
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: "))
# 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 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."