Professional Documents
Culture Documents
Package: "Mass Fraction of A: " "MW of A: " "MW of B: "
Package: "Mass Fraction of A: " "MW of A: " "MW of B: "
/*
* To change this license header, choose License Headers in
Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package _molefraction;
/**
*
* @author user6
*/import java.util.Scanner;
public class _MoleFraction {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner input= new Scanner (System.in);
double mA, nA, nB, MWA, MWB ;
nA= (((mA/MWA)/((mA/MWA)+(1-mA/MWB))) ;
;
;
nB= 1-nA
System.out.printf("mole fraction of B: "+"%5f",nB);
}
}