SlideShare uma empresa Scribd logo
1 de 1
Baixar para ler offline
6) This exercise uses sub-algorithms. Trace it for when input value is 6 and complete the trace
tables. Also note that there are two variables name num, one in the main algorithm and another in
the sub-algorithm. They are not related. Assume input is a positive integer. Write pre-post-
conditions for each of these algorithms (the main one and the sub-algorithm). Note that the prime
sub-algorithm is similar to the algorithm in Ex 1) but instead of reading input and producing
outputs, it has a parameter num, and it returns the result. Also note that the =true is in gray color,
which means it can be ignored. Note that since the sub-program is called several times, it's better
that you use separate trace tables, one for each call, as shown below.

Mais conteúdo relacionado

Mais de Acro1988

7 Aadakilerden hangisi mikroekonomik bir konudur A ind.pdf
7 Aadakilerden hangisi mikroekonomik bir konudur  A ind.pdf7 Aadakilerden hangisi mikroekonomik bir konudur  A ind.pdf
7 Aadakilerden hangisi mikroekonomik bir konudur A ind.pdfAcro1988
 
7 A recent study by Mkare et al 2017 on population stru.pdf
7 A recent study by Mkare et al 2017 on population stru.pdf7 A recent study by Mkare et al 2017 on population stru.pdf
7 A recent study by Mkare et al 2017 on population stru.pdfAcro1988
 
6b Besides Crater Lake give another example on Earth of thi.pdf
6b Besides Crater Lake give another example on Earth of thi.pdf6b Besides Crater Lake give another example on Earth of thi.pdf
6b Besides Crater Lake give another example on Earth of thi.pdfAcro1988
 
6 Write a Python functoion that takes in a dictionary and p.pdf
6 Write a Python functoion that takes in a dictionary and p.pdf6 Write a Python functoion that takes in a dictionary and p.pdf
6 Write a Python functoion that takes in a dictionary and p.pdfAcro1988
 
6710 Let X1X2Xn be a random sample from a distribution.pdf
6710 Let X1X2Xn be a random sample from a distribution.pdf6710 Let X1X2Xn be a random sample from a distribution.pdf
6710 Let X1X2Xn be a random sample from a distribution.pdfAcro1988
 
60 A difference between a ListBox and a dropdown style Com.pdf
60 A difference between a ListBox and a dropdown style Com.pdf60 A difference between a ListBox and a dropdown style Com.pdf
60 A difference between a ListBox and a dropdown style Com.pdfAcro1988
 
62 of 71 delegates in a political convention favored changi.pdf
62 of 71 delegates in a political convention favored changi.pdf62 of 71 delegates in a political convention favored changi.pdf
62 of 71 delegates in a political convention favored changi.pdfAcro1988
 
64 of owned dogs in the United States are spayed or neutere.pdf
64 of owned dogs in the United States are spayed or neutere.pdf64 of owned dogs in the United States are spayed or neutere.pdf
64 of owned dogs in the United States are spayed or neutere.pdfAcro1988
 
6 Farly scientists tried to determine the age of Zarth usin.pdf
6 Farly scientists tried to determine the age of Zarth usin.pdf6 Farly scientists tried to determine the age of Zarth usin.pdf
6 Farly scientists tried to determine the age of Zarth usin.pdfAcro1988
 
6 Using your own words explain the pathophysiology of DIC .pdf
6 Using your own words explain the pathophysiology of DIC .pdf6 Using your own words explain the pathophysiology of DIC .pdf
6 Using your own words explain the pathophysiology of DIC .pdfAcro1988
 
62 A 10yearold boy is admitted with pallor His CBC shows.pdf
62 A 10yearold boy is admitted with pallor His CBC shows.pdf62 A 10yearold boy is admitted with pallor His CBC shows.pdf
62 A 10yearold boy is admitted with pallor His CBC shows.pdfAcro1988
 
63 Consider the loop in the program of Figure 28 Assume i.pdf
63 Consider the loop in the program of Figure 28 Assume i.pdf63 Consider the loop in the program of Figure 28 Assume i.pdf
63 Consider the loop in the program of Figure 28 Assume i.pdfAcro1988
 
6 Write a shell script lsmorebash that displays the file.pdf
6 Write a shell script lsmorebash that displays the file.pdf6 Write a shell script lsmorebash that displays the file.pdf
6 Write a shell script lsmorebash that displays the file.pdfAcro1988
 
