SlideShare une entreprise Scribd logo
1  sur  2
Please just type out the program in steps. You do not need to use an actual program. Thank you:)
3. Determine the value in the variable total after each of the following sets of recipes a. Set total
to 0 Repeat by counting I from 1 to 5 Set total to total 1 b. Set total to 0 Repeat by counting J
from 1 to 5 Set total to total J c. Set total to 20 Repeat by counting C from 1 to 5 Set total to total
C
Solution
a) Program:
import java.io.*;
class T
{
public static void main(String args[])throws IOException
{
int total=0;
for(int I=1;I<=5;I++)
total=total+1;
System.out.println("The value of total is : "+total);
}
}
Output:The value of total is : 5
b) Program:
import java.io.*;
class T
{
public static void main(String args[])throws IOException
{
int total=0;
for(int J=1;J<=5;J++)
total=total+J;
System.out.println("The value of total is : "+total);
}
}
Output:The value of total is : 15
c) Program:
import java.io.*;
class T
{
public static void main(String args[])throws IOException
{
int total=20;
for(int C=1;C<=5;C++)
total=total-C;
System.out.println("The value of total is : "+total);
}
}
Output:The value of total is : 5

Contenu connexe

Similaire à Please just type out the program in steps- You do not need to use an a.docx

ExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxgitagrimston
 
Dti2143 lab sheet 6
Dti2143 lab sheet 6Dti2143 lab sheet 6
Dti2143 lab sheet 6alish sha
 
Scjp questions
Scjp questionsScjp questions
Scjp questionsroudhran
 
Review Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdfReview Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdfmayorothenguyenhob69
 
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjbpointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjbTUSHARGAURAV11
 
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjbpointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjbTUSHARGAURAV11
 
Esg111 midterm review
Esg111 midterm reviewEsg111 midterm review
Esg111 midterm reviewmickeynickey1
 
Multiple Choice Questions for Java interfaces and exception handling
Multiple Choice Questions for Java interfaces and exception handlingMultiple Choice Questions for Java interfaces and exception handling
Multiple Choice Questions for Java interfaces and exception handlingAbishek Purushothaman
 
Ramco Sample Paper 2003
Ramco  Sample  Paper 2003Ramco  Sample  Paper 2003
Ramco Sample Paper 2003ncct
 
OXUS20 JAVA Programming Questions and Answers PART I
OXUS20 JAVA Programming Questions and Answers PART IOXUS20 JAVA Programming Questions and Answers PART I
OXUS20 JAVA Programming Questions and Answers PART IAbdul Rahman Sherzad
 
Wap to implement bitwise operators
Wap to implement bitwise operatorsWap to implement bitwise operators
Wap to implement bitwise operatorsHarleen Sodhi
 

Similaire à Please just type out the program in steps- You do not need to use an a.docx (20)

Core java
Core javaCore java
Core java
 
ExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docx
 
Dti2143 lab sheet 6
Dti2143 lab sheet 6Dti2143 lab sheet 6
Dti2143 lab sheet 6
 
7
77
7
 
Scjp questions
Scjp questionsScjp questions
Scjp questions
 
Review Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdfReview Questions for Exam 10182016 1. public class .pdf
Review Questions for Exam 10182016 1. public class .pdf
 
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjbpointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
 
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjbpointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
 
39927902 c-labmanual
39927902 c-labmanual39927902 c-labmanual
39927902 c-labmanual
 
39927902 c-labmanual
39927902 c-labmanual39927902 c-labmanual
39927902 c-labmanual
 
Esg111 midterm review
Esg111 midterm reviewEsg111 midterm review
Esg111 midterm review
 
Multiple Choice Questions for Java interfaces and exception handling
Multiple Choice Questions for Java interfaces and exception handlingMultiple Choice Questions for Java interfaces and exception handling
Multiple Choice Questions for Java interfaces and exception handling
 
UNIT 2 LOOP CONTROL.pptx
UNIT 2 LOOP CONTROL.pptxUNIT 2 LOOP CONTROL.pptx
UNIT 2 LOOP CONTROL.pptx
 
C#.net
C#.netC#.net
C#.net
 
Ramco Sample Paper 2003
Ramco  Sample  Paper 2003Ramco  Sample  Paper 2003
Ramco Sample Paper 2003
 
OXUS20 JAVA Programming Questions and Answers PART I
OXUS20 JAVA Programming Questions and Answers PART IOXUS20 JAVA Programming Questions and Answers PART I
OXUS20 JAVA Programming Questions and Answers PART I
 
C test
C testC test
C test
 
Wap to implement bitwise operators
Wap to implement bitwise operatorsWap to implement bitwise operators
Wap to implement bitwise operators
 
Part - 2 Cpp programming Solved MCQ
Part - 2  Cpp programming Solved MCQ Part - 2  Cpp programming Solved MCQ
Part - 2 Cpp programming Solved MCQ
 
Java programs
Java programsJava programs
Java programs
 

Plus de kdavid658

