SlideShare a Scribd company logo
1 of 24
Algorithm: Repetition- Sentinel
Loop And Nested Loop
ISB 10103
PRINCIPLES OF COMPUTER PROGRAMMING
1
Objectives
In this chapter you will be able to :
• Introduce sentinel value in loop
• Variations of Loop implementation as in Java Syntax using
Sentinel value
• Introduce Nested loop
2
Sentinel-controlled Loop
• Sentinel-controlled repetition is sometimes called indefinite
repetition because it is not known in advance how many times
the loop will be executed.
• It is a repetition procedure for solving a problem by using
a sentinel value (also called a signal value, a dummy value or a
flag value) to indicate "end of data entry".
• Eg:
• DOWHILE( loop <> 0) , DOWHILE ( number <>99 )
3
Check Point 1:
4
Example 1: Problem
Using loop, display a string constant of “Hello”.
Stop the loop until user enter 99.
After all the task is finished, display “Done !”
Check Your Answer ?
INPUT PROCESS OUTPUT
True
Pseudocode
Display_Hello
Use loop as integer
Prompt for loop
Get loop
DOWHILE (loop<>99)
Display message “Hello”
Prompt for loop
Get loop
ENDDO
Display message “Done”
END
5
Initialization
Testing
Update
Flowchart
Start
Stop
Use loop as integer
Prompt for loop
Get loop
DOWHILE
(loop<>99)
Display message “Hello”
Prompt for loop
Get loop
False
Pseudocode Java Codes : while ( )
6
Comparison of all Loop syntax: do..while( )
7
• Check Point:
• What is the output when you
entered the following input?
• A. 1,2,3,99 ?
• B. 10,99 ?
• C.99 ?
Comparison of all Loop syntax: for ( )
8
• Check Point:
• What is the output when you entered
the following input?
• A. 3, 99 ?
• B. 99?
• What should you change, if the program
must stop when user enter 0 ?
Nested Loop Function & Syntax
• It can be defined as a loop within a loop
• Just like a nest 
9
Questions:
1. How many time(s) the
outer loop shall be
executed?
2. How many time(s) the
inner loop shall be
executed?
3. What is output from this
nested loop?
Nested Loop Example
10
Nested Loop- Case Study[Multiplication Table]
11
Questions:
1. How many time(s) the outer
loop shall be executed?
2. How many time(s) the inner
loop shall be executed?
3. What is output from this
nested loop?
Nested Loop- Case Study[Multiplication Table]
12
It will display a 1*12
multiplication table
until 12 !!!!
Check Point - Nested Loop – Write Java Codes
• Create your own multiplication table to display the following
table using nested loop:
13
Questions:
1. What is outer loop
control variable
statement?
2. How many times the
outer loop should
repeat?
3. What is the inner loop
control variable
statement?
4. How many times the
inner loop should
repeat?
Java Code _possible solution
for(loop=1;loop<=3;loop++)
{
System.out.println(“Multiplication table : ”+loop);
for(nestLoop=1;nestLoop<=5;nestLoop++)
{
System.out.println(loop+”*”+nestLoop+”=”+ loop*nestLoop);
} //end of inner loop
}//end of outer loop
14
Nested Loop- Tracing Output 1
for (loop=1;loop<=3;loop++)
{
for(inLoop=1;inLoop<=2;inLoop++)
{
//total=loop*2 >>arithmetic operation
System.out.println(“Value is” + loop*2);
}
System.out.println(“@@@@@”);
}
System.out.println(“Thank you”);
15
Check Point 1:
1. What is the name of loop
control variable for the outer
loop statements? loop
2. What is the name of loop
control variable for the inner
loop statements? inLoop
3. What is the output for the
following statements?
Dry run Table – Tracing Output 1
16
loop loop<=3 loop++ inLoop inLoop<=2 inLoop++ Output
1 1<=3?True 1+1=2 1 1<=2? True 1+1=2 Value is 2
2 2<=2?True 2+1 =3 Value is 2
3 3<=2? False @@@@@
2 2<=3?True 2+1=3 1 1<=2? True 1+1=2 Value is 4
2 2<=2?True 2+1=3 Value is 4
3 3<=2? False @@@@@
3 3<=3? True 3+1=4 1 1<=2? True 1+1=2 Value is 6
2 2<=2?True 2+1=3 Value is 6
3 3<=2? False @@@@@
4 4<=3? False Thank you
Nested Loop- Tracing Output 2
for (loop=1;loop<=2;loop++)
{
for(inLoop=1;inLoop<=4;inLoop++)
{
System.out.println(“Inner is” + inLoop);
} //end of inLoop
System.out.println(“@@@@@”);
System.out.println(“Outer loop:”+loop);
} //end of loop
System.out.println(“Thank You. End of Code”);
17
Check Point 2:
1. What is the name of loop
control variable for the outer
loop statements? loop
2. What is the name of loop
control variable for the inner
loop statements? inloop
3. What is the output for the
following statements?
18
Dry run Table – Execute Java ???
loop loop<=2 loop++ inLoop inLoop<=4 inLoop++ Output
Home work: Check Point Nested Loop &Array
• Question 1
• Display yearly total sales from 4 teams of Atomie
Marketing&Sales Network Company. Each team will need to
input their monthly sales.
• Produce IPO, Pseudocode, Flowchart and Java. Use nested loop.
• Question 2
• Modify the java code so that it will use Array to store data
19
Home work: Check Point Nested Loop –
Pseudocode?
20
Input Process Output
monthlySales Using nested loop, display yearly total sales
from 4 teams of Atomie Marketing&Sales
Network Company. Each team will need to input
their monthly sales.
yearlyTotalSales
-Nested Loop Exercise-
21
Check Point 1
• Design an algorithm that will prompt for your age in years and
months. Calculate and display your age in months. If the
calculated months figure is more than 500, three asterisks
should also appear beside the month figure. Your program is to
continue processing until a sentinel of 999 is entered.
22
INPUT PROCESS OUTPUT
Check Your Answer ?
Check Point 2
• Design an algorithm that will prompt for total collection of
payroll amount entered by branch manager of Sushi King
Company until a sentinel amount of -99 is entered. After the
sentinel has been entered, display the total payroll amount.
23
INPUT PROCESS OUTPUT
Check Your Answer ?
-End of Chapter-
24

