SlideShare a Scribd company logo
1 of 1
Download to read offline
Assuming that the user inputs 1524, what does the following code output? LSE A TRACE TABLE
to explain your answer int sum =0, digit; Scanner in = new Scanner(System.in);
System.out.println("Please input an integer >0 ); int num = in.nextInt (; do { digit = num % 10;
System.out.println( digit); sum += digit; num = num /10 } while ( num > 10) { System.out.println(
sum );

More Related Content

More from abiwarmaa

What should Jamal propose as a strategy for BlackBerry as a .pdf
What should Jamal propose as a strategy for BlackBerry as a .pdfWhat should Jamal propose as a strategy for BlackBerry as a .pdf
What should Jamal propose as a strategy for BlackBerry as a .pdf
abiwarmaa
ย 
What is the difference between the SW and OT areas of a SWOT.pdf
What is the difference between the SW and OT areas of a SWOT.pdfWhat is the difference between the SW and OT areas of a SWOT.pdf
What is the difference between the SW and OT areas of a SWOT.pdf
abiwarmaa
ย 
Real Value Corporation the Company is a public company .pdf
Real Value Corporation the Company is a public company .pdfReal Value Corporation the Company is a public company .pdf
Real Value Corporation the Company is a public company .pdf
abiwarmaa
ย 
maincpp include ListItemh include ltstringgt in.pdf
maincpp include ListItemh include ltstringgt in.pdfmaincpp include ListItemh include ltstringgt in.pdf
maincpp include ListItemh include ltstringgt in.pdf
abiwarmaa
ย 

More from abiwarmaa (16)

What should Jamal propose as a strategy for BlackBerry as a .pdf
What should Jamal propose as a strategy for BlackBerry as a .pdfWhat should Jamal propose as a strategy for BlackBerry as a .pdf
What should Jamal propose as a strategy for BlackBerry as a .pdf
ย 
What is the difference between the SW and OT areas of a SWOT.pdf
What is the difference between the SW and OT areas of a SWOT.pdfWhat is the difference between the SW and OT areas of a SWOT.pdf
What is the difference between the SW and OT areas of a SWOT.pdf
ย 
Use maple 13 to write the code 5 Consider the polar curve r.pdf
Use maple 13 to write the code 5 Consider the polar curve r.pdfUse maple 13 to write the code 5 Consider the polar curve r.pdf
Use maple 13 to write the code 5 Consider the polar curve r.pdf
ย 
The table shown below gives information on a variable for fo.pdf
The table shown below gives information on a variable for fo.pdfThe table shown below gives information on a variable for fo.pdf
The table shown below gives information on a variable for fo.pdf
ย 
Suppose X and Y are independent Paretodistributed with cu.pdf
Suppose X and Y are independent Paretodistributed with cu.pdfSuppose X and Y are independent Paretodistributed with cu.pdf
Suppose X and Y are independent Paretodistributed with cu.pdf
ย 
Real Value Corporation the Company is a public company .pdf
Real Value Corporation the Company is a public company .pdfReal Value Corporation the Company is a public company .pdf
Real Value Corporation the Company is a public company .pdf
ย 
pass but that all but the most sophisticated computer progra.pdf
pass but that all but the most sophisticated computer progra.pdfpass but that all but the most sophisticated computer progra.pdf
pass but that all but the most sophisticated computer progra.pdf
ย 
Nur Inc is a private company that designs manufactures a.pdf
Nur Inc is a private company that designs manufactures a.pdfNur Inc is a private company that designs manufactures a.pdf
Nur Inc is a private company that designs manufactures a.pdf
ย 
MedTex una gran empresa farmacutica con sede en Texas qu.pdf
MedTex una gran empresa farmacutica con sede en Texas qu.pdfMedTex una gran empresa farmacutica con sede en Texas qu.pdf
MedTex una gran empresa farmacutica con sede en Texas qu.pdf
ย 
maincpp include ListItemh include ltstringgt in.pdf
maincpp include ListItemh include ltstringgt in.pdfmaincpp include ListItemh include ltstringgt in.pdf
maincpp include ListItemh include ltstringgt in.pdf
ย 
JS es un hombre de 42 aos que vive en el Medio Oeste y es m.pdf
JS es un hombre de 42 aos que vive en el Medio Oeste y es m.pdfJS es un hombre de 42 aos que vive en el Medio Oeste y es m.pdf
JS es un hombre de 42 aos que vive en el Medio Oeste y es m.pdf
ย 
If we had classified health worker as rich if they earned .pdf
If we had classified health worker as rich if they earned .pdfIf we had classified health worker as rich if they earned .pdf
If we had classified health worker as rich if they earned .pdf
ย 
Given the following class definition public class Service .pdf
Given the following class definition  public class Service .pdfGiven the following class definition  public class Service .pdf
Given the following class definition public class Service .pdf
ย 
Based on the turtle object create a function called TurtleF.pdf
Based on the turtle object create a function called TurtleF.pdfBased on the turtle object create a function called TurtleF.pdf
Based on the turtle object create a function called TurtleF.pdf
ย 
C++ programming Hello I need some help with an assignment .pdf
C++ programming Hello I need some help with an assignment .pdfC++ programming Hello I need some help with an assignment .pdf
C++ programming Hello I need some help with an assignment .pdf
ย 
kontrol ilkeleri aadakilerin tmn ierir HAR A lgili.pdf
 kontrol ilkeleri aadakilerin tmn ierir HAR A lgili.pdf kontrol ilkeleri aadakilerin tmn ierir HAR A lgili.pdf
kontrol ilkeleri aadakilerin tmn ierir HAR A lgili.pdf
ย 

Recently uploaded

Recently uploaded (20)

Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
ย 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
ย 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
ย 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
ย 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
ย 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
ย 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
ย 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
ย 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
ย 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
ย 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
ย 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
ย 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
ย 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
ย 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
ย 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
ย 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
ย 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
ย 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
ย 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
ย 

Assuming that the user inputs 1524 what does the following .pdf

  • 1. Assuming that the user inputs 1524, what does the following code output? LSE A TRACE TABLE to explain your answer int sum =0, digit; Scanner in = new Scanner(System.in); System.out.println("Please input an integer >0 ); int num = in.nextInt (; do { digit = num % 10; System.out.println( digit); sum += digit; num = num /10 } while ( num > 10) { System.out.println( sum );