Question
These exercises use the skills learned in Chapters 1, 2, 7, 8, and 9 of the textbook. Using Android Studio, Create a new project named
These exercises use the skills learned in Chapters 1, 2, 7, 8, and 9 of the textbook.
Using Android Studio, Create a new project named FirstName LastName Programming Practice (e.g., Jane Doe Programming Practice) using the Empty Activity template and Java as the programming language. For each exercise, add a button with the button text as the question number and question# (e.g., question1, question2, etc.) as the onClick attribute. Wire up the button. When the button is clicked, the actions for that question should be performed. All output should be printed to the logcat and to the user via a separate method you create and call for each question.
- Print Hello World.
- Greet a user with their name. Note: create a variable for the users name and hard code a fake users name to that variable.
- Modify the previous program such that only the users Alice and Bob are greeted with their names.
- Print the sum of the numbers 1 to n. Note: hard code n for testing purposes.
- Modify the previous program such that only multiples of three or five are considered in the sum, e.g. 3, 5, 6, 9, 10, 12, 15 for n=17.
- Hard code a choice from the user to compute the sum or the product of 1,,n., and output the result of the computation.
- Print a multiplication table for numbers up to 12.
- Print all prime numbers up to n.
- Print the next 20 leap years.
- Print only the odd numbers from 1 to n.
Export the project to a zip file (File > Export to Zip File) and attach link.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started