Skip to content

Commit f6fa33c

Browse files
authored
Create CalculatorBasic.md
1 parent 7cb3ed8 commit f6fa33c

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

CalculatorBasic.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Lab 3 Basic Calculator
2+
## Instructions:
3+
- OPEN BlueJ,
4+
- CREATE a new BlueJ project titled CalculatorAPP in your Computer Science folder (H:\Computer Science),
5+
- CREATE and open a new class,
6+
- DELETE BlueJ's starter code, and
7+
TYPE in our code skeleton:
8+
```
9+
//Name:
10+
//Period:
11+
12+
import java.util.*;
13+
public class CalculatorAPP
14+
{
15+
public static void main(String[] args)
16+
{
17+
Scanner console = new Scanner(System.in);
18+
//code goes here
19+
}
20+
}
21+
```
22+
23+
## Calculator APP
24+
Write a program that will create a text-based calculator app. First, print a text-based "menu" to the console (screen) that will show users the choices of operations, like the following:
25+
```
26+
1 – addition (+)
27+
2 – subtraction (-)
28+
3 – multiplication (*)
29+
4 – division (/)
30+
5 – modulus (%)
31+
```
32+
33+
`Enter the number of your desired operation from the menu above >>> 1`
34+
- Save the user's choice into an integer variable called operation. After the user chooses the desired operation, ask them to input the values for the calculation:
35+
36+
```
37+
Enter first number >>> 2
38+
Enter second number >>> 4
39+
```
40+
- Finally, print out the variables and the result of the calculation (based on which operation was selected):
41+
42+
`2 + 4 = 6`
43+

0 commit comments

Comments
 (0)