Skip to content

Assignment I was given,kindly give me both the XML code to build the app interface and the java code to execute it #212

@Benorina1

Description

@Benorina1

a)Design the following activity interface.
IMG_20240328_104658.jpg

Write code to ensure that the quantity of each item bought does not exceed 4. If it does, a toast message should display the message: “You cannot buy more than 4 items”. Similarly, if no quantity value is provided, a toast message should display the words “You must enter quantity”

Write code to show the total amount spent on each item and the grand total. In this case, you can hard code the unit price. The quantity is typed on the interface.

Write a method that has two parameters namely the grand total and the discount percentage. The method should apply the discount on the grand total and display the discount amount on the edittext labelled DISCOUNT and the net amount paid on the edittext labelled NET PAY. In order to earn all marks for this question ensure you test all discount cases and provide a screenshot of the activity showing the discounted amount and the NET PAY in each case.
Use the following discount criteria:

IMG_20240328_104912.jpg

NOTE: Except part a), all the other tasks should be achieved when the button labelled CALCULATE is clicked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions