You can download the slides from the link given above.
In this lecture, we will focus on following points:
- Software Process Models
- Linear Sequential Model
- Prototyping Model
You are allowed to change this code and play with it. Have fun!
package com.zaigham.calculator;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import java.util.regex.Pattern;
public class MainActivity extends AppCompatActivity {
private TextView txt1;
private String display= "";
private String currentOperator="";
private String result ="";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
txt1 = (TextView)findViewById(R.id.textview);
txt1.setText(display) ;
}
private void updateScreen()
{
txt1.setText(display);
}
public void onClickNumber (View v)
{
if (result!=""){
clear();
updateScreen();
}
Button b =(Button) v;
display += b.getText();
updateScreen();
}
public boolean isOperator(char op)
{
switch (op)
{
case'+':
case'-':
case'*':
case'/': return true;
default: return false;
}
}
public void onClickOperator (View v)
{
if (display=="") return;
Button b =(Button) v;
if (result!="")
{
String _display=result;
clear();
display = _display;
}
if (currentOperator!="")
{
Log.d("Calc",""+display.charAt(display.length()-1));
if(isOperator(display.charAt(display.length()-1)))
{
display = display.replace
(display.charAt(display.length()-1),b.getText().charAt(0));
updateScreen();
return;
}
else{
getResult();
display=result;
result="";
}
currentOperator = b.getText().toString();
}
display += b.getText();
currentOperator = b.getText().toString();
updateScreen();
}
private void clear()
{
display="";
currentOperator="";
result="";
}
public void onClickClear(View v)
{
clear();
updateScreen();
result="";
}
public double operate(String a,String b, String op)
{
switch(op)
{
case"+": return Double.valueOf(a) + Double.valueOf(b);
case"-": return Double.valueOf(a) - Double.valueOf(b);
case"*": return Double.valueOf(a) * Double.valueOf(b);
case"/":try {
return Double.valueOf(a) / Double.valueOf(b);
}catch(Exception e) {
Log.d("Calc", e.getMessage());
}
default:return-1;
}
}
private boolean getResult()
{
if(currentOperator=="") return false;
String[] operation = display.split(Pattern.quote(currentOperator));
if (operation.length<2) return false;
result= String.valueOf(operate(operation[0],operation[1],currentOperator)) ;
return true;
}
public void onClickEqual(View v)
{
if (display=="") return;
if (!getResult())return;
txt1.setText(display+"\n"+String.valueOf(result));
}
}
bsef15a005@pucit.edu.pk, | 17.23077 | 28 | 10 | 55.23076923 |
bsef15a006@pucit.edu.pk, | 20.19231 | 23 | 19 | 62.19230769 |
bsef15a008@pucit.edu.pk, | 25.03846 | 27.5 | 19.5 | 72.03846154 |
bsef15a009@pucit.edu.pk, | 24.5 | 27.5 | 19.5 | 71.5 |
bsef15a011@pucit.edu.pk, | 27.73077 | 29.5 | 14 | 71.23076923 |
bsef15a015@pucit.edu.pk, | 28.80769 | 34 | 20.75 | 83.55769231 |
bsef15a017@pucit.edu.pk, | 28.53846 | 32.25 | 19.25 | 80.03846154 |
bsef15a018@pucit.edu.pk, | 29.07692 | 32 | 16 | 77.07692308 |
bsef15a019@pucit.edu.pk, | 29.34615 | 30.5 | 19.5 | 79.34615385 |
bsef15a020@pucit.edu.pk, | 25.57692 | 28 | 19.75 | 73.32692308 |
bsef15a022@pucit.edu.pk, | 26.11538 | 26.75 | 17 | 69.86538462 |
bsef15a024@pucit.edu.pk, | 26.38462 | 28 | 19.5 | 73.88461538 |
bsef15a025@pucit.edu.pk, | 31.23077 | 34 | 17.75 | 82.98076923 |
bsef15a026@pucit.edu.pk, | 28.53846 | 26.25 | 16 | 70.78846154 |
bsef15a029@pucit.edu.pk, | 28.53846 | 28.75 | 19.75 | 77.03846154 |
bsef15a030@pucit.edu.pk, | 24.76923 | 27.25 | 16 | 68.01923077 |
bsef15a031@pucit.edu.pk, | 21.80769 | 26.25 | 19 | 67.05769231 |
bsef15a032@pucit.edu.pk, | 28.53846 | 28.25 | 17.75 | 74.53846154 |
bsef15a034@pucit.edu.pk, | 20.73077 | 30.5 | 10.5 | 61.73076923 |
bsef15a035@pucit.edu.pk, | 28.80769 | 32.25 | 14.75 | 75.80769231 |
bsef15a036@pucit.edu.pk, | 29.07692 | 33.5 | 18.5 | 81.07692308 |
bsef15a039@pucit.edu.pk, | 26.38462 | 25.25 | 21.25 | 72.88461538 |
bsef15a041@pucit.edu.pk, | 21.26923 | 32 | 13.25 | 66.51923077 |
bsef15a043@pucit.edu.pk, | 23.69231 | 27 | 16.5 | 67.19230769 |
bsef15a044@pucit.edu.pk, | 26.38462 | 29.25 | 19.5 | 75.13461538 |
bsef15a045@pucit.edu.pk, | 25.57692 | 29.25 | 19 | 73.82692308 |
bsef15a050@pucit.edu.pk, | 27.46154 | 33 | 19.25 | 79.71153846 |
bsef15a051@pucit.edu.pk, | 27.73077 | 26.25 | 18.5 | 72.48076923 |
bsef15m060@pucit.edu.pk, | 12.11538 | 16.5 | 6.75 | 35.36538462 |
bsef12m059@pucit.edu.pk, | 12.65385 | 16.75 | 0 | 29.40384615 |
bcsf12a006@pucit.edu.pk, | 12.11538 | 11.5 | 0 | 23.61538462 |
bsef14a048@pucit.edu.pk, | 27.73077 | 26.25 | 0 | 53.98076923 |
bsef15m001@pucit.edu.pk, | 33.11538462 | 37.25 | 20.75 | 91.11538462 |
bsef15m002@pucit.edu.pk, | 28.80769231 | 32.25 | 18.75 | 79.80769231 |
bsef15m004@pucit.edu.pk, | 29.61538462 | 33.25 | 22 | 84.86538462 |
bsef15m005@pucit.edu.pk, | 30.69230769 | 30.75 | 20.75 | 82.19230769 |
bsef15m006@pucit.edu.pk, | 25.30769231 | 27.75 | 16 | 69.05769231 |
bsef15m007@pucit.edu.pk, | 23.69230769 | 25.75 | 16.5 | 65.94230769 |
bsef15m008@pucit.edu.pk, | 28.80769231 | 31.75 | 21 | 81.55769231 |
bsef15m009@pucit.edu.pk, | 23.96153846 | 29.25 | 13 | 66.21153846 |
bsef15m011@pucit.edu.pk, | 30.42307692 | 33.5 | 19.25 | 83.17307692 |
bsef15m012@pucit.edu.pk, | 25.57692308 | 30.5 | 18 | 74.07692308 |
bsef15m013@pucit.edu.pk, | 31.5 | 34 | 15 | 80.5 |
bsef15m014@pucit.edu.pk, | 30.69230769 | 32.5 | 19 | 82.19230769 |
bsef15m015@pucit.edu.pk, | 30.42307692 | 32.75 | 18.75 | 81.92307692 |
bsef15m016@pucit.edu.pk, | 27.19230769 | 27.75 | 16.75 | 71.69230769 |
bsef15m017@pucit.edu.pk, | 29.88461538 | 29.5 | 16.5 | 75.88461538 |
bsef15m018@pucit.edu.pk, | 20.73076923 | 27.25 | 15.5 | 63.48076923 |
bsef15m019@pucit.edu.pk, | 26.38461538 | 30.5 | 16.5 | 73.38461538 |
bsef15m020@pucit.edu.pk, | 29.61538462 | 32 | 18.5 | 80.11538462 |
bsef15m022@pucit.edu.pk, | 27.73076923 | 30.25 | 21.5 | 79.48076923 |
bsef15m023@pucit.edu.pk, | 26.11538462 | 25.75 | 16.25 | 68.11538462 |
bsef15m024@pucit.edu.pk, | 26.38461538 | 33 | 19.75 | 79.13461538 |
bsef15m025@pucit.edu.pk, | 30.15384615 | 29.5 | 20.5 | 80.15384615 |
bsef15m026@pucit.edu.pk, | 22.07692308 | 27.25 | 13.5 | 62.82692308 |
bsef15m027@pucit.edu.pk, | 29.07692308 | 30.25 | 4 | 63.32692308 |
bsef15m029@pucit.edu.pk, | 19.65384615 | 0 | 6 | 25.65384615 |
bsef15m032@pucit.edu.pk, | 31.76923077 | 32.5 | 19.5 | 83.76923077 |
bsef15m033@pucit.edu.pk, | 18.57692308 | 31.25 | 14.75 | 64.57692308 |
bsef15m034@pucit.edu.pk, | 29.07692308 | 30.75 | 20.25 | 80.07692308 |
bsef15m035@pucit.edu.pk, | 19.11538462 | 35 | 20.5 | 74.61538462 |
bsef15m037@pucit.edu.pk, | 25.30769231 | 30.5 | 17.25 | 73.05769231 |
bsef15m038@pucit.edu.pk, | 23.15384615 | 21.5 | 13.5 | 58.15384615 |
bsef15m039@pucit.edu.pk, | 29.61538462 | 31 | 19.25 | 79.86538462 |
bsef15m041@pucit.edu.pk, | 27.73076923 | 25 | 13 | 65.73076923 |
bsef15m042@pucit.edu.pk, | 25.03846154 | 23.75 | 13.5 | 62.28846154 |
bsef15m044@pucit.edu.pk, | 25.03846154 | 28 | 15 | 68.03846154 |
bsef15m045@pucit.edu.pk, | 17.23076923 | 31.75 | 20.5 | 69.48076923 |
bsef15m046@pucit.edu.pk, | 18.30769231 | 25.5 | 15 | 58.80769231 |
bsef15m047@pucit.edu.pk, | 21 | 31 | 13.75 | 65.75 |
bsef15m049@pucit.edu.pk, | 18.30769231 | 24.5 | 15.5 | 58.30769231 |
bsef15m051@pucit.edu.pk, | 22.07692308 | 22.5 | 15.75 | 60.32692308 |
bsef15m052@pucit.edu.pk, | 28 | 31.75 | 19 | 78.75 |
bsef15m053@pucit.edu.pk, | 27.19230769 | 33 | 19.25 | 79.44230769 |
bsef15m055@pucit.edu.pk, | 29.34615385 | 28.5 | 19.5 | 77.34615385 |
bsef15m057@pucit.edu.pk, | 26.65384615 | 28.75 | 18.75 | 74.15384615 |
bsef15m058@pucit.edu.pk, | 24.23076923 | 25.25 | 17 | 66.48076923 |
bsef15m059@pucit.edu.pk, | 19.92307692 | 25.25 | 12.5 | 57.67307692 |
bsef15m062@pucit.edu.pk, | 25.84615385 | 23.5 | 19 | 68.34615385 |
bsef15m064@pucit.edu.pk, | 27.73076923 | 34 | 18.25 | 79.98076923 |
bsef15m065@pucit.edu.pk, | 29.61538462 | 34 | 18.5 | 82.11538462 |
bsef15m066@pucit.edu.pk, | 22.34615385 | 21 | 14.5 | 57.84615385 |
bsef12m044@pucit.edu.pk, | 19.11538462 | 16 | 2.5 | 37.61538462 |
bsef13m039@pucit.edu.pk, | 21.53846154 | 22 | 0 | 43.53846154 |
bsef14m002@pucit.edu.pk, | 23.69230769 | 23.75 | 0 | 47.44230769 |
bsef14m046@pucit.edu.pk, | 17.5 | 0 | 0 | 17.5 |
bsef14m058@pucit.edu.pk, | 16.69230769 | 23.25 | 12.25 | 52.19230769 |
bsef14a005@pucit.edu.pk, | 23.42307692 | 24.25 | 11.5 | 59.17307692 |
bsef14a012@pucit.edu.pk, | 24.76923077 | 23.75 | 15.5 | 64.01923077 |
bsef14a025@pucit.edu.pk, | 28 | 26.5 | 3 | 57.5 |
bsef14a027@pucit.edu.pk, | 26.38461538 | 29.25 | 15.5 | 71.13461538 |
bsef14a035@pucit.edu.pk, | 15.34615385 | 26 | 3 | 44.34615385 |
bsef14a030@pucit.edu.pk, | 24.23076923 | 26.5 | 14.75 | 65.48076923 |
bsef14a041@pucit.edu.pk, | 33.38461538 | 34.75 | 5.5 | 73.63461538 |