More Related Content

Similar to Algorithm-RepetitionSentinellNestedLoop_Solution.pptx

Verilog for synthesis - combinational rev a.pdf
Verilog for synthesis - combinational rev a.pdfVerilog for synthesis - combinational rev a.pdf
Verilog for synthesis - combinational rev a.pdf
AzeemMohammedAbdul
 
Verilog Lecture3 hust 2014
Verilog Lecture3 hust 2014Verilog Lecture3 hust 2014
Verilog Lecture3 hust 2014
Béo Tú
 

Similar to Algorithm-RepetitionSentinellNestedLoop_Solution.pptx (20)

Verilog for synthesis - combinational rev a.pdf
Verilog for synthesis - combinational rev a.pdfVerilog for synthesis - combinational rev a.pdf
Verilog for synthesis - combinational rev a.pdf
 
DSA 103 Object Oriented Programming :: Week 3
DSA 103 Object Oriented Programming :: Week 3DSA 103 Object Oriented Programming :: Week 3
DSA 103 Object Oriented Programming :: Week 3
 
Nested loops
Nested loopsNested loops
Nested loops
 
Kill the mutants - A better way to test your tests
Kill the mutants - A better way to test your testsKill the mutants - A better way to test your tests
Kill the mutants - A better way to test your tests
 
Kill the mutants and test your tests - Roy van Rijn
Kill the mutants and test your tests - Roy van RijnKill the mutants and test your tests - Roy van Rijn
Kill the mutants and test your tests - Roy van Rijn
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
11 doloops
11 doloops11 doloops
11 doloops
 
