Skip to content

Instantly share code, notes, and snippets.

@nickpettican
Created November 13, 2015 15:32
Show Gist options
  • Save nickpettican/e07bb070992876477c95 to your computer and use it in GitHub Desktop.
Save nickpettican/e07bb070992876477c95 to your computer and use it in GitHub Desktop.
Java Session01
package session01;
import java.util.Scanner;
public class calc {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
double mol, mass, result;
System.out.println("Please enter molar concentration (mol/L):");
mol = keyboard.nextDouble();
System.out.println("Please enter molar mass (gr):");
mass = keyboard.nextDouble();
result = mol*mass;
System.out.println("The mass concentration is: " + result + " g/L");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment