January 2014
Intermediate to advanced
736 pages
70h 43m
English
Class MainActivity (Figs. 3.9–3.16) implements the Tip Calculator app’s functionality. It calculates the 15% and custom percentage tips and total bill amounts, and displays them in locale-specific currency format. To view the file, open src/com.deitel/tipcalculator and double clck MainActivity.java. You’ll need to enter most of the code in Figs. 3.9–3.16.
1 // MainActivity.java 2 // Calculates bills using 15% and custom percentage tips. 3 package com.deitel.tipcalculator; 4 5 import java.text.NumberFormat; // for currency formatting 6 7 import android.app.Activity; // base class for activities 8 import android.os.Bundle; // for saving state information 9 import ...
Read now
Unlock full access