Testing the waters of iOS
Testing the waters of iOSTesting the waters of iOS
Testing the waters of iOS
 
Mastering Python lesson 3a
Mastering Python lesson 3aMastering Python lesson 3a
Mastering Python lesson 3a
 
Lesson 5
Lesson 5Lesson 5
Lesson 5
 
Loops c++
Loops c++Loops c++
Loops c++
 
The Ring programming language version 1.10 book - Part 12 of 212
The Ring programming language version 1.10 book - Part 12 of 212The Ring programming language version 1.10 book - Part 12 of 212
The Ring programming language version 1.10 book - Part 12 of 212
 
Cs1123 6 loops
Cs1123 6 loopsCs1123 6 loops
Cs1123 6 loops
 
Operators loops conditional and statements
Operators loops conditional and statementsOperators loops conditional and statements
Operators loops conditional and statements
 
While loop
While loopWhile loop
While loop
 
Repetition Structure
Repetition StructureRepetition Structure
Repetition Structure
 
The Ring programming language version 1.9 book - Part 11 of 210
The Ring programming language version 1.9 book - Part 11 of 210The Ring programming language version 1.9 book - Part 11 of 210
The Ring programming language version 1.9 book - Part 11 of 210
 
The Ring programming language version 1.8 book - Part 9 of 202
The Ring programming language version 1.8 book - Part 9 of 202The Ring programming language version 1.8 book - Part 9 of 202
The Ring programming language version 1.8 book - Part 9 of 202
 
Verilog Lecture3 hust 2014
Verilog Lecture3 hust 2014Verilog Lecture3 hust 2014
Verilog Lecture3 hust 2014
 
4th_Ed_Ch03.pdf
4th_Ed_Ch03.pdf4th_Ed_Ch03.pdf
4th_Ed_Ch03.pdf
 

Recently uploaded

一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
AS
 
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
mikehavy0
 
一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样
一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样
一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样
ayvbos
 
一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样
一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样
一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样
AS
 
一比一原版澳大利亚迪肯大学毕业证如何办理
一比一原版澳大利亚迪肯大学毕业证如何办理一比一原版澳大利亚迪肯大学毕业证如何办理
一比一原版澳大利亚迪肯大学毕业证如何办理
SS
 
一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理
F
 
一比一原版贝德福特大学毕业证学位证书
一比一原版贝德福特大学毕业证学位证书一比一原版贝德福特大学毕业证学位证书
一比一原版贝德福特大学毕业证学位证书
F
 
如何办理(UCLA毕业证)加州大学洛杉矶分校毕业证成绩单本科硕士学位证留信学历认证
如何办理(UCLA毕业证)加州大学洛杉矶分校毕业证成绩单本科硕士学位证留信学历认证如何办理(UCLA毕业证)加州大学洛杉矶分校毕业证成绩单本科硕士学位证留信学历认证
如何办理(UCLA毕业证)加州大学洛杉矶分校毕业证成绩单本科硕士学位证留信学历认证
hfkmxufye
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
F
 
一比一原版美国北卡罗莱纳大学毕业证如何办理
一比一原版美国北卡罗莱纳大学毕业证如何办理一比一原版美国北卡罗莱纳大学毕业证如何办理
一比一原版美国北卡罗莱纳大学毕业证如何办理
A
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
pxcywzqs
 
一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理
F
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
ayvbos
 
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
c6eb683559b3
 

Recently uploaded (20)

一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
 
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
 
Loker Pemandu Lagu LC Semarang 085746015303
Loker Pemandu Lagu LC Semarang 085746015303Loker Pemandu Lagu LC Semarang 085746015303
Loker Pemandu Lagu LC Semarang 085746015303
 
Washington Football Commanders Redskins Feathers Shirt
Washington Football Commanders Redskins Feathers ShirtWashington Football Commanders Redskins Feathers Shirt
Washington Football Commanders Redskins Feathers Shirt
 
