You are on page 1of 257

/**

* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}

/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}
private void displayQuantity(int number) {
TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;
public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}
private void displayMessage(String message) {
TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}
private String createOrderSummary(int price) {
return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);
}

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void increment(View view) {
quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {


int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

}
private int calculatePrice() {
int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}
public void submitOrder(View view) {
int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}
private void displayQuantity(int number) {
TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}
public void decrement(View view) {
quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {


int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

}
private int calculatePrice() {
int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}
public void submitOrder(View view) {
int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}
public void decrement(View view) {
quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;
public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}
private void displayMessage(String message) {
TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}
private String createOrderSummary(int price) {
return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);
}

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void increment(View view) {
quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}
private void displayQuantity(int number) {
TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;
public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}
private void displayMessage(String message) {
TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}
private String createOrderSummary(int price) {
return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);
}

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void increment(View view) {
quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {


int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

}
private int calculatePrice() {
int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}
public void submitOrder(View view) {
int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}
private void displayQuantity(int number) {
TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}
public void decrement(View view) {
quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {


int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

}
private int calculatePrice() {
int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}
public void submitOrder(View view) {
int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}
public void decrement(View view) {
quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;
public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}
private void displayMessage(String message) {
TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}
private String createOrderSummary(int price) {
return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);
}

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void increment(View view) {
quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}
private void displayQuantity(int number) {
TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;
public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}
private void displayMessage(String message) {
TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}
private String createOrderSummary(int price) {
return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);
}

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void increment(View view) {
quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {


int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

}
private int calculatePrice() {
int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}
public void submitOrder(View view) {
int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}
private void displayQuantity(int number) {
TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}
public void decrement(View view) {
quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {


int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

}
private int calculatePrice() {
int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}
public void submitOrder(View view) {
int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}
public void decrement(View view) {
quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;
public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}
private void displayMessage(String message) {
TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}
private String createOrderSummary(int price) {
return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);
}

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void increment(View view) {
quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}
private void displayQuantity(int number) {
TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;
public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}
private void displayMessage(String message) {
TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}
private String createOrderSummary(int price) {
return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);
}

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void increment(View view) {
quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {


int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

}
private int calculatePrice() {
int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}
public void submitOrder(View view) {
int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}
private void displayQuantity(int number) {
TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}
public void decrement(View view) {
quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {


int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

}
private int calculatePrice() {
int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}
public void submitOrder(View view) {
int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}
public void decrement(View view) {
quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;
public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}

private String createOrderSummary(int price) {


return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}
private void displayMessage(String message) {
TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}/**
* IMPORTANT: Make sure you are using the correct package name.
* This example uses the package name:
* package com.example.android.justjava
* If you get an error when copying this code into Android studio, update it to
match teh package name found
* in the project's AndroidManifest.xml file.
**/
package com.example.android.justjava;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;

public class MainActivity extends AppCompatActivity {

int quantity = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void increment(View view) {


quantity++;
displayQuantity(quantity);
}

public void decrement(View view) {


quantity--;
displayQuantity(quantity);
}

private void displayQuantity(int number) {


TextView quantityTextView = (TextView)
findViewById(R.id.quantity_text_view);
quantityTextView.setText("" + number);
}

public void submitOrder(View view) {


int price = calculatePrice();
String priceMessage = createOrderSummary(price);
displayMessage(priceMessage);

private int calculatePrice() {


int price = quantity * 5;
return price;
}
private String createOrderSummary(int price) {
return "Name: Kaptain Kunal"
+ "\nQuantity: " + quantity
+ "\nTotal: " + price
+ "\nThank you !";
}

private void displayMessage(String message) {


TextView orderSummaryTextView = (TextView)
findViewById(R.id.order_summary_text_view);
orderSummaryTextView.setText(message);
}
}

You might also like