SlideShare une entreprise Scribd logo
1  sur  2
Télécharger pour lire hors ligne
Need help debugging this assignment
import java.util.*;
public class DebugSeven2
{
public static void main(String[] args)
{
String str;
int x;
int length;
int start;
int num;
int lastSpace = -1;
int sum = 0;
String partStr;
Scanner in = new Scanner(System.in);
System.out.print("Enter a series of integers separated by spaces >> ");
str = in.nextLine;
length = str.length();
for(x = 0; x <= length; ++x)
{
if(str.charAt(x) == ' ')
{
partStr = str.substring(lastSpace + 1, y);
num = Integer.parseInt(partStr);
System.out.println(" " + num);
sum += number;
lastSpace = x;
}
}
partStr = str.substring(lastSpace + 1, length);
num = Integer.parseInt(partStr);
System.out.println(" " + num);
sum += num;
System.out.println(" -------------------" +
"nThe sum of the integers is " + sum);
}
}

Contenu connexe

Plus de amazonedistributors

No plagiarism and at least 250 wordsBriefly describe the dif.pdf
No plagiarism and at least 250 wordsBriefly describe the dif.pdfNo plagiarism and at least 250 wordsBriefly describe the dif.pdf
No plagiarism and at least 250 wordsBriefly describe the dif.pdfamazonedistributors
 
no need to invlude comments in the code. 1. Follow the FDR to im.pdf
no need to invlude comments in the code. 1. Follow the FDR to im.pdfno need to invlude comments in the code. 1. Follow the FDR to im.pdf
no need to invlude comments in the code. 1. Follow the FDR to im.pdfamazonedistributors
 
Nonylphenol (NP) is commonly found in municipal wastewater and solid.pdf
Nonylphenol (NP) is commonly found in municipal wastewater and solid.pdfNonylphenol (NP) is commonly found in municipal wastewater and solid.pdf
Nonylphenol (NP) is commonly found in municipal wastewater and solid.pdfamazonedistributors
 
North Korea Is a socialist state. The system is a single-party regim.pdf
North Korea Is a socialist state. The system is a single-party regim.pdfNorth Korea Is a socialist state. The system is a single-party regim.pdf
North Korea Is a socialist state. The system is a single-party regim.pdfamazonedistributors
 
Noel Arrold podr�a haber terminado en trigo. O en el sal�n de clases.pdf
Noel Arrold podr�a haber terminado en trigo. O en el sal�n de clases.pdfNoel Arrold podr�a haber terminado en trigo. O en el sal�n de clases.pdf
Noel Arrold podr�a haber terminado en trigo. O en el sal�n de clases.pdfamazonedistributors
 
Nike vendiendo una l�nea de ropa para acompa�ar su producto principa.pdf
Nike vendiendo una l�nea de ropa para acompa�ar su producto principa.pdfNike vendiendo una l�nea de ropa para acompa�ar su producto principa.pdf
Nike vendiendo una l�nea de ropa para acompa�ar su producto principa.pdfamazonedistributors
 
Ninna Banks is responsible for recording cash disbursements, prepari.pdf
Ninna Banks is responsible for recording cash disbursements, prepari.pdfNinna Banks is responsible for recording cash disbursements, prepari.pdf
Ninna Banks is responsible for recording cash disbursements, prepari.pdfamazonedistributors
 
Nike Case StudyDoes Jeff Ballinger have a convincing argument abo.pdf
Nike Case StudyDoes Jeff Ballinger have a convincing argument abo.pdfNike Case StudyDoes Jeff Ballinger have a convincing argument abo.pdf
Nike Case StudyDoes Jeff Ballinger have a convincing argument abo.pdfamazonedistributors
 
NIIF 9 instrumento financiero permite el uso de contabilidad de cobe.pdf
NIIF 9 instrumento financiero permite el uso de contabilidad de cobe.pdfNIIF 9 instrumento financiero permite el uso de contabilidad de cobe.pdf
NIIF 9 instrumento financiero permite el uso de contabilidad de cobe.pdfamazonedistributors
 
Nicholas is currently in eighth grade and intends to attend a state .pdf
Nicholas is currently in eighth grade and intends to attend a state .pdfNicholas is currently in eighth grade and intends to attend a state .pdf
Nicholas is currently in eighth grade and intends to attend a state .pdfamazonedistributors
 
NetworkingShow the commandsUsing nmcli , create a new network .pdf
NetworkingShow the commandsUsing nmcli , create a new network .pdfNetworkingShow the commandsUsing nmcli , create a new network .pdf
NetworkingShow the commandsUsing nmcli , create a new network .pdfamazonedistributors
 