6 X1X2X35 are normal random variables with mean and va.pdf
6 X1X2X35 are normal random variables with mean  and va.pdf6 X1X2X35 are normal random variables with mean  and va.pdf
6 X1X2X35 are normal random variables with mean and va.pdfAcro1988
 
6 Name and describe three ways in which cells can drive act.pdf
6 Name and describe three ways in which cells can drive act.pdf6 Name and describe three ways in which cells can drive act.pdf
6 Name and describe three ways in which cells can drive act.pdfAcro1988
 
6 Who developed Data Encryption Standard DES Your answ.pdf
6 Who developed Data Encryption Standard  DES Your answ.pdf6 Who developed Data Encryption Standard  DES Your answ.pdf
6 Who developed Data Encryption Standard DES Your answ.pdfAcro1988
 
6 Describe the features of the function in the graph and cr.pdf
6 Describe the features of the function in the graph and cr.pdf6 Describe the features of the function in the graph and cr.pdf
6 Describe the features of the function in the graph and cr.pdfAcro1988
 
6 Psychologists believe that teenagers use of Facebook incr.pdf
6 Psychologists believe that teenagers use of Facebook incr.pdf6 Psychologists believe that teenagers use of Facebook incr.pdf
6 Psychologists believe that teenagers use of Facebook incr.pdfAcro1988
 
6 KDEL dizisinin sinyal dizisinin ve nkleer lokalizasyon .pdf
6 KDEL dizisinin sinyal dizisinin ve nkleer lokalizasyon .pdf6 KDEL dizisinin sinyal dizisinin ve nkleer lokalizasyon .pdf
6 KDEL dizisinin sinyal dizisinin ve nkleer lokalizasyon .pdfAcro1988
 
6 Give the probability of two individuals heterozygous for .pdf
6 Give the probability of two individuals heterozygous for .pdf6 Give the probability of two individuals heterozygous for .pdf
6 Give the probability of two individuals heterozygous for .pdfAcro1988
 

Mais de Acro1988 (20)

7 Aadakilerden hangisi mikroekonomik bir konudur A ind.pdf
7 Aadakilerden hangisi mikroekonomik bir konudur  A ind.pdf7 Aadakilerden hangisi mikroekonomik bir konudur  A ind.pdf
7 Aadakilerden hangisi mikroekonomik bir konudur A ind.pdf
 
7 A recent study by Mkare et al 2017 on population stru.pdf
7 A recent study by Mkare et al 2017 on population stru.pdf7 A recent study by Mkare et al 2017 on population stru.pdf
7 A recent study by Mkare et al 2017 on population stru.pdf
 
6b Besides Crater Lake give another example on Earth of thi.pdf
6b Besides Crater Lake give another example on Earth of thi.pdf6b Besides Crater Lake give another example on Earth of thi.pdf
6b Besides Crater Lake give another example on Earth of thi.pdf
 
6 Write a Python functoion that takes in a dictionary and p.pdf
6 Write a Python functoion that takes in a dictionary and p.pdf6 Write a Python functoion that takes in a dictionary and p.pdf
6 Write a Python functoion that takes in a dictionary and p.pdf
 
6710 Let X1X2Xn be a random sample from a distribution.pdf
6710 Let X1X2Xn be a random sample from a distribution.pdf6710 Let X1X2Xn be a random sample from a distribution.pdf
6710 Let X1X2Xn be a random sample from a distribution.pdf
 
60 A difference between a ListBox and a dropdown style Com.pdf
60 A difference between a ListBox and a dropdown style Com.pdf60 A difference between a ListBox and a dropdown style Com.pdf
60 A difference between a ListBox and a dropdown style Com.pdf
 
62 of 71 delegates in a political convention favored changi.pdf
62 of 71 delegates in a political convention favored changi.pdf62 of 71 delegates in a political convention favored changi.pdf
62 of 71 delegates in a political convention favored changi.pdf
 
64 of owned dogs in the United States are spayed or neutere.pdf
64 of owned dogs in the United States are spayed or neutere.pdf64 of owned dogs in the United States are spayed or neutere.pdf
64 of owned dogs in the United States are spayed or neutere.pdf
 