一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样
一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样
一比一原版(USYD毕业证书)悉尼大学毕业证原件一模一样
 
一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样
一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样
一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样
 
一比一原版澳大利亚迪肯大学毕业证如何办理
一比一原版澳大利亚迪肯大学毕业证如何办理一比一原版澳大利亚迪肯大学毕业证如何办理
一比一原版澳大利亚迪肯大学毕业证如何办理
 
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
 
一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理
 
一比一原版贝德福特大学毕业证学位证书
一比一原版贝德福特大学毕业证学位证书一比一原版贝德福特大学毕业证学位证书
一比一原版贝德福特大学毕业证学位证书
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
如何办理(UCLA毕业证)加州大学洛杉矶分校毕业证成绩单本科硕士学位证留信学历认证
如何办理(UCLA毕业证)加州大学洛杉矶分校毕业证成绩单本科硕士学位证留信学历认证如何办理(UCLA毕业证)加州大学洛杉矶分校毕业证成绩单本科硕士学位证留信学历认证
如何办理(UCLA毕业证)加州大学洛杉矶分校毕业证成绩单本科硕士学位证留信学历认证
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
 
一比一原版美国北卡罗莱纳大学毕业证如何办理
一比一原版美国北卡罗莱纳大学毕业证如何办理一比一原版美国北卡罗莱纳大学毕业证如何办理
一比一原版美国北卡罗莱纳大学毕业证如何办理
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
 
Lowongan Kerja LC Yogyakarta Terbaru 085746015303
Lowongan Kerja LC Yogyakarta Terbaru 085746015303Lowongan Kerja LC Yogyakarta Terbaru 085746015303
Lowongan Kerja LC Yogyakarta Terbaru 085746015303
 

