Wednesday, November 8, 2017

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, 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);
    }

}

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>

JavaScript Loops


Swift Example

Monday, June 26, 2017

Ch6: Swift Rectangle class example

import Foundation

class Rectangle {
    var length = 0
 var width = 0

 init(length: Int, width: Int) { // Constructor
  self.length = length
  self.width = width
 }
 var Area: Int{
  return length*width
 }

  func getArea() -> Int {
   return length*width
  }
}
class Circle {
    var radius = 0.0

 init(radius: Double) { // Constructor
  self.radius = radius

 }
 var Area: Double{
  return 3.14*(radius*radius)
 }

  func getArea() -> Double {
  return 3.14*(radius*radius)
  }
}

let rect1 = Rectangle(length: 10, width: 10)
print(rect1.Area)              // access the property
print(rect1.getArea())


let circ1=Circle(radius:12.0)
print(circ1.Area)
print(circ1.getArea())

Monday, June 19, 2017

CH5 Hellotextbox

package com.example.stu2000.hellotextbox;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.*;
public class MainActivity extends AppCompatActivity implements OnClickListener{
    private EditText editText;
    private TextView textView;
    private Button button;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        editText = (EditText)findViewById(R.id.editText);
        textView = (TextView)findViewById(R.id.textView2);
        button = (Button)findViewById(R.id.button);
        button.setOnClickListener(this);
    }
    @Override
    public void onClick(View v) {
        textView.setText(editText.getText().toString());
    }

}

Wednesday, March 15, 2017

Chapter 7: Xamarin

Do not try to follow chapter 7 in the text as it uses obsolete technology. You should create a Xamarin cross-platform project and not silver-light. You may need to install MS Visual Studio 2017.

Tuesday, February 28, 2017

CIST2381 MidTerm Review


Notes for Mobile App Development Test

consists of:

8 t/f
19 mult choice
6 short answer

t/f
* question have smartphones have always had smart screens? (pg. 4)
* java question: when using an inherited method, casting to superclass (pg. 50)
* question about "where is my phone app" (in book chapter four. pg 88)
* java class can extend only one superclass (pg. 122)


mult. choice
* which phone has highest screen resolution (as of last year/keep vendor in mind pg. 9)
* pseudo-code with while loop (analyze, only two variables involved and figured out
  results. pg 3)
* think of names for accessor methods (i.e. constructors/properties etc pg. 43)
* app inventor question which part represents android phone screen (i.e. whats the name
  pg.76)
* when you have a component not displayed in user interface it is called. (pg. 88)
* advantages of android studio over app inventor (pg. 103)
* the definition of refractoring (pg. 124)
* code will be listed (appears to be java code) which is being implemented (pg. 129)
* what interface is for button press event (pg. 145)

short answer
* when you are targeting a specific platform the app is said to be what? (pg. 6)
* asking about four layers of the android platform architecture (pg. 18)
* asking about four layers (in order) of the apple platform architecture (pg.20)
* discussion about protected vs. private vs. public access modifers ( make sure
  you understand what all three do pg. 132)

Monday, January 23, 2017

Chapter 6 (Apple iOS programming): The Swift Programming Language

WIKI Article Swift_(programming_language)
IBM Swift Sandbox, online Swift compiler and execution
//my hello world/loop
var str="Hello world!";
for i in 0..<10 i="" pre="" print="" str="">



//Rectangle Class example
import Foundation

class Rectangle {
    var length = 0
 var width = 0
    
    init(length: Int, width: Int) { // Constructor
        self.length = length
        self.width = width
    }
 var Area: Int{
  return length*width
 }
 
 func getArea() -> Int {
  return length*width
 }
}

let rect1 = Rectangle(length: 10, width: 10)
print(rect1.Area)              // access the property
print(rect1.getArea())


 

Chapter 3 and Strings

What is the difference between a mutable and immutable string in C#?