-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHw1prob15.java
More file actions
23 lines (20 loc) · 1.11 KB
/
Hw1prob15.java
File metadata and controls
23 lines (20 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//CSC110
//Professor Scheiman
//Jairo Molina
//Spring 2018
package hw1prob15;//DELETE THIS line if the program is not working.
import java.util.Scanner;//imports the java utility Scanner
public class Hw1prob15 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);//classifies Scanner utility under the variable scan.
double totalShares = 600;//creates variable type double
double pricePerStock = 21.77;//creates variable type double
double totalStockAlone = totalShares * pricePerStock;//creates algorithm
double comission = 0.02;//creates comission inside a double variable
double totalStockWith = totalStockAlone * comission;//creates double with algorithm
double finalTotal = totalStockWith + totalStockAlone;//creates double with algorithm
System.out.println("Amount paid before comission: $"+totalStockAlone);////////////
System.out.println("Amount of comission: " +totalStockWith);//////FINAL RESULT////
System.out.println("Amount after comission: $"+finalTotal);///////////////////////
}
}