The mutual fund industry is beginning to use the Internet to dissemina.docx
The mutual fund industry is beginning to use the Internet to dissemina.docxThe mutual fund industry is beginning to use the Internet to dissemina.docx
The mutual fund industry is beginning to use the Internet to dissemina.docxkdavid658
 
The primary tool for hardening symmetric cryptography is public key in.docx
The primary tool for hardening symmetric cryptography is public key in.docxThe primary tool for hardening symmetric cryptography is public key in.docx
The primary tool for hardening symmetric cryptography is public key in.docxkdavid658
 
the primary function of the skin the primary function of the skin.docx
the primary function of the skin    the primary function of the skin.docxthe primary function of the skin    the primary function of the skin.docx
the primary function of the skin the primary function of the skin.docxkdavid658
 
The primary difference between seasonality and cycles is- the duration.docx
The primary difference between seasonality and cycles is- the duration.docxThe primary difference between seasonality and cycles is- the duration.docx
The primary difference between seasonality and cycles is- the duration.docxkdavid658
 
The pointer in a node points to the data part of a node the count part.docx
The pointer in a node points to the data part of a node the count part.docxThe pointer in a node points to the data part of a node the count part.docx
The pointer in a node points to the data part of a node the count part.docxkdavid658
 
The nucleus of a 15 a distance of 5-4 x 10-11 m- What is the ratio of.docx
The nucleus of a 15 a distance of 5-4 x 10-11 m- What is the ratio of.docxThe nucleus of a 15 a distance of 5-4 x 10-11 m- What is the ratio of.docx
The nucleus of a 15 a distance of 5-4 x 10-11 m- What is the ratio of.docxkdavid658
 
The main function of a cell membrane is to allow substances to enter a.docx
The main function of a cell membrane is to allow substances to enter a.docxThe main function of a cell membrane is to allow substances to enter a.docx
The main function of a cell membrane is to allow substances to enter a.docxkdavid658
 
The left subtree of key value 14 has 3 key values and the right subtre.docx
The left subtree of key value 14 has 3 key values and the right subtre.docxThe left subtree of key value 14 has 3 key values and the right subtre.docx
The left subtree of key value 14 has 3 key values and the right subtre.docxkdavid658
 
Please show ALL work- If written please show with neat handwriting- I.docx
Please show ALL work- If written please show with neat handwriting- I.docxPlease show ALL work- If written please show with neat handwriting- I.docx
Please show ALL work- If written please show with neat handwriting- I.docxkdavid658
 
Please only answer if you know the answer- I have posted this twice an.docx
Please only answer if you know the answer- I have posted this twice an.docxPlease only answer if you know the answer- I have posted this twice an.docx
Please only answer if you know the answer- I have posted this twice an.docxkdavid658
 
Please make comments of the following discussion in 150-200 words-If y.docx
Please make comments of the following discussion in 150-200 words-If y.docxPlease make comments of the following discussion in 150-200 words-If y.docx
Please make comments of the following discussion in 150-200 words-If y.docxkdavid658
 
Please help!! I need to make the instructions for these by manipulatin.docx
Please help!! I need to make the instructions for these by manipulatin.docxPlease help!! I need to make the instructions for these by manipulatin.docx
Please help!! I need to make the instructions for these by manipulatin.docxkdavid658
 
PLEASE HELP! 1- The integrating power of globalization forces managers.docx
PLEASE HELP! 1- The integrating power of globalization forces managers.docxPLEASE HELP! 1- The integrating power of globalization forces managers.docx
PLEASE HELP! 1- The integrating power of globalization forces managers.docxkdavid658
 
please help with answer and explain homo and lumo in terms of acid-bas.docx
please help with answer and explain homo and lumo in terms of acid-bas.docxplease help with answer and explain homo and lumo in terms of acid-bas.docx
please help with answer and explain homo and lumo in terms of acid-bas.docxkdavid658
 
Please help me with this crossword!SolutionAcross- 4-Constitutional Is.docx
Please help me with this crossword!SolutionAcross- 4-Constitutional Is.docxPlease help me with this crossword!SolutionAcross- 4-Constitutional Is.docx
Please help me with this crossword!SolutionAcross- 4-Constitutional Is.docxkdavid658
 
Please Type Answer! Compare and contrast the properties of acids and b.docx
Please Type Answer! Compare and contrast the properties of acids and b.docxPlease Type Answer! Compare and contrast the properties of acids and b.docx
Please Type Answer! Compare and contrast the properties of acids and b.docxkdavid658
 

Plus de kdavid658 (16)

The mutual fund industry is beginning to use the Internet to dissemina.docx
The mutual fund industry is beginning to use the Internet to dissemina.docxThe mutual fund industry is beginning to use the Internet to dissemina.docx
The mutual fund industry is beginning to use the Internet to dissemina.docx
 
The primary tool for hardening symmetric cryptography is public key in.docx
The primary tool for hardening symmetric cryptography is public key in.docxThe primary tool for hardening symmetric cryptography is public key in.docx
The primary tool for hardening symmetric cryptography is public key in.docx
 
