public class CToF {
private double degrees;
public double getDegrees() {
return degrees;
}
public void setDegrees(double degrees) {
this.degrees = degrees;
}
public CToF(double degrees){
this.degrees = degrees;
}
public double getFahrenheit(){
return 9.0/5.0 * degrees + 32;
}
}
public class FToC {
private double degrees;
public double getDegrees() {
return degrees;
}
public void setDegrees(double degrees) {
this.degrees = degrees;
}
public FToC(double degrees){
this.degrees = degrees;
}
public double getCelsius(){
return 5.0/9.0 * (degrees - 32);
}
}
Wednesday, November 8, 2017
Wednesday, October 18, 2017
Thursday, October 12, 2017
Monday, October 9, 2017
Wednesday, September 27, 2017
public class Rectangle {
private double length, width;
public double getLength() {
return length;
}
public void setLength(double length) {
this.length = length;
}
public double getWidth() {
return width;
}
public void setWidth(double width) {
this.width = width;
}
public Rectangle(double length, double width){
this.length = length;
this.width = width;
}
public double getArea(){
return length * width;
}
public double getPerimeter(){
return 2 * (length + width);
}
}
private double length, width;
public double getLength() {
return length;
}
public void setLength(double length) {
this.length = length;
}
public double getWidth() {
return width;
}
public void setWidth(double width) {
this.width = width;
}
public Rectangle(double length, double width){
this.length = length;
this.width = width;
}
public double getArea(){
return length * width;
}
public double getPerimeter(){
return 2 * (length + width);
}
}
Wednesday, September 13, 2017
Wednesday, August 23, 2017
CH1 Ex 1
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Loops</h2>
<p id="demo"></p>
<script>
var text = "";
var i;
for (i = 1; i <= 10; i++) {
text += i + "<br>";
}
document.getElementById("demo").innerHTML = text;
</script>
</body>
</html>
Swift Example
<html>
<body>
<h2>JavaScript Loops</h2>
<p id="demo"></p>
<script>
var text = "";
var i;
for (i = 1; i <= 10; i++) {
text += i + "<br>";
}
document.getElementById("demo").innerHTML = text;
</script>
</body>
</html>
JavaScript Loops
Swift Example
Subscribe to:
Posts (Atom)