Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
SalesmenEarnings
//'main' method must be in a class 'Rextester'. //openjdk version '11.0.5' //Salesmen's Earnings //this code is created by Rezaul Hoque on September 24,2021;contact: jewelmrh@yahoo.com //note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; import java.util.Scanner; class Rextester{ public static void main(String args[]){ Scanner input=new Scanner(System.in); System.out.println("Enter size of the arrays:\n"); int size = input.nextInt(); double a[] = new double[size]; double b[]=new double[size]; System.out.println("Enter the " + size + " salesmen’s salary:\n"); for (int i = 0 ; i < a.length; i++ ) { a[i] = input.nextDouble(); } System.out.println("Enter " + size + " salesmen’s monthly sales:\n"); for (int i = 0 ; i < b.length; i++ ) { b[i] = input.nextDouble(); } double tot[]= new double[size]; for (int i = 0 ; i < size; i++ ) { tot[i] =a[i]+b[i]*0.09; } System.out. println("sl "+"Salary "+"Gross Sales "+ "Earnings\n"); for (int i = 0 ; i < size; i++ ) { System.out.println(i+1 +" "+a[i]+" "+b[i]+" "+tot[i]); } input.close(); } }
run
|
edit
|
history
|
help
0
1a
2
Most Common Word
// Java Coding Challenge - 09: Find out duplicate numbers using HashSet
forloop1
MAP List Iterator
DevStuff
jb15.0
4.a
Date and Time