Question
Design a pizza order mobile application. This application will need to allow the user to enter input to configure their pizza, inform the user what the total price of the order is. After the user submit the order, the order details will be stored in the database. Assume each customer can only order one pizza.
1. The user interface has the following options:
MainPage:
• Toppings must include but not limited to the following options (such as checkboxes): Pepperoni, Chicken, Mushroom, Green Pepper, Olive, Extra cheese
• Radio Buttons for the following: Small / Medium / Large Submit Button
After clicking the submit button, the interface will display the total price of the order and save order details in the database.
The students will decide the price for each option.
SecondPage:
• Textboxes for the following options: Customer Name, Phone Number
2. Database design
Database table should be able to store the following data: order id, customer name, phone number and order price
3. Model
Create a separate class to store order details including: order id, customer name, phone number and order price.
Solution Preview
These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.
package com.dara.pizzaorder;import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.RadioButton;
public class MainActivity extends AppCompatActivity {
private CheckBox chicken, pepperoni,
mushroom, green_pepper, olive, extra_cheese;
private RadioButton small, medium, large;
private Button sumit;
private float price;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
pepperoni = (CheckBox) findViewById(R.id.pepperoni);
chicken = (CheckBox) findViewById(R.id.chicken);
mushroom = (CheckBox) findViewById(R.id.mushroom);
green_pepper = (CheckBox) findViewById(R.id.green_pepper);
olive = (CheckBox) findViewById(R.id.olive);
extra_cheese = (CheckBox) findViewById(R.id.extra_cheese);
small = (RadioButton) findViewById(R.id.small);
medium = (RadioButton) findViewById(R.id.medium);
large = (RadioButton) findViewById(R.id.large);
sumit = (Button) findViewById(R.id.submit);
sumit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
calculate...
By purchasing this solution you'll be able to access the following files:
Solution.zip.