Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Escaping Literals II
//'main' method must be in a class 'Rextester'. //openjdk version '11.0.5' import java.util.*; import java.lang.*; //create a summary report on Stock purchases //sample dataset demodata class Rextester { public static void main(String args[]) { String header = "\n\tStock Portfolio:\n"; header += "\n\tStock\tShares\tPrice\tCost\n"; header += "\t---\t---\t---\t---\n"; String forecast = "\tApple\t440\t$64\t$28,000\n"; forecast += "\tAT&T\t870\t$28\t$27,000\n"; forecast += "\tGoogle\t920\t$390\t$359,000\n"; forecast += "\tIBM\t990\t$74\t$73,000\n"; forecast += "\tMerck\t950\t$42\t$40,000\n"; //Calculations: Sum, Minimum, Average, Maximum and Count forecast += "\tTotal Cost\t$527,000\n"; forecast += "\tAverage Price\t$119.40\n"; forecast += "\tMax Price \t$390\n"; forecast += "\tMin Price \t$28\n"; forecast += "\tCount \t5 \n"; System.out.println(header + forecast); } }
run
|
edit
|
history
|
help
0
Binary Tree ZigZag Traversal
on_off
RevArray
3.c
Implement Queue with Limited Size of Arrays
JAVA # 3 sayının En büyüğü
Round Price
Человечки
your age
String is not reference Type??