Question: Hi, I need some help with printing this out the way I want it correctly in scala. See the code below: temp.foreach{ e => print(Symbol:
Hi, I need some help with printing this out the way I want it correctly in scala.
See the code below:
temp.foreach{ e => print("Symbol: " + e + " Shares: " + n(e)) }
Output: Symbol: AAPL Shares: 105Symbol: CVX Shares: 92Symbol: JNJ Shares: 25Symbol: NKE Shares: 210
n would be a map in this case
The main thing I can't figure out is how to put the print statements in a new line.
I've tried using println instead of print and it doesn't work. It'll just give me an output that's grayed out, and seems like an error occured.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