6 Farly scientists tried to determine the age of Zarth usin.pdf
6 Farly scientists tried to determine the age of Zarth usin.pdf6 Farly scientists tried to determine the age of Zarth usin.pdf
6 Farly scientists tried to determine the age of Zarth usin.pdf
 
6 Using your own words explain the pathophysiology of DIC .pdf
6 Using your own words explain the pathophysiology of DIC .pdf6 Using your own words explain the pathophysiology of DIC .pdf
6 Using your own words explain the pathophysiology of DIC .pdf
 
62 A 10yearold boy is admitted with pallor His CBC shows.pdf
62 A 10yearold boy is admitted with pallor His CBC shows.pdf62 A 10yearold boy is admitted with pallor His CBC shows.pdf
62 A 10yearold boy is admitted with pallor His CBC shows.pdf
 
63 Consider the loop in the program of Figure 28 Assume i.pdf
63 Consider the loop in the program of Figure 28 Assume i.pdf63 Consider the loop in the program of Figure 28 Assume i.pdf
63 Consider the loop in the program of Figure 28 Assume i.pdf
 
6 Write a shell script lsmorebash that displays the file.pdf
6 Write a shell script lsmorebash that displays the file.pdf6 Write a shell script lsmorebash that displays the file.pdf
6 Write a shell script lsmorebash that displays the file.pdf
 
6 X1X2X35 are normal random variables with mean and va.pdf
6 X1X2X35 are normal random variables with mean  and va.pdf6 X1X2X35 are normal random variables with mean  and va.pdf
6 X1X2X35 are normal random variables with mean and va.pdf
 
6 Name and describe three ways in which cells can drive act.pdf
6 Name and describe three ways in which cells can drive act.pdf6 Name and describe three ways in which cells can drive act.pdf
6 Name and describe three ways in which cells can drive act.pdf
 
6 Who developed Data Encryption Standard DES Your answ.pdf
6 Who developed Data Encryption Standard  DES Your answ.pdf6 Who developed Data Encryption Standard  DES Your answ.pdf
6 Who developed Data Encryption Standard DES Your answ.pdf
 
6 Describe the features of the function in the graph and cr.pdf
6 Describe the features of the function in the graph and cr.pdf6 Describe the features of the function in the graph and cr.pdf
6 Describe the features of the function in the graph and cr.pdf
 
6 Psychologists believe that teenagers use of Facebook incr.pdf
6 Psychologists believe that teenagers use of Facebook incr.pdf6 Psychologists believe that teenagers use of Facebook incr.pdf
6 Psychologists believe that teenagers use of Facebook incr.pdf
 
6 KDEL dizisinin sinyal dizisinin ve nkleer lokalizasyon .pdf
6 KDEL dizisinin sinyal dizisinin ve nkleer lokalizasyon .pdf6 KDEL dizisinin sinyal dizisinin ve nkleer lokalizasyon .pdf
6 KDEL dizisinin sinyal dizisinin ve nkleer lokalizasyon .pdf
 
6 Give the probability of two individuals heterozygous for .pdf
6 Give the probability of two individuals heterozygous for .pdf6 Give the probability of two individuals heterozygous for .pdf
6 Give the probability of two individuals heterozygous for .pdf
 

Último

Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
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.pptxDr. Ravikiran H M Gowda
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
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.pptxJisc
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
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).pptxmarlenawright1
 
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...Poonam Aher Patil
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
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...pradhanghanshyam7136
 
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 FellowsMebane Rash
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
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_...Pooja Bhuva
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 

Último (20)

Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
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
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.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
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
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
 
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...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
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...
 
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
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
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_...
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 

6 This exercise uses subalgorithms Trace it for when inpu.pdf

  • 1. 6) This exercise uses sub-algorithms. Trace it for when input value is 6 and complete the trace tables. Also note that there are two variables name num, one in the main algorithm and another in the sub-algorithm. They are not related. Assume input is a positive integer. Write pre-post- conditions for each of these algorithms (the main one and the sub-algorithm). Note that the prime sub-algorithm is similar to the algorithm in Ex 1) but instead of reading input and producing outputs, it has a parameter num, and it returns the result. Also note that the =true is in gray color, which means it can be ignored. Note that since the sub-program is called several times, it's better that you use separate trace tables, one for each call, as shown below.