Write an android phone program such that an instance of


Programming Assignment

1. Write an Android phone program such that an instance of each class: TextView, Button, EditText, CheckBox, RadioGroup with two RadioButtons, ImageView, ImageButton, and Spinner with three items will be displayed on an AVD. A sample run of your program is as follows.

2. Write an Android phone program such that one instance of EditText, one instances of Button, one instance of TextView, and another instance of EditText are displayed vertically on the AVD. The users of your program will be asked to input a positive integer in the first instance of EditText. When the users click the button instance, the product of integers from 1 to n will be displayed in the second instance of TextView and a triangular pattern consisting of s will be displayed in the second instance of the EditText. For instance, if n = 3, the product should be 6 and the pattern should be

$ $ $
$ $
$.

The beginning of the program run is as follows.

A sample run of the program is as follows.

3. Write an Android phone program such that one instance of Button with text "Fahrenheit -> Celsius", one instance of EditText with text "Input a value in Fahrenheit:", one instances of TextView with text "The corresponding value in Celsius is :", another instance of Button with text "Celsius -> Fahrenheit", another instance of EditText with text "Input a value in Celsius:", and another instances of TextView with text "The corresponding value in Fahrenheit is :" are displayed vertically on the AVD. The users of your program will be asked to input a number for a value in Fahrenheit in the first instance of EditText. When the users click the first instance of Button, the corresponding value in Celsius will be displayed on the first instance of TextView. The users of your program will be also asked to input a number for a value in Celsius in the second instance of EditText. When the users click the second instance of Button, the corresponding value in Fahrenheit will be displayed on the second instance of TextView. Notice that Celsius = 5*(Fahrenheit - 32)/9 or Fahrenheit = 9*Celsius/5 + 32.

The beginning of the program run is as follows.

A sample run of the program is as follows.

4. Write an Android phone program such that three instances of EditText with respective texts "Input the first positive integer", "Input the second positive integer", and "Input the third positive integer", one instances of Button with text "Right Triangle?", and one instance of TextView are displayed vertically on the AVD. The users of your program will be asked to input a positive integer in the first instance of EditText, a positive integer in the second instance of EditText, and a positive integer in the third instance of EditText. When the users click the button instance, the answer (either "yes" or "no") for the question that the three input integers can the lengths of three edges of a right triangle will be displayed in the instance of TextView. In addition, if the answer is "yes", the area of the right triangle should also be displayed.
The beginning of the program run is as follows.

A sample run of the program is as follows.

Another sample run of the program is as follows.

5. Write an Android phone program such that one instance of EditText with text "Input a positive integer", one instances of Button with text "Click here to get outputs", and four instances of TextView with respective texts "Decide if the input number is a prime: ", The number of digits in the input number is: ", "The sum of the digits in the input number is: ", and "The product of the digits in the input number is: "are displayed vertically on the AVD. The users of your program will input a positive integer. After the users click the button, the information for the input integer will be displayed in the corresponding four instances of TextView.

The beginning of the program run is as follows.

A sample run of the program is as follows.

Another sample run of the program is as follows.

6. Write an Android phone program that has six rows of widgets.

The first row has one instance of EditText with text "Num 1", one instance of TextView with text "/" (representing division operation), one instance of TextView with text "Num 2", one instance of TextView with text "=", and one instance of EditText with text "Quotient".

The second row has one instance of EditText with text "Num 1", one instance of TextView with text "%" (representing remainder operation), one instance of TextView with text "Num 2", one instance of TextView with text "=", and one instance of EditText with text "Remainder".

The third row has an instance of Button with text "Start or Restart".

The fourth row has an instance of Button with text "Check Your Answers".

The fifth row has an instance of TextView with text "Quotient is correct or incorrect".

The sixth row has an instance of TextView with text "Remainder is correct or incorrect".

The users of your program will click the button with text "Start or Restart" in the third row.

Then a random integer i with 0 ≤ i ≤ 99 will be set into the two instances of EditText with text "Num 1" in the first and second rows and a random integer j with 1 ≤ j ≤ 99 will be set into the two instances of EditText with text "Num 2" in the first and second rows.

The users of your program will input his or her answers for the integer division and remainder operations for the two randomly generated numbers.

The users of your program will click the button with text "Check Your Answers" in the fourth row. Depending the correctness (or incorrectness) of the answers from the users, the corresponding information will be displayed in the two instances of TextView in the fifth and sixth rows.

Also, during the program run, when the users click the button with text "Start or Restart" in the fourth row, a new pair of integers should be generated and set into the corresponding instances of EditText in the first and second rows.

The beginning of the program run is as follows.

A sample run of the program is as follows.

Another sample run of the program is as follows.

A sample run of the program is as follows.

The last sample run of the program is as follows.

A sample run of the program showing another pair of integers is generated is as follows.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Write an android phone program such that an instance of
Reference No:- TGS02500046

Expected delivery within 24 Hours