Network Environment & Configuration Requirements You are a support t.pdf
Network Environment & Configuration Requirements You are a support t.pdfNetwork Environment & Configuration Requirements You are a support t.pdf
Network Environment & Configuration Requirements You are a support t.pdfamazonedistributors
 
Need some help creating the script for the UDP, ICMP, and ARP! Using.pdf
Need some help creating the script for the UDP, ICMP, and ARP! Using.pdfNeed some help creating the script for the UDP, ICMP, and ARP! Using.pdf
Need some help creating the script for the UDP, ICMP, and ARP! Using.pdfamazonedistributors
 
NEED THE ANSWER IN 30 mins thank you Write a recursive .pdf
NEED THE ANSWER IN 30 mins thank you  Write a recursive .pdfNEED THE ANSWER IN 30 mins thank you  Write a recursive .pdf
NEED THE ANSWER IN 30 mins thank you Write a recursive .pdfamazonedistributors
 
need in c language Write a function called zeroEdges that zeros al.pdf
need in c language Write a function called zeroEdges that zeros al.pdfneed in c language Write a function called zeroEdges that zeros al.pdf
need in c language Write a function called zeroEdges that zeros al.pdfamazonedistributors
 
Need help with this project. I am confused what i have to do in this.pdf
Need help with this project. I am confused what i have to do in this.pdfNeed help with this project. I am confused what i have to do in this.pdf
Need help with this project. I am confused what i have to do in this.pdfamazonedistributors
 
Need help, thank you. Write a C callable assembly language function.pdf
Need help, thank you.  Write a C callable assembly language function.pdfNeed help, thank you.  Write a C callable assembly language function.pdf
Need help, thank you. Write a C callable assembly language function.pdfamazonedistributors
 
Need help with this Java practice project. Im brand new to coding s.pdf
Need help with this Java practice project. Im brand new to coding s.pdfNeed help with this Java practice project. Im brand new to coding s.pdf
Need help with this Java practice project. Im brand new to coding s.pdfamazonedistributors
 
Need help with these please using EXCEL please show and take a scree.pdf
Need help with these please using EXCEL please show and take a scree.pdfNeed help with these please using EXCEL please show and take a scree.pdf
Need help with these please using EXCEL please show and take a scree.pdfamazonedistributors
 
Myrtle is a real estate developer who lives on Maui. Myrtle is a sin.pdf
Myrtle is a real estate developer who lives on Maui. Myrtle is a sin.pdfMyrtle is a real estate developer who lives on Maui. Myrtle is a sin.pdf
Myrtle is a real estate developer who lives on Maui. Myrtle is a sin.pdfamazonedistributors
 

Plus de amazonedistributors (20)

No plagiarism and at least 250 wordsBriefly describe the dif.pdf
No plagiarism and at least 250 wordsBriefly describe the dif.pdfNo plagiarism and at least 250 wordsBriefly describe the dif.pdf
No plagiarism and at least 250 wordsBriefly describe the dif.pdf
 
no need to invlude comments in the code. 1. Follow the FDR to im.pdf
no need to invlude comments in the code. 1. Follow the FDR to im.pdfno need to invlude comments in the code. 1. Follow the FDR to im.pdf
no need to invlude comments in the code. 1. Follow the FDR to im.pdf
 
Nonylphenol (NP) is commonly found in municipal wastewater and solid.pdf
Nonylphenol (NP) is commonly found in municipal wastewater and solid.pdfNonylphenol (NP) is commonly found in municipal wastewater and solid.pdf
Nonylphenol (NP) is commonly found in municipal wastewater and solid.pdf
 
North Korea Is a socialist state. The system is a single-party regim.pdf
North Korea Is a socialist state. The system is a single-party regim.pdfNorth Korea Is a socialist state. The system is a single-party regim.pdf
North Korea Is a socialist state. The system is a single-party regim.pdf
 
Noel Arrold podr�a haber terminado en trigo. O en el sal�n de clases.pdf
Noel Arrold podr�a haber terminado en trigo. O en el sal�n de clases.pdfNoel Arrold podr�a haber terminado en trigo. O en el sal�n de clases.pdf
Noel Arrold podr�a haber terminado en trigo. O en el sal�n de clases.pdf
 
Nike vendiendo una l�nea de ropa para acompa�ar su producto principa.pdf
Nike vendiendo una l�nea de ropa para acompa�ar su producto principa.pdfNike vendiendo una l�nea de ropa para acompa�ar su producto principa.pdf
Nike vendiendo una l�nea de ropa para acompa�ar su producto principa.pdf
 
Ninna Banks is responsible for recording cash disbursements, prepari.pdf
Ninna Banks is responsible for recording cash disbursements, prepari.pdfNinna Banks is responsible for recording cash disbursements, prepari.pdf
Ninna Banks is responsible for recording cash disbursements, prepari.pdf
 
