0% found this document useful (0 votes)
12 views2 pages

Paral Files Computer Programming

The document outlines a project for creating a basic calculator in Java using nested if/else statements to perform arithmetic operations such as Addition, Subtraction, Multiplication, Division, and Modulo. It describes the algorithm for taking user input and processing it to display the result. An example output is provided, demonstrating the calculator's functionality with specific inputs.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

Paral Files Computer Programming

The document outlines a project for creating a basic calculator in Java using nested if/else statements to perform arithmetic operations such as Addition, Subtraction, Multiplication, Division, and Modulo. It describes the algorithm for taking user input and processing it to display the result. An example output is provided, demonstrating the calculator's functionality with specific inputs.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

MCO1 – ITE 2

Computer Programming 1

SUBMITTED BY

PARAL, DARWIN F.
BSEMC 1 - A

MARTIN CARAUSOS BAZA


SUBJECT INSTRUCTOR

College of Computing Information Sciences


Bachelor of Sciences in Entertainment and Multimedia Computing
MCO1 – ITE 2 Computer Programming 1
Problem

Create a basic calculator in java using the nested if/else statements which can perform
operations like Addition, Subtraction, Multiplication, Division, and Modulo of any two
numbers.
Algorithm

1. The code uses Scanner to take two numbers and an operator as input from the user.
[Link] code uses if/else if/else statements to implement the logic for different operations
based on the entered operator.
3. The double result = 0.0; line initializes a variable to store the answer.
4. [Link]("Result: " + result); prints the result.
OUTPUT:

Let’s see the output of what our calculator will look like –
Enter the two numbers: 4 , 4
Choose and Enter the type of operation you want to perform (+, -, *, /, %) : -
Your Answer is = 0
CODE:

You might also like