Min Thukha Kyaw (Assignment 1)
Min Thukha Kyaw (Assignment 1)
Learner’s ID No : RF37178
Unit No :1
Assignment No : 1 of 3
1
Table of Contents
1. Algorithm................................................................................................................................................................ 3
1.1 Explanation of algorithm.........................................................................................................................................3
1.2 Outline of the Process in Building an application:................................................................................................3
1.3 how does the algorithm work?...............................................................................................................................5
1.4 Example of Algorithm for a Simple Calculator:......................................................................................................5
1.5 Determine the steps taken from writing code to execution......................................................................................6
1.6 Analyses the process of writing code.......................................................................................................................8
1.7 Process of writing code Calculator..........................................................................................................................9
1.8 relationship between the written algorithm and the code variant..........................................................................10
References........................................................................................................................................................................12
2
1. Algorithm
An algorithm is a method for doing calculations or finding solutions to issues. Algorithms are
precise instructions that carry out preset activities consecutively in either hardware- or software-
based routines. (Anon., 2021)
Building an application involves several stages, from conceptualization to development, testing, and
deployment. Here is an outline of the process:
Clearly define the problem or need that the application will address. Understand the
requirements, constraints, and objectives.
Conceptualization:
Brainstorm ideas and concepts for the application's functionality and user interface. Create a
high-level overview or concept document.
Requirements Gathering:
Collect detailed requirements from stakeholders and end-users. Document functional and
non-functional requirements.
Design:
Create a detailed design of the application, including user interfaces, data structures, and
system architecture. Consider user experience (UX) and user interface (UI) design. Develop
wireframes, mockups, or prototypes.
Planning:
3
Create a project plan, including timelines, milestones, and resource allocation. Define the
technology stack and development tools to be used.
Development:
Write the code for the application based on the design and requirements. Follow best coding
practices and coding standards. Implement features, algorithms, and data storage.
Testing:
Perform various types of testing, including unit testing, integration testing, and user
acceptance testing (UAT). Identify and fix bugs and issues. Ensure the application meets the defined
requirements.
Deployment:
Prepare the application for deployment to the target environment (e.g., servers, app stores).
Set up databases, servers, and hosting infrastructure. Deploy the application to production or release
it to end-users.
Implement monitoring and logging to track the application's performance and user
interactions. Provide ongoing maintenance, bug fixes, and updates. Monitor user feedback and
address issues promptly.
If applicable, provide training to end-users on how to use the application effectively. - Offer
user support and address user inquiries or problems.
Documentation:
Document the application's architecture, codebase, and user manuals. - Maintain up-to-date
documentation for future reference.
Ensure that the application complies with security standards and regulations. - Implement
security measures to protect user data and the system.
Use version control systems (e.g., Git) to manage code versions and collaborate with team
members. - Follow a structured development workflow.
Gather feedback from users and stakeholders. - Iterate on the application based on feedback
to improve usability and functionality.
4
Quality Assurance:
Maintain code quality through code reviews and automated testing. - Enforce coding
standards and conduct code inspections.
Release updates and new versions of the application as needed. - Distribute the application
through appropriate channels (e.g., app stores, web deployment).
Post-Release Evaluation:
Evaluate the application's performance and user satisfaction post-release. - Identify areas for
further improvement and prioritize enhancements.
Ensure the application complies with legal and regulatory requirements (e.g., data protection
laws).
Retirement or Decommissioning:
Plan for the eventual retirement or decommissioning of the application when it reaches the
end of its lifecycle.
Continuous Learning:
Stay updated with emerging technologies and best practices in application development.
Building an application is an iterative and collaborative process that involves careful planning,
development, testing, and ongoing maintenance. Effective communication with stakeholders and
end-users is crucial throughout the entire lifecycle of the application.
5
computational instructions for an algorithm. An output is created once the computation is finished.
(Anon., 2021)
Step 1. Start
Addition (+)
Subtraction (-)
Multiplication (*)
Division (/)
Step 4. Prompt the user to select an operation by entering the corresponding operator or "Exit" to
quit.
For division, check if num2 is not zero, then set result to num1 / num2. If num2 is zero, display an
error message (division by zero).
6
Display the result of the calculation.
Step 8. End
This algorithm outlines the basic steps for creating a simple calculator application. I would need to
implement this algorithm in my chosen programming language, taking care of input validation and
error handling along the way.
1.5 Determine the steps taken from writing code to execution
The steps from writing code to the execution of a program based on the provided algorithm are as
follows:
Writing Code:
Develop the program logic and functionality in a programming language of choice (e.g., Java,
Python).
Code Compilation/Interpretation:
Compile the code (for compiled languages like Java) or interpret it (for interpreted languages like
Python) to create an executable program.
Execution:
Run the compiled/interpreted program. This can be done through a command line or an integrated
development environment (IDE).
Initialization of Variables:
At the start of the program, the variables num1, num2, result, and operator are initialized.
Display Menu:
The program displays a menu to the user, listing available operations (addition, subtraction,
multiplication, division, and exit).
User Interaction:
The user interacts with the program by selecting an operation from the menu or choosing to exit.
User Input:
If the user selects an operation, the program prompts the user to input two numbers (num1 and
num2).
Calculation:
7
Based on the selected operator, the program performs the corresponding calculation:
For division, it checks if num2 is not zero and sets result to num1 / num2. If num2 is zero, it displays
an error message for division by zero.
Display Result:
Loop:
Program Termination:
When the user selects "Exit," the program terminates, and control returns to the operating system.
During the development and execution process, the program should be thoroughly tested with
different inputs to ensure it functions correctly.
Debugging tools and techniques can be used to identify and fix any issues.
Documentation:
Document the code with comments and provide any necessary user instructions or documentation.
If the program is intended for distribution, it can be deployed to the target environment or users.
Periodically update the program to address issues, add new features, or improve performance.
Use version control systems (e.g., Git) to manage code versions and collaborate with team members.
Ensure that the program complies with security standards and regulations.
Gather user feedback and make iterative improvements to the program based on user needs and
issues encountered.
Conduct retrospectives to review the development process and identify areas for improvement.
Archiving:
Maintain archives of code versions and documentation for future reference and auditing.
These steps may vary depending on the specific programming language, development environment,
and project requirements. It's essential to follow best practices in software development to create a
reliable and maintainable application.
Analyzing the process of writing code for the provided algorithm (a simple calculator) and
potential challenges:
Initialization of Variables:
You need to declare and initialize variables like num1, num2, result, and operator to store user input
and calculation results.
Displaying a Menu:
You'll need to use Scanner or a similar mechanism to get user input for operator selection and the
two numbers.
Performing Calculations:
Based on the selected operator, perform the calculation and store the result in the result variable.
When division is chosen, check if num2 is zero to avoid division by zero errors. Handle this case
gracefully by displaying an error message.
9
Displaying the Result:
Use a loop (e.g., while or do-while) to allow the user to perform multiple calculations without
restarting the program.
Provide an option for the user to exit the calculator. You can use a loop control variable or the break
statement to exit the loop and end the program.
User Input Validation: Ensuring that user inputs are valid (e.g., numeric values for numbers, valid
operator selection) can be challenging. You may need to implement input validation and handle
exceptions.
Error Handling: Handling errors gracefully, especially division by zero, is important for a robust
calculator.
User Experience: Designing a user-friendly and intuitive menu and input process is crucial.
Testing: Thoroughly testing the calculator to ensure it works correctly for various inputs and edge
cases.
if (choice == 5) {
System.out.println("Exiting the calculator.");
break;
}
switch (choice) {
case 1:
operator = '+';
result = num1 + num2;
break;
case 2:
operator = '-';
result = num1 - num2;
break;
case 3:
operator = '*';
result = num1 * num2;
break;
case 4:
operator = '/';
if (num2 != 0) {
result = num1 / num2;
} else {
System.out.println("Error: Division by zero.");
continue;
}
break;
default:
System.out.println("Invalid choice. Please try again.");
continue;
}
System.out.println("Result: " + num1 + " " + operator + " " + num2 + " = " + result);
}
scanner.close();
}
}
1.8 relationship between the written algorithm and the code variant.
The Java code provided is an implementation of the algorithm for a simple calculator that you
outlined earlier. Let's evaluate the code and its relationship with the algorithm:
Initialization of Variables: In the code, you've declared and initialized variables num1, num2,
result, and operator to store user input and calculation results. This corresponds to the algorithm's
step of initializing variables.
Displaying a Menu: The code displays a menu with available operations using System.out.println(),
aligning with the algorithm's menu display.
11
User Input and Operator Selection: The code uses a Scanner to get user input for operator
selection and the two numbers, in line with the algorithm's prompt for user input.
Performing Calculations: Based on the selected operator, the code performs the calculation and
stores the result in the result variable. This matches the algorithm's calculation logic.
Error Handling for Division by Zero: The code checks if num2 is zero when division is chosen
and displays an error message if necessary, exactly as specified in the algorithm.
Displaying the Result: After performing the calculation, the code displays the result of the
calculation using System.out.println(). This corresponds to the algorithm's result display.
Loop for Repeated Calculations: The code uses a while loop to allow the user to perform multiple
calculations without restarting the program, just like the algorithm's repetition of steps.
Exiting the Calculator: The code provides an option for the user to exit the calculator using the
"Exit" menu item and the break statement to exit the loop, aligning with the algorithm's exit
condition.
The code closely follows the algorithm's steps and logic, making it a faithful implementation of the
provided algorithm for a simple calculator in Java. It demonstrates the relationship between the
written algorithm and the corresponding code variant, showing how the algorithm's logic is
translated into executable code.
12
References
Anon., 2018. Auxiliary View Its Types, Methods. [Online]
Available at: https://civilseek.com
[Accessed 01 March 2022].
Anon., 2021. studocu. [Online]
Available at: https://www.studocu.com/row/document/esoft-metro-campus/hnd-in-computing/p1-
pragramming-asessment-short-note/30499955
[Accessed 2022].
Anon., 2022. https://ccea.org.uk/downloads/docs/Support/AS%201%20Support/2019/Section%20D%3A
%20Fact%20Files%20-%20Design%20and%20Communication.pdf. [Online]
Available at: https://ccea.org.uk/downloads/docs/Support/AS%201%20Support/2019/Section%20D%3A
%20Fact%20Files%20-%20Design%20and%20Communication.pdf
Anon., 2022. https://doncorgi.com/blog/orthographic-drawing-examples/. [Online]
Available at: https://doncorgi.com/blog/orthographic-drawing-examples/
Anon., 2022. https://everythingwhat.com/what-are-pictorial-techniques. [Online]
Available at: https://everythingwhat.com/what-are-pictorial-techniques
Anon., 2022. https://studylib.net/doc/25296663/benefits-and-limitations-of-different-drawing-styles--1-.
[Online]
Available at: https://studylib.net/doc/25296663/benefits-and-limitations-of-different-drawing-styles--1-
Anon., 2022. https://www.civilclick.com/isometric-projection/. [Online]
Available at: https://www.civilclick.com/isometric-projection/
Anon., 2022. https://www.civilclick.com/isometric-projection/. [Online]
Available at: https://www.civilclick.com/isometric-projection/
Anon., 2022. https://www.tasstudent.com/pictorial-drawing/#:~:text=It%20is%20a%20method
%20of,traditional%20drawing%20equipment%20is%20needed. [Online].
Anon., 2022. https://www.tasstudent.com/pictorial-drawing/#:~:text=It%20is%20a%20method
%20of,traditional%20drawing%20equipment%20is%20needed. [Online]
Available at: https://www.tasstudent.com/pictorial-drawing/
Anon., n.d. Auxiliary Views. [Online]
Available at: https://cabarrus.k12.nc.us
[Accessed 01 March 2022].
Branoff, T. J., 2016. Interpreting Engineering Drawings. 8th ed. Australia: Cengage Drawing.
Tooley, M. & Dingle, L., 2002. BTEC NATIONAL ENGINEERING. 1st edition ed. Great britain: Newnes.
13
14