Nike Case StudyDoes Jeff Ballinger have a convincing argument abo.pdf
Nike Case StudyDoes Jeff Ballinger have a convincing argument abo.pdfNike Case StudyDoes Jeff Ballinger have a convincing argument abo.pdf
Nike Case StudyDoes Jeff Ballinger have a convincing argument abo.pdf
 
NIIF 9 instrumento financiero permite el uso de contabilidad de cobe.pdf
NIIF 9 instrumento financiero permite el uso de contabilidad de cobe.pdfNIIF 9 instrumento financiero permite el uso de contabilidad de cobe.pdf
NIIF 9 instrumento financiero permite el uso de contabilidad de cobe.pdf
 
Nicholas is currently in eighth grade and intends to attend a state .pdf
Nicholas is currently in eighth grade and intends to attend a state .pdfNicholas is currently in eighth grade and intends to attend a state .pdf
Nicholas is currently in eighth grade and intends to attend a state .pdf
 
NetworkingShow the commandsUsing nmcli , create a new network .pdf
NetworkingShow the commandsUsing nmcli , create a new network .pdfNetworkingShow the commandsUsing nmcli , create a new network .pdf
NetworkingShow the commandsUsing nmcli , create a new network .pdf
 
Network Environment & Configuration Requirements You are a support t.pdf
Network Environment & Configuration Requirements You are a support t.pdfNetwork Environment & Configuration Requirements You are a support t.pdf
Network Environment & Configuration Requirements You are a support t.pdf
 
Need some help creating the script for the UDP, ICMP, and ARP! Using.pdf
Need some help creating the script for the UDP, ICMP, and ARP! Using.pdfNeed some help creating the script for the UDP, ICMP, and ARP! Using.pdf
Need some help creating the script for the UDP, ICMP, and ARP! Using.pdf
 
NEED THE ANSWER IN 30 mins thank you Write a recursive .pdf
NEED THE ANSWER IN 30 mins thank you  Write a recursive .pdfNEED THE ANSWER IN 30 mins thank you  Write a recursive .pdf
NEED THE ANSWER IN 30 mins thank you Write a recursive .pdf
 
need in c language Write a function called zeroEdges that zeros al.pdf
need in c language Write a function called zeroEdges that zeros al.pdfneed in c language Write a function called zeroEdges that zeros al.pdf
need in c language Write a function called zeroEdges that zeros al.pdf
 
Need help with this project. I am confused what i have to do in this.pdf
Need help with this project. I am confused what i have to do in this.pdfNeed help with this project. I am confused what i have to do in this.pdf
Need help with this project. I am confused what i have to do in this.pdf
 
Need help, thank you. Write a C callable assembly language function.pdf
Need help, thank you.  Write a C callable assembly language function.pdfNeed help, thank you.  Write a C callable assembly language function.pdf
Need help, thank you. Write a C callable assembly language function.pdf
 
Need help with this Java practice project. Im brand new to coding s.pdf
Need help with this Java practice project. Im brand new to coding s.pdfNeed help with this Java practice project. Im brand new to coding s.pdf
Need help with this Java practice project. Im brand new to coding s.pdf
 
Need help with these please using EXCEL please show and take a scree.pdf
Need help with these please using EXCEL please show and take a scree.pdfNeed help with these please using EXCEL please show and take a scree.pdf
Need help with these please using EXCEL please show and take a scree.pdf
 
Myrtle is a real estate developer who lives on Maui. Myrtle is a sin.pdf
Myrtle is a real estate developer who lives on Maui. Myrtle is a sin.pdfMyrtle is a real estate developer who lives on Maui. Myrtle is a sin.pdf
Myrtle is a real estate developer who lives on Maui. Myrtle is a sin.pdf
 

Dernier

ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxleah joy valeriano
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsManeerUddin
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 

Dernier (20)

ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture hons
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 

Need help debugging this assignmentimport java.util.;public c.pdf

  • 1. Need help debugging this assignment import java.util.*; public class DebugSeven2 { public static void main(String[] args) { String str; int x; int length; int start; int num; int lastSpace = -1; int sum = 0; String partStr; Scanner in = new Scanner(System.in); System.out.print("Enter a series of integers separated by spaces >> "); str = in.nextLine; length = str.length(); for(x = 0; x <= length; ++x) { if(str.charAt(x) == ' ') { partStr = str.substring(lastSpace + 1, y); num = Integer.parseInt(partStr); System.out.println(" " + num); sum += number; lastSpace = x; } } partStr = str.substring(lastSpace + 1, length); num = Integer.parseInt(partStr); System.out.println(" " + num); sum += num; System.out.println(" -------------------" +
  • 2. "nThe sum of the integers is " + sum); } }