COM413: Mobile Application Development Practical Workbook 1 Guidance

Published: 05 Feb, 2025
Category Assignment Subject Programming
University Ulster University Module Title COM413: Mobile Application Development

Question 1. Variables and Data Types

Create a new class and hard code the following five variables:

Name (use an initial and surname), Age, Salary and“isEmployed”.

Each variable must use a differentDataTypeto store each variable, print the following statement using variables:

“J Smithis 25 years old, is currently employedand has a salary of£21,000 per year.”

Modify the code to accept user input for each variable. These are indicated as bold.
Use the scanner class: Scanner scanner= new Scanner(System.in);

Question 2. Basic Arithmetic

Create a new class and hard code the following:

int a, int b, sum, difference, product and quotient.

Sum = a + b, difference = a – b, product = a x b and quotient is a/b.

Using the values: a = 10 and b = 5

Print the results as: 
Sum: 15
Difference: 5
Product: 50
Quotient: 2.0

Modify the code to accept user input for each value and allow the user to specify their choice of arithmetic.

Question 3. Conditional Statements

Create a new class which will check if a value is odd or even and will print the result.

Use the modulus operator (num % 2 == 0) to check if the value is odd or even.

You can hard code the num value to check if it works and then upgrade your code to use the Scanner class so the user can input a number.

Modify the code to ask the user if they want to continue entering numbers using Y/N and based on the answer allow the user to enter more numbers.

Question 4. Loops

Create a new class which will Print numbers from 1 to 10 using a while loop.

This is called a conditional loop.

Now, print numbers from 1 to 10 using a for loop.

This is called an unconditional loop.

Conditional looping: Computation continues indefinitely until the logical condition is true. Unconditional looping: The number of repetition known in advance or repetition is infinite.

Now, iterate through this array using a for-each loop:
String[] fruits = {"Apple", "Banana", "Orange", "Grapes"};

Modify this code so that you populate a list of movies, from the user using a loop and then print these films in a list using a for-each loop.

Question 5. Methods

Create a new class, within this class you will have a method which will take two numbers as parameters and return the sum of these values.

Again, you can hard code to test, but use the Scanner class to ask the user for two values. Print the result as such:
Enter a value for A:

5
Enter a value for B:
8
Sum: 13
Modify the code and add a subtract method, product method and quotient method.

Question 6. String Manipulation

Create a new class, use the scanner to ask the user for their name. Once the user inputs their name perform the following functions to retrieve the following information:

Enter your name: Person

Hello, Person

Length: 6
Uppercase: PERSON
Lowercase: person
Reverse: nosrep
Contains '@': false

Note: if you store the name as a String Variable, it becomes an object, you can perform a number of actions on the string by calling the appropriate method, simply type the name of the variable e.g. name and then enter a full stop, this will give you a list of methods. Methods are performed on objects.

Question 7. Objects – 10 marks

Create a new class, and enter the following code:

public class Practical7 {
    public static void main(String[] args) {

    }
}
    class Person {
        String name;
        int age;

        void introduce() {
            System.out.println("Hello, my name is " + name + " and I am " + age + " years old.");
        }
}

Within this project, a new class is introduced. This class allows objects to be created. Objects allow us to use the same code to create similar objects but with different types. Using people as an example, we create a class Person, we use two variables name and age to store each individuals information. We then use a constructor to create a new instance of a class and use the methods contained within that class to simplify the creating a new person.

Complete the code so the following information will be shown:

Hello, my name is Alice and I am 30 years old.

Hello, my name is Bob and I am 25 years old.

Next use the scanner class and create a new person:

Hello, my name is Alice and I am 30 years old.

Hello, my name is Bob and I am 25 years old.

Enter name:

George

Enter age: 

23

Hello, my name is Person and I am 53 years old.

Question 8. Basic Calculator

Create a new class. This practical requires you to create a basic calculator, which should look something like this:

Calculator Application
1. Add
2. Subtract
3. Multiply
4. Divide
5. Exit

Enter your choice:

The application should use a while loop and a switch case statement. While the user doesn’t enter the number five, the application will run again, to exit the program the user will enter the number five. There should be code to stop the user dividing by zero and inputting a number that isn’t an option.