Algorithm-RepetitionSentinellNestedLoop_Solution.pptx

  • 1. Algorithm: Repetition- Sentinel Loop And Nested Loop ISB 10103 PRINCIPLES OF COMPUTER PROGRAMMING 1
  • 2. Objectives In this chapter you will be able to : • Introduce sentinel value in loop • Variations of Loop implementation as in Java Syntax using Sentinel value • Introduce Nested loop 2
  • 3. Sentinel-controlled Loop • Sentinel-controlled repetition is sometimes called indefinite repetition because it is not known in advance how many times the loop will be executed. • It is a repetition procedure for solving a problem by using a sentinel value (also called a signal value, a dummy value or a flag value) to indicate "end of data entry". • Eg: • DOWHILE( loop <> 0) , DOWHILE ( number <>99 ) 3
  • 4. Check Point 1: 4 Example 1: Problem Using loop, display a string constant of “Hello”. Stop the loop until user enter 99. After all the task is finished, display “Done !” Check Your Answer ? INPUT PROCESS OUTPUT
  • 5. True Pseudocode Display_Hello Use loop as integer Prompt for loop Get loop DOWHILE (loop<>99) Display message “Hello” Prompt for loop Get loop ENDDO Display message “Done” END 5 Initialization Testing Update Flowchart Start Stop Use loop as integer Prompt for loop Get loop DOWHILE (loop<>99) Display message “Hello” Prompt for loop Get loop False
  • 6. Pseudocode Java Codes : while ( ) 6
  • 7. Comparison of all Loop syntax: do..while( ) 7 • Check Point: • What is the output when you entered the following input? • A. 1,2,3,99 ? • B. 10,99 ? • C.99 ?
  • 8. Comparison of all Loop syntax: for ( ) 8 • Check Point: • What is the output when you entered the following input? • A. 3, 99 ? • B. 99? • What should you change, if the program must stop when user enter 0 ?
  • 9. Nested Loop Function & Syntax • It can be defined as a loop within a loop • Just like a nest  9 Questions: 1. How many time(s) the outer loop shall be executed? 2. How many time(s) the inner loop shall be executed? 3. What is output from this nested loop?
  • 11. Nested Loop- Case Study[Multiplication Table] 11 Questions: 1. How many time(s) the outer loop shall be executed? 2. How many time(s) the inner loop shall be executed? 3. What is output from this nested loop?
  • 12. Nested Loop- Case Study[Multiplication Table] 12 It will display a 1*12 multiplication table until 12 !!!!
  • 13. Check Point - Nested Loop – Write Java Codes • Create your own multiplication table to display the following table using nested loop: 13 Questions: 1. What is outer loop control variable statement? 2. How many times the outer loop should repeat? 3. What is the inner loop control variable statement? 4. How many times the inner loop should repeat?
  • 14. Java Code _possible solution for(loop=1;loop<=3;loop++) { System.out.println(“Multiplication table : ”+loop); for(nestLoop=1;nestLoop<=5;nestLoop++) { System.out.println(loop+”*”+nestLoop+”=”+ loop*nestLoop); } //end of inner loop }//end of outer loop 14
  • 15. Nested Loop- Tracing Output 1 for (loop=1;loop<=3;loop++) { for(inLoop=1;inLoop<=2;inLoop++) { //total=loop*2 >>arithmetic operation System.out.println(“Value is” + loop*2); } System.out.println(“@@@@@”); } System.out.println(“Thank you”); 15 Check Point 1: 1. What is the name of loop control variable for the outer loop statements? loop 2. What is the name of loop control variable for the inner loop statements? inLoop 3. What is the output for the following statements?
  • 16. Dry run Table – Tracing Output 1 16 loop loop<=3 loop++ inLoop inLoop<=2 inLoop++ Output 1 1<=3?True 1+1=2 1 1<=2? True 1+1=2 Value is 2 2 2<=2?True 2+1 =3 Value is 2 3 3<=2? False @@@@@ 2 2<=3?True 2+1=3 1 1<=2? True 1+1=2 Value is 4 2 2<=2?True 2+1=3 Value is 4 3 3<=2? False @@@@@ 3 3<=3? True 3+1=4 1 1<=2? True 1+1=2 Value is 6 2 2<=2?True 2+1=3 Value is 6 3 3<=2? False @@@@@ 4 4<=3? False Thank you
  • 17. Nested Loop- Tracing Output 2 for (loop=1;loop<=2;loop++) { for(inLoop=1;inLoop<=4;inLoop++) { System.out.println(“Inner is” + inLoop); } //end of inLoop System.out.println(“@@@@@”); System.out.println(“Outer loop:”+loop); } //end of loop System.out.println(“Thank You. End of Code”); 17 Check Point 2: 1. What is the name of loop control variable for the outer loop statements? loop 2. What is the name of loop control variable for the inner loop statements? inloop 3. What is the output for the following statements?
  • 18. 18 Dry run Table – Execute Java ??? loop loop<=2 loop++ inLoop inLoop<=4 inLoop++ Output
  • 19. Home work: Check Point Nested Loop &Array • Question 1 • Display yearly total sales from 4 teams of Atomie Marketing&Sales Network Company. Each team will need to input their monthly sales. • Produce IPO, Pseudocode, Flowchart and Java. Use nested loop. • Question 2 • Modify the java code so that it will use Array to store data 19
  • 20. Home work: Check Point Nested Loop – Pseudocode? 20 Input Process Output monthlySales Using nested loop, display yearly total sales from 4 teams of Atomie Marketing&Sales Network Company. Each team will need to input their monthly sales. yearlyTotalSales
  • 22. Check Point 1 • Design an algorithm that will prompt for your age in years and months. Calculate and display your age in months. If the calculated months figure is more than 500, three asterisks should also appear beside the month figure. Your program is to continue processing until a sentinel of 999 is entered. 22 INPUT PROCESS OUTPUT Check Your Answer ?
  • 23. Check Point 2 • Design an algorithm that will prompt for total collection of payroll amount entered by branch manager of Sushi King Company until a sentinel amount of -99 is entered. After the sentinel has been entered, display the total payroll amount. 23 INPUT PROCESS OUTPUT Check Your Answer ?