An open API service indexing awesome lists of open source software.

https://github.com/balikuddembe/spring_calculator_app

Using Spring to design a calculator App
https://github.com/balikuddembe/spring_calculator_app

Last synced: 3 months ago
JSON representation

Using Spring to design a calculator App

Awesome Lists containing this project

README

        

# Spring_Calculator_App
Using Spring to design a calculator App

Create a Spring application named spring-calculator to create a calculator app.

Create the main package com.spring.projects.calculator under the project src folder. All the code files should be contained in this package. You may create relevant sub-packages under this main package.

Create a sub-package beans.arithmeticoperations under the main package. Create a class called BasicArithmeticOperations that has two data members num1 and num2 and four non-parameterized methods called add, subtract, multiply, and divide to perform addition, subtraction, multiplication, and division of two numbers respectively. The functions will print their result and throw exceptions wherever required. Include getters and setters and the toString method.

Configure the bean using XML-based configuration to provide the values of num1 and num2.

Create the driver class MainApp under the main package. In the driver class, have a switch-case to call the respective function of the calculator depending on user input.

Submissions:

=>Bean class definition
=>MainApp definition
=>XML configuration
=>Output screenshot [OPTIONAL]