JAVA PPROGRAM ASAP   Please create  this program ASAP BECAUSE IT IS MY LAB ASSIGNMENT #2 so it passes all the test cases. The program must pass the test case when uploaded to Hypergrade.    Chapter 9. PC #8. 8. Sum of Numbers in a String (page 610) Write a program that asks the user to enter a series of numbers separated by commas. Here are two examples of valid input: 7,9,10,2,18,6 8.777,10.9,11,2.2,-18,6 The program should calculate and display the sum of all the numbers. Input Validation 1. Make sure the string only contains numbers and commas (valid symbols are '0'-'9', '-', '.', and ','). 2. If the string is empty, a messages should be displayed, saying that the string is empty.   Test Case 1     Enter a series of numbers separated only by commas or type QUIT to exit:\n 7,9,10,2,18,6ENTER The sum of those numbers is 52.00\n Enter a series of numbers separated only by commas or type QUIT to exit:\n ENTER Empty string.\n Enter a series of numbers separated only by commas or type QUIT to exit:\n 8.777,10.9,11,2.2,-18,6ENTER The sum of those numbers is 20.88\n Enter a series of numbers separated only by commas or type QUIT to exit:\n quitENTER   Test Case 2     Enter a series of numbers separated only by commas or type QUIT to exit:\n invalid_input_hereENTER Invalid input.\n Enter a series of numbers separated only by commas or type QUIT to exit:\n 1,2,3ENTER The sum of those numbers is 6.00\n Enter a series of numbers separated only by commas or type QUIT to exit:\n quitENTER

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter7: User-defined Simple Data Types, Namespaces, And The String Type
Section: Chapter Questions
Problem 3PE
icon
Related questions
Question
JAVA PPROGRAM ASAP
 
Please create  this program ASAP BECAUSE IT IS MY LAB ASSIGNMENT #2 so it passes all the test cases. The program must pass the test case when uploaded to Hypergrade. 
 
Chapter 9. PC #8. 8. Sum of Numbers in a String (page 610)
Write a program that asks the user to enter a series of numbers separated by commas. Here are two examples of valid input:
7,9,10,2,18,6
8.777,10.9,11,2.2,-18,6
The program should calculate and display the sum of all the numbers.
Input Validation
1. Make sure the string only contains numbers and commas (valid symbols are '0'-'9', '-', '.', and ',').
2. If the string is empty, a messages should be displayed, saying that the string is empty.
 

Test Case 1

 
 
Enter a series of numbers separated only by commas or type QUIT to exit:\n
7,9,10,2,18,6ENTER
The sum of those numbers is 52.00\n
Enter a series of numbers separated only by commas or type QUIT to exit:\n
ENTER
Empty string.\n
Enter a series of numbers separated only by commas or type QUIT to exit:\n
8.777,10.9,11,2.2,-18,6ENTER
The sum of those numbers is 20.88\n
Enter a series of numbers separated only by commas or type QUIT to exit:\n
quitENTER
 

Test Case 2

 
 
Enter a series of numbers separated only by commas or type QUIT to exit:\n
invalid_input_hereENTER
Invalid input.\n
Enter a series of numbers separated only by commas or type QUIT to exit:\n
1,2,3ENTER
The sum of those numbers is 6.00\n
Enter a series of numbers separated only by commas or type QUIT to exit:\n
quitENTER
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Map
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT