0% found this document useful (0 votes)
24 views10 pages

Mobile Tech Exam Guide

The document describes the design of a mobile app for ordering pizza. It includes the XML layout and Java code for the app. The layout has sections for selecting pizza, drinks and buttons to calculate the total and cancel. The code finds the UI elements and calculates the total cost based on the selected items.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views10 pages

Mobile Tech Exam Guide

The document describes the design of a mobile app for ordering pizza. It includes the XML layout and Java code for the app. The layout has sections for selecting pizza, drinks and buttons to calculate the total and cancel. The code finds the UI elements and calculates the total cost based on the selected items.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

UNIVERSIDAD CATÓLICA SANTA MARÍA

CURSO: TECNOLOGIAS MOVILES


DOCENTE

ESTUDIANTE:

CUI

ESCUELA PROFESIONAL DE INGENIERÍA DE SISTEMAS

SEMESTRE:

AREQUIPA - PERÚ
2022
EXAMEN TECNOLOGIAS MOVILES

En esta sección ponemos nuestro nombre en la página de inicio, el nombre de nuestra


pizzería y da la opción de que sea para recoger o delivery.

En esta sección, colocamos imágenes de pizzas que se pueden seleccionar mediante casillas
de verificación y sus respectivos precios para marcar según las preferencias del cliente.

En la tercera parte, seleccionamos las bebidas de la misma manera que seleccionamos las
pizzas con casillas de verificación y sus respectivos precios.
Finalmente, en la última parte, agrega casillas de verificación marcadas, y si el cliente
cometió un error, hay un botón de cancelar para que pueda volver a verificar,
Una vez marcado el elemento, creará la suma de los importes marcados para llegar al
importe total a pagar.
XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/colo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">

<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoText="false"
android:background="@color/purple_700"
android:backgroundTint="#9A94D6"
android:gravity="center"
android:text=
android:textSize="30" />

<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Elija su pedido:"
android:textSize="20sp" />

<RadioGroup
android:layout_width="416dp"
android:layout_height="35dp">

<LinearLayout
android:layout_width="415dp"
android:layout_height="match_parent"
android:orientation="horizontal">

<RadioButton
android:id="@+id/radioButton"
android:layout_width="219dp"
android:layout_height="wrap_content"
android:text="Para recojer" />

<RadioButton
android:id="@+id/radioButton2"
android:layout_width="193dp"
android:layout_height="wrap_content"
android:text="Delivery" />
</LinearLayout>

</RadioGroup>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="210dp"
android:orientation="vertical">

<TextView
android:id="@+id/textView5"
android:layout_width="match_parent"
android:layout_height="32dp"
android:gravity="center"
android:text="Pizza"
android:textColor="#EBDCC010"
android:textSize="24sp" />

<ImageView
android:id="@+id/imageView4"
android:layout_width="match_parent"
android:layout_height="117dp"
app:srcCompat="@drawable/captura_de_pantalla_2022_04_21_110330"
/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="29dp"
android:orientation="horizontal">

<CheckBox
android:id="@+id/checkBox01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Margarita S/. 60" />

<CheckBox
android:id="@+id/checkBox02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Neoyorquino S/. 65" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="29dp"
android:orientation="horizontal">

<CheckBox
android:id="@+id/checkBox03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Italiana S/. 50" />

<CheckBox
android:id="@+id/checkBox14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Hawaiana S/. 58" />
</LinearLayout>
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="225dp"
android:orientation="vertical">

<TextView
android:id="@+id/textView5"
android:layout_width="match_parent"
android:layout_height="31dp"
android:gravity="center"
android:text="Bebidas"
android:textColor="#EBDCC010"
android:textSize="24sp" />

<ImageView
android:id="@+id/imageView5"
android:layout_width="353dp"
android:layout_height="129dp"
android:layout_gravity="center"
app:srcCompat="@drawable/bebidas" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:orientation="horizontal">

<CheckBox
android:id="@+id/checkBox01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Chicha morada S/. 8" />

<CheckBox
android:id="@+id/checkBox02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Gaseosa S/. 12" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="35dp"
android:orientation="horizontal">

<CheckBox
android:id="@+id/checkBox03"
android:layout_width="148dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Agua S/.2" />

<CheckBox
android:id="@+id/checkBox14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Cerveza S/. 8" />
</LinearLayout>
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="97dp"
android:orientation="vertical">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="39dp"
android:orientation="horizontal">

<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="CALCULAR"
tools:ignore="TouchTargetSizeCheck,TouchTargetSizeCheck" />

<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="CANCELAR" />
</LinearLayout>

<TextView
android:id="@+id/textView10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Deuda total:"
android:textColor="#EA1212"
android:textSize="20sp" />

<Spinner
android:id="@+id/spinner2"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>

Java
package com.example.caso;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.RadioButton;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity{


RadioButton dom;
CheckBox op1, op2, op3, op4, op5, op6, op7, op8;
Button bcalcular, bcancelar;
TextView ttotal

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

dom = findViewById(R.id,rbdomicilio);
op1 = findViewById(R.id,op1p);
op2 = findViewById(R.id,op2p);
op3 = findViewById(R.id,op3p);
op4 = findViewById(R.id,op4p);
op5 = findViewById(R.id,op1b);
op6 = findViewById(R.id,op2b);
op7 = findViewById(R.id,op3b);
op8 = findViewById(R.id,op4b);

ttotal=findViewById(R.idttotal);

}
public void calcular (Viev viev)
{
double total= 0.0;
if (dom.isChecked())
total = total + 10;
if (op1.isChecked())
total = total + 60;
if (op2.isChecked())
total = total + 65;
if (op3.isChecked())
total = total + 50;
if (op4.isChecked())
total = total + 58;
if (op5.isChecked())
total = total + 8;
if (op6.isChecked())
total = total + 12;
if (op7.isChecked())
total = total + 2;
if (op8.isChecked())
total = total + 8;

ttotal.setText("Tatal:" + total);
}
public void cancelar (View v)
{
dom.setChecked(false);
op1.setChecked(false);
op2.setChecked(false);
op3.setChecked(false);
op4.setChecked(false);
op5.setChecked(false);
op6.setChecked(false);
op7.setChecked(false);
op8.setChecked(false);

ttotal.setText("Total=0");
}
Java

En esta apartado de o digo se define los valores que vamos a utilizar y damos nuevas
variables para el uso que daremos mas adelante.
En esta parte se va a poner los valores de dinero a los Cherkboton con sus respectivos
precios.
Este apartado se utiliza para calcular el valor total de lo comprado.

You might also like