Hello everyone this is my first time in this forum. I'm a Computer Science student and I'm currently learning Android for the first time. I have some knowledge in Java, C++, HTML, XML.

I Need help programming this app.

-------------------------------------


Sales employees working at a given computer store are paid on weekly basis. Whenever the sales amount is over 300 dollars, the weekly salary amount is calculated based on the weekly total sales amount using the table below.

Sales amount Basic salary amount Bonus salary percent
[0, 300] 0 0%
]300, 1000] 400 10%
]1000, 5000] 600 5%
]5000, 10000] 900 1%

The formulas to compute the salary amount is:
Salary Amount = Basic Salary Amount + Bonus Salary Amount where
Bonus Salary Amount = Bonus Salary Percent * Total Sales Amount

For example, if the total sales amount is $ 1000.00 then the salary amount is
salary amount =400+1000*(0.10)=500.

Notice that any total sales amount less than zero or greater than 10000 is invalid. Whenever the total sales amount is from 0 to 300, prompt the user for the number of worked hours because sales employees are paid on hourly rate basis instead. In this case, hourly rate is $ 10.00 and the number of worked hours is from 0 to 60 else it is invalid. Notice that the regular number of worked hours is from 0 to 40 and, the number of hours over 40 is the number of overtime hours which is paid time and a half. In this case, the formulas to compute the salary amount are

salary amount = regular salary + overtime amount where
regular salary = regular number of worked hours* hourly rate

and

overtime amount = overtime hours*1.5*hourly rate

For example, if the total sales amount is $ 200.00 and the number of worked hours is 45,
regular salary = regular number of worked hours* hourly rate=40*10=400
overtime amount = overtime hours*1.5*hourly rate=5*1.5*10=75 and
salary amount = regular salary + overtime pay = 400+75=475

First, design an appropriate user interface to read from the keyboard both the name and the sales amount for several employees (one at a time). This interface should also show the buttons labelled as Compute, More and Show Report. Students can add others GUI components reasonably.

Once the design is done, write an Android application to display this user interface to read the appropriate input data for the first sales employee; and then,

Click the Compute button to compute and display ( in addition to the name, sales amount and number of worked hours) the user interface to the screen showing the overtime amount, basic amount, bonus percent, and salary amount for this employee,

Click the button More to repeat this process for more sales employees, as needed; and finally,

Click the button Show Report to display to the screen the report below (using this format and rounding) showing the weekly payroll for the all the sales employees together, delay the display; and finally, terminate the execution of this application.

Name SalesAmnt WorkedHours OvertimeAmnt BasicAmnt Bonus% SalaryAmnt

Kim 200.00 45 75.00 0.00 0 475.00
Tom 1000.00 40 0.00 400.00 10 500.00
Ted 2000.00 35 0.00 600.00 5 700.00

Total 120 1675.00.








This is what I first thought of doing:

1) make a static page where the user inputs: - his/her name
- Sales amount
- if the sales amount is less then 300$,
the user inputs number of worked hours

2) Make a XML page where it reads the information and outputs the report.



So far this is what I have as code:

In my XML file :

<RelativeLayout xmlns:

android:layout_width="match_parent"
android:layout_height="match_parent" >

<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="Enter Information"
android:textAppearance="?android:attr/textAppearanceLarge" />

<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="Worked Hours:"
android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textView3"
android:layout_alignBottom="@+id/textView3"
android:layout_alignParentRight="true"
android:layout_toRightOf="@+id/textView3"
android:ems="10" />

<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/editText1"
android:layout_alignRight="@+id/textView3"
android:layout_marginBottom="30dp"
android:text="Sales Amount:"
android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
android:id="@+id/editText3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/textView2"
android:layout_toRightOf="@+id/textView2"
android:ems="10" >

<requestFocus />
</EditText>

<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/textView2"
android:layout_alignParentLeft="true"
android:layout_marginBottom="22dp"
android:text="Name:"
android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
android:id="@+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/textView4"
android:layout_toRightOf="@+id/textView2"
android:ems="10" />

<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignRight="@+id/textView1"
android:layout_marginBottom="70dp"
android:text="More" />

<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/button1"
android:layout_alignBottom="@+id/button1"
android:layout_alignParentLeft="true"
android:text="Compute" />

<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/button1"
android:layout_alignBottom="@+id/button1"
android:layout_toRightOf="@+id/button1"
android:text="Show Report" />

</RelativeLayout>




In my Java file:

package com.example.RHpackage;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

public class RHActivity extends Activity {

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

@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_rh, menu);
return true;
}
}





Please help, I will keep updating my thread every time I update my code.

Thank you!