Love calculator
I hope most of you ceans
must use love calculator to calculate love percentage
here I am posting a code in java that will calculate love percentage
with your partner
//Program to calculate Love percentage
must use love calculator to calculate love percentage
here I am posting a code in java that will calculate love percentage
with your partner
//Program to calculate Love percentage
import java.io.*; class Love { public static void main(String args[]) { try { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("Please enter name of boy"); String s1=br.readLine(); System.out.println("Please enter name of girl"); String s2=br.readLine(); int sum=0,sum2=0; for(int i=0;i<s1.length();i++) { char ch=s1.charAt(i); int ascii=ch; sum=sum+ascii; } for(int i=0;i<s2.length();i++) { char ch=s2.charAt(i); int ascii=ch; sum2=sum2+ascii; } int total=sum+sum2; int lovepercentage=total%100; System.out.println("love between "+s1+" and "+s2+" is "+lovepercentage+"%"); } catch(Exception e) { System.out.print("Love calculator exception"); } } }
0