Question: 8:45 AM Wed Mar 13 94%- 2.scanner_string Line Totaller_lab_java aplus.doc A+ Computer Science LINE SUMMING Lab Goal: This lab was designed to teach you more
8:45 AM Wed Mar 13 94%- 2.scanner_string Line Totaller_lab_java aplus.doc A+ Computer Science LINE SUMMING Lab Goal: This lab was designed to teach you more about using Scanner to chop up Strings Lab Description Take in a group of numbers all on one line and sum up all of the numbers. Sample Data: 1 2 34 5 6 10 20 30 40 50 60 250 657 2154 345 6796 iles Needed ineTotaller.j va LineTotallerRu nner.java -99 45-98 92 87 Sample Output 1 2 3 4 5 6 sum = 21 10 20 30 40 50 60 sum210 250 657 2154 345 6796 sum = 10202 sum = 0 8:45 AM Wed Mar 13 94% LineTotaller.iava //(c) A+ Computer Science //www.apuscompsci.com /Name - import static java.lang.System. import java.util.Scanner; public class LineTotaller private String line; public LineTotaller) setLine(") public LineTotaller(String s) public void setLine(String s) public int getSum) int total 0; return total; public String getLine0 return public String toString) return getLine): 8:45 AM Wed Mar 13 94%- LineTotallerRunner.iava //(c) A+ Computer Science //www.apuscompsci.com /Name import static java.lang.System. import java.util.Scanner; public class LineTotallerRunner public static void main( String args0)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
