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
package net.greet.web;
import java.math.BigDecimal;
import java.math.RoundingMode;
public class CompoundInterest {
public static void main(String[] args) {
double pv = 28000;
double interestRate = 7/100d;
@DuncantheeDuncan
DuncantheeDuncan / upload_file.php
Last active July 11, 2019 16:09
trying out gist :)
<?php
echo "Hello, World";
?>
# 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."
# 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 ")
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: "))
# 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 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
#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
# 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 ")
@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);
}