Question 9. Shapes Calculator

Create a new class. This practical requires you to create a shapes calculator that prompts the user to input a shape (square, rectangle, triangle, or circle) and calculates the area and perimeter for each shape using separate methods. Here are the formulas used to calculate the area, and in the case of the square and rectangle, the perimeter.

Question 9. Shapes Calculator

Question 10. Binary to Decimal converter

Create a program which prompts the user to input a binary number and then converts it to its decimal equivalent using the binary-to-decimal conversion method.

a. Binary values can be read as an array of 1s and 0s. 1 in the array is represented as the value in the top line. Write a program which will take a 4-bit code and calculate the decimal equivalent. The numbering system is below:Question 10. Binary to Decimal converter

For example: a binary code of 1111 would be equal to 8+4+2+1 = 15. 

b. Scale this up to 8 bits.
Scale this up to 8 bits.

For example: 00110011 would equal 32+16+2+1 = 51.

The binary here isn’t important, you are looking through the array and using the 1s and 0s to give you a corresponding value. 

 

Need help with your COM413: Mobile Application Development Practical Workbook 1 at Ulster University? Get the best programming assignment help in UK to fulfill your requirements. Whether you're stuck with some coding work or need someone to explain some complicated mobile app development concept, we are here to help. Our team of experts holding PhD ensures that each and every assignment is written uniquely and accurately. And, we give free samples to help you out. Trust our assignment writing service for high-quality, plagiarism-free content every time. Let us make your assignments easier!

Workingment Unique Features

Hire Assignment Helper Today!


CMA3005 – Introduction to Construction Management L3 Assessment Guide

CMA3005 Individual Report: The project involves converting the existing library at GBS into large seminar rooms to support growing student numbers.

CET255 Developing A Smart Greenhouse Monitoring System Prototype Assessment Brief

CET255 – IoT & Robotics Assessment: The aim of this assessment is to provide you with an opportunity to demonstrate your understanding and practical skills in IoT and Robotics.

ICM218 Research Project Assignment Brief 2024-25 | UoR

The Research Project almost always involves the analysis of data. At the start, each student is allocated an academic supervisor who offers advice on their Research Project.

Heisenberg Uncertainty Principle and de Broglie Equation 2024-25

Physics helps us understand the laws that govern our universe. Among the most fascinating areas of modern physics are the Heisenberg Uncertainty Principle and the de Broglie Equation.

SWSP6153 Indigenous Social Work 2025T2 | ACAP

This unit will introduce students to the diversity of the social, cultural and political situation in which Aboriginal and Torres Strait Islander people live. Indigenous Knowledge and practice as a new framework for working effectively.

771762 Assignment: Big Data and Data Mining Project Report 2025

771762 Assignment Task: Your task is to advise the DfT (and any other relevant UK Gov department) on the policy changes/interventions required to improve road safety, as well as to create a model that would predict such accidents and the injuries that people may incur.

MKT62304 Marketing Analytics Group Assignment Task | Taylor's

MKT62304 Group Assignment Task: This assignment aims to assess the role and effectiveness of marketing analytics in the water and SME sectors, focusing on how data-driven approaches can achieve strategic objectives and desired outcomes.

CST4530 Security Solutions and Applications Module Handbook 2024-25 | MUL

This module covers the concepts and critical issues of security with an emphasis on security architecture and mechanisms, standards, protocols, solutions, and applications. It aims to provide students with an understanding of security technologies, algorithms, and solutions.

UMSD87-15-3 Business Innovation and Growth Module Handbook 2024-25 | UWE

We aim to increase your knowledge and understanding of these three themes and of the theories and concepts that surround them, to provide you with some subject-specific and transferable skills.

BTC 3150 Taxation Law Assignment Questions S1, 2025 | Monash University

Part One: Short Answer Questions worth a total of 14 marks;  Part Two: Problem Style Question worth a total of 6 marks; and  Part Three: Problem Style Question (that includes some calculations) worth a total of 10 marks.

Online Assignment Help in UK