You will develop 2 mobile apps:
1) Practice: An app the reads the radius and creates a circle object to calculate the area and circumference of the circle. I will give you an example of this for each chapter.
2) Assignment: An app that reads the length and width and creates a rectangle object to calculate the area and perimeter of the rectangle. Note you will add another textbox (input) control and create a constructor that take two parameters.
Examples of constructors that take 2 parameters:
JavaScript:
var myRect = new Rectangle(len,wid);
//Rectangle.js
constructor(len,wid)
{
this.length=len;
this.width=wid;
}
Java:
Rectangle myRect = new Rectangle(l,w);
//Rectangle.java
public Rectangle(double length, double width)
{
this.length = length;
this.width = width;
}
C#:
Rectangle myRect = new Rectangle (Double.Parse(etLength.Text),Double.Parse(etWidth.Text) );
//Rectangle.cs
public Rectangle (double length, double width)
{
this.length = length;
this.width = width;
}
Swift:
let myRect=Rectangle(length:len!, width:wid! );
//Rectangle.swift
init(length: Double, width: Double) { // Constructor
self.length= length
self.width=width
}
You will implement the assignments on the following platforms:
- MIT AppInventor
- Android and Android studio, language is java.
- Xamarin and Microsoft Visual Studio. lamguage is C#.
- iOS and Xcode , the language is Swift.
- Cross Platform Web: with a code editor (replit.com is preferred), the language is HTML5, CSS and Javascript.