the primary function of the skin the primary function of the skin.docx
the primary function of the skin    the primary function of the skin.docxthe primary function of the skin    the primary function of the skin.docx
the primary function of the skin the primary function of the skin.docx
 
The primary difference between seasonality and cycles is- the duration.docx
The primary difference between seasonality and cycles is- the duration.docxThe primary difference between seasonality and cycles is- the duration.docx
The primary difference between seasonality and cycles is- the duration.docx
 
The pointer in a node points to the data part of a node the count part.docx
The pointer in a node points to the data part of a node the count part.docxThe pointer in a node points to the data part of a node the count part.docx
The pointer in a node points to the data part of a node the count part.docx
 
The nucleus of a 15 a distance of 5-4 x 10-11 m- What is the ratio of.docx
The nucleus of a 15 a distance of 5-4 x 10-11 m- What is the ratio of.docxThe nucleus of a 15 a distance of 5-4 x 10-11 m- What is the ratio of.docx
The nucleus of a 15 a distance of 5-4 x 10-11 m- What is the ratio of.docx
 
The main function of a cell membrane is to allow substances to enter a.docx
The main function of a cell membrane is to allow substances to enter a.docxThe main function of a cell membrane is to allow substances to enter a.docx
The main function of a cell membrane is to allow substances to enter a.docx
 
The left subtree of key value 14 has 3 key values and the right subtre.docx
The left subtree of key value 14 has 3 key values and the right subtre.docxThe left subtree of key value 14 has 3 key values and the right subtre.docx
The left subtree of key value 14 has 3 key values and the right subtre.docx
 
Please show ALL work- If written please show with neat handwriting- I.docx
Please show ALL work- If written please show with neat handwriting- I.docxPlease show ALL work- If written please show with neat handwriting- I.docx
Please show ALL work- If written please show with neat handwriting- I.docx
 
Please only answer if you know the answer- I have posted this twice an.docx
Please only answer if you know the answer- I have posted this twice an.docxPlease only answer if you know the answer- I have posted this twice an.docx
Please only answer if you know the answer- I have posted this twice an.docx
 
Please make comments of the following discussion in 150-200 words-If y.docx
Please make comments of the following discussion in 150-200 words-If y.docxPlease make comments of the following discussion in 150-200 words-If y.docx
Please make comments of the following discussion in 150-200 words-If y.docx
 
Please help!! I need to make the instructions for these by manipulatin.docx
Please help!! I need to make the instructions for these by manipulatin.docxPlease help!! I need to make the instructions for these by manipulatin.docx
Please help!! I need to make the instructions for these by manipulatin.docx
 
PLEASE HELP! 1- The integrating power of globalization forces managers.docx
PLEASE HELP! 1- The integrating power of globalization forces managers.docxPLEASE HELP! 1- The integrating power of globalization forces managers.docx
PLEASE HELP! 1- The integrating power of globalization forces managers.docx
 
please help with answer and explain homo and lumo in terms of acid-bas.docx
please help with answer and explain homo and lumo in terms of acid-bas.docxplease help with answer and explain homo and lumo in terms of acid-bas.docx
please help with answer and explain homo and lumo in terms of acid-bas.docx
 
Please help me with this crossword!SolutionAcross- 4-Constitutional Is.docx
Please help me with this crossword!SolutionAcross- 4-Constitutional Is.docxPlease help me with this crossword!SolutionAcross- 4-Constitutional Is.docx
Please help me with this crossword!SolutionAcross- 4-Constitutional Is.docx
 
Please Type Answer! Compare and contrast the properties of acids and b.docx
Please Type Answer! Compare and contrast the properties of acids and b.docxPlease Type Answer! Compare and contrast the properties of acids and b.docx
Please Type Answer! Compare and contrast the properties of acids and b.docx
 

Dernier

9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 

Dernier (20)

9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 

Please just type out the program in steps- You do not need to use an a.docx

  • 1. Please just type out the program in steps. You do not need to use an actual program. Thank you:) 3. Determine the value in the variable total after each of the following sets of recipes a. Set total to 0 Repeat by counting I from 1 to 5 Set total to total 1 b. Set total to 0 Repeat by counting J from 1 to 5 Set total to total J c. Set total to 20 Repeat by counting C from 1 to 5 Set total to total C Solution a) Program: import java.io.*; class T { public static void main(String args[])throws IOException { int total=0; for(int I=1;I<=5;I++) total=total+1; System.out.println("The value of total is : "+total); } } Output:The value of total is : 5 b) Program: import java.io.*; class T { public static void main(String args[])throws IOException { int total=0; for(int J=1;J<=5;J++) total=total+J; System.out.println("The value of total is : "+total);
  • 2. } } Output:The value of total is : 15 c) Program: import java.io.*; class T { public static void main(String args[])throws IOException { int total=20; for(int C=1;C<=5;C++) total=total-C; System.out.println("The value of total is : "+total); } } Output:The value of total is : 5