Question: Write a flow chart for this java program import java.util.Scanner; import java.text.DecimalFormat; public class tnb { public static void main(String[] args) { Scanner sc =

Write a flow chart for this java program

import java.util.Scanner; import java.text.DecimalFormat; public class tnb { public static void main(String[] args) { Scanner sc = new Scanner(System.in); DecimalFormat df=new DecimalFormat ("0.00"); double total=0; double KWTBB; System.out.println("CURRENT METER READING: "); int CMR=sc.nextInt(); System.out.println("PAST METER READING: "); int PMR=sc.nextInt(); double kWh=CMR-PMR; System.out.println(); System.out.println("BLOCK PRORATA: "); kwh(CMR,PMR); double rebatICPT=kWh/50; if (kWh<=200) { total=kWh*0.218; } else if (kWh>200 && kWh<=300) { total= (200*0.218)+((kWh-200)*0.334); } else if (kWh>300 && kWh<=600) { total= (200*0.218)+(100*0.334)+ ((kWh-300)*0.516); } KWTBB=((total*2)/125); System.out.println(); System.out.println("Total: RM"+(df.format(total))); System.out.println(); System.out.println("REBAT ICPT (RM0.02/kWh):"); System.out.println(df.format(total)+ " - " +rebatICPT+ " = RM " +(df.format((total-rebatICPT)))); System.out.println(); System.out.println("KWTBB (1.6%): "+ (df.format(KWTBB))); System.out.println(); System.out.println("Final Total: RM "+(df.format((total-rebatICPT)+KWTBB))); } public static void kwh (int a,int b) { System.out.print(a-b); System.out.println(); } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!