Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

BY JAVA In this question, you develop a simple calculator app. A skeleton project, called Calculator, is provided to you. Complete the app according to

BY JAVA

In this question, you develop a simple calculator app. A skeleton project, called Calculator, is provided to you. Complete the app according to the following screenshots and requirements.

image text in transcribed

  1. Modify the default/portrait activity_main.xml layout (included in the skeleton project) to add the 17 buttons (0, 1, ..., 9, . the dot, =, +, -, *, /, C) under the output display.

  2. Create a new activity_main.xml landscape layout that contains the same components in the default layout (with the same IDs).

  3. In the MainActivity class, modify the onCreate method as follows:

4

COMP S311 Assignment 03 (Autumn 2020)

o FillinthebuttonIDsintegerarraywiththeIDsofthe17buttons. o In the for-loop, find the button from the ID and set up the buttons click- listener. The click-listener puts the text (label) of the button to the CalculatorData (using the enter method), obtains the output of the CalculatorData (using the getOutput method), and displays the output

to the UI.

  1. Create an XML menu file; in the file, create an About options menu item and show

    it as an action item. You may use a built-in Android drawable resource as its icon. When the item is selected, an About dialog box appears to show your name and your student ID.

  2. Create three options menu items Large text size, Medium text size, and Small text size. These menu items are checkable, mutually exclusive, and in a group. They control the text size of the output display. To set the text size in code, you may use the constants SMALL_TEXT_SIZE, MEDIUM_TEXT_SIZE, and LARGE_TEXT_SIZE in the MainActivity class.

For simplicity, you may hard-code new strings in the programs, and dont need to use primary or alternative string resources for them. Submit one whole Android project that contains all your work for this question.

4.32 4.69 Calculator Cara 1.23456 1.23456 7 8 9 C 4 5 6 1 7 8 9 ! 0 * 1 2 3 + 11 4 5 6 * 1 2 2 3 - 0 = T Calculator Calculator Maciun teet size 0.44444444 4444 Smal sex 0 About Chan Tai Mar ID: 12345678 7 8 9 / 4 5 6 * 1 2 2 3 1 2 3 0 II 0 4.32 4.69 Calculator Cara 1.23456 1.23456 7 8 9 C 4 5 6 1 7 8 9 ! 0 * 1 2 3 + 11 4 5 6 * 1 2 2 3 - 0 = T Calculator Calculator Maciun teet size 0.44444444 4444 Smal sex 0 About Chan Tai Mar ID: 12345678 7 8 9 / 4 5 6 * 1 2 2 3 1 2 3 0 II 0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions

Question

5. Our efficiency focus eliminates free time for fresh thinking.

Answered: 1 week ago