SlideShare a Scribd company logo
TO Buy the Tutorial Visit Our Website

COMP 122
Week 3 iLab
Complete the following two programs:
Programming Problem 1
Write a program that generates all the factors of a number entered by the user.
For instance, the number 12 has the factors 2 * 2 * 3. This program has the
following requirements:
A. The user must enter a positive integer. If the user enters something else, your
program should output an error message and let the user enter a new value. Use
a do/while loop to make sure the user input is successful.
B. The factors must be output in increasing order. The lowest factor your
program should report is 2.
C. Your program should output 4 factors per line, each factor in a field of 10
characters. (Hint: the number of factors output determines when to output endl!)
D. You will need a while loop to report the factors. Here are some helpful hints:
1. If (a % b == 0) then a is a factor of b.
2. When you have found a factor, output the factor and then reduce the number
you are working with by dividing the number by the factor… ie) / a;
1. Design an algorithm in pseudocode to solve the problem. Make sure to
include steps to get each input and to report the output. Include steps to deal
with error cases as specified above.
2. Identify three test cases, one using a number with 4 factors, one using a
negative number, and one using a number with more than 4 factors. For each of
the three test cases show what inputs you will use and what your expected
outputs should be.
3. Write the program to implement your algorithm. Test your program using
your test cases.
Programming Problem 2
This program is designed to analyze the growth of two cities. Each city has a
starting population and annual growth rate. The smaller city has the larger
growth rate (required). Show the comparative populations of each city year by
year until the smaller city has grown larger than the bigger city.
As an example, Dogville has a population of 5000 growing at 20% annually
while Cattown has a population of 7000 growing at 10% annually. The
projected populations are:
Year DogvilleCattown
1 6000 7700
2 7200 8470
3 8640 9317
4 10368 10249
1. Identify the inputs and outputs of the problem.
2. Identify the processing needed to convert the inputs to the outputs
3. Design an algorithm in pseudocode to solve the problem. Make sure to
include steps to get each input and to report each output.
4. Identify three significant test cases including one for incorrect input (ie Small
town has lower growth rate). For each of the three test cases show what inputs
you will use and calculate what your expected outputs should be.
5. Write the program to implement your algorithm. Test your program using
your test cases.

More Related Content

What's hot (19)

Fundamental
FundamentalFundamental
Fundamental
guest579258
 
Financial modeling & coding
Financial modeling  & coding Financial modeling  & coding
Financial modeling & coding
Johnsmith5188
 
Project 19: Class scores Write a program that calculates the total grade for ...
Project 19: Class scores Write a program that calculates the total grade for ...Project 19: Class scores Write a program that calculates the total grade for ...
Project 19: Class scores Write a program that calculates the total grade for ...
hwbloom149
 
Computer Arithmetic (Part 3)
Computer Arithmetic (Part 3)Computer Arithmetic (Part 3)
Computer Arithmetic (Part 3)
Ajeng Savitri
 
Using IPython to Find Correlation
Using IPython to Find CorrelationUsing IPython to Find Correlation
Using IPython to Find Correlation
ORAMI THAILAND
 
PYTHON PROGRAMS
PYTHON PROGRAMSPYTHON PROGRAMS
PYTHON PROGRAMS
Alvino rock
 
Intro to Google Prediction API
Intro to Google Prediction APIIntro to Google Prediction API
Intro to Google Prediction API
Gabriel Hamilton
 
DOSUG Intro to google prediction api
DOSUG Intro to google prediction apiDOSUG Intro to google prediction api
DOSUG Intro to google prediction api
Gabriel Hamilton
 
Lab no 3 haris
Lab no 3 harisLab no 3 haris
Lab no 3 haris
Abu-ul-Haris
 
C programming exercises and solutions
C programming exercises and solutions C programming exercises and solutions
C programming exercises and solutions
Rumman Ansari
 
Md university cmis 102 week 3 hands
Md university cmis 102 week 3 handsMd university cmis 102 week 3 hands
Md university cmis 102 week 3 hands
eyavagal
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
Tanveer Malik
 
Calc. Practice 3 (1º ESO)
Calc. Practice 3 (1º ESO)Calc. Practice 3 (1º ESO)
Calc. Practice 3 (1º ESO)
jesmope
 
3.4 wrting exponential functions
3.4 wrting exponential functions3.4 wrting exponential functions
3.4 wrting exponential functions
hisema01
 
Final exam management 2019
Final exam management 2019Final exam management 2019
Final exam management 2019
cairo university
 
Dti2143 lab sheet 6
Dti2143 lab sheet 6Dti2143 lab sheet 6
Dti2143 lab sheet 6
alish sha
 
Cis 355 i lab 3 of 6
Cis 355 i lab 3 of 6Cis 355 i lab 3 of 6
Cis 355 i lab 3 of 6
helpido9
 
Exercise6 ch2
Exercise6 ch2Exercise6 ch2
Exercise6 ch2
IIUM
 
programming for programs solving using C language
programming for  programs solving using C languageprogramming for  programs solving using C language
programming for programs solving using C language
sushma chinta
 
Financial modeling & coding
Financial modeling  & coding Financial modeling  & coding
Financial modeling & coding
Johnsmith5188
 
Project 19: Class scores Write a program that calculates the total grade for ...
Project 19: Class scores Write a program that calculates the total grade for ...Project 19: Class scores Write a program that calculates the total grade for ...
Project 19: Class scores Write a program that calculates the total grade for ...
hwbloom149
 
Computer Arithmetic (Part 3)
Computer Arithmetic (Part 3)Computer Arithmetic (Part 3)
Computer Arithmetic (Part 3)
Ajeng Savitri
 
Using IPython to Find Correlation
Using IPython to Find CorrelationUsing IPython to Find Correlation
Using IPython to Find Correlation
ORAMI THAILAND
 
Intro to Google Prediction API
Intro to Google Prediction APIIntro to Google Prediction API
Intro to Google Prediction API
Gabriel Hamilton
 
DOSUG Intro to google prediction api
DOSUG Intro to google prediction apiDOSUG Intro to google prediction api
DOSUG Intro to google prediction api
Gabriel Hamilton
 
C programming exercises and solutions
C programming exercises and solutions C programming exercises and solutions
C programming exercises and solutions
Rumman Ansari
 
Md university cmis 102 week 3 hands
Md university cmis 102 week 3 handsMd university cmis 102 week 3 hands
Md university cmis 102 week 3 hands
eyavagal
 
Calc. Practice 3 (1º ESO)
Calc. Practice 3 (1º ESO)Calc. Practice 3 (1º ESO)
Calc. Practice 3 (1º ESO)
jesmope
 
3.4 wrting exponential functions
3.4 wrting exponential functions3.4 wrting exponential functions
3.4 wrting exponential functions
hisema01
 
Final exam management 2019
Final exam management 2019Final exam management 2019
Final exam management 2019
cairo university
 
Dti2143 lab sheet 6
Dti2143 lab sheet 6Dti2143 lab sheet 6
Dti2143 lab sheet 6
alish sha
 
Cis 355 i lab 3 of 6
Cis 355 i lab 3 of 6Cis 355 i lab 3 of 6
Cis 355 i lab 3 of 6
helpido9
 
Exercise6 ch2
Exercise6 ch2Exercise6 ch2
Exercise6 ch2
IIUM
 
programming for programs solving using C language
programming for  programs solving using C languageprogramming for  programs solving using C language
programming for programs solving using C language
sushma chinta
 

Similar to Comp 122 lab 3 lab report and source code (20)

COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEW
shyamuopeight
 
Important C program of Balagurusamy Book
Important C program of Balagurusamy BookImportant C program of Balagurusamy Book
Important C program of Balagurusamy Book
Abir Hossain
 
Basic pogramming concepts
Basic pogramming conceptsBasic pogramming concepts
Basic pogramming concepts
Anurag Prajapat
 
Csci101 lect07 algorithms_ii
Csci101 lect07 algorithms_iiCsci101 lect07 algorithms_ii
Csci101 lect07 algorithms_ii
Elsayed Hemayed
 
C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2
Animesh Chaturvedi
 
Xi CBSE Computer Science lab programs
Xi CBSE Computer Science lab programsXi CBSE Computer Science lab programs
Xi CBSE Computer Science lab programs
Prof. Dr. K. Adisesha
 
Problem solving and design
Problem solving and designProblem solving and design
Problem solving and design
Renée Howard-Johnson
 
Java Practice Set
Java Practice SetJava Practice Set
Java Practice Set
Gaurav Dixit
 
Aguirre.Module2.Problemset.pdf
Aguirre.Module2.Problemset.pdfAguirre.Module2.Problemset.pdf
Aguirre.Module2.Problemset.pdf
CarlChristopherFunda
 
Sasin nisar
Sasin nisarSasin nisar
Sasin nisar
SasinNisar
 
C Programming Example
C Programming ExampleC Programming Example
C Programming Example
PRATHAMESH DESHPANDE
 
Cse cpl manual-2016
Cse cpl manual-2016Cse cpl manual-2016
Cse cpl manual-2016
Rajendra khatana
 
L- 14. 0 Algorithm_Flowchart_Example.pdf
L- 14. 0 Algorithm_Flowchart_Example.pdfL- 14. 0 Algorithm_Flowchart_Example.pdf
L- 14. 0 Algorithm_Flowchart_Example.pdf
TonmoyIslam16
 
Sample Program file class 11.pdf
Sample Program file class 11.pdfSample Program file class 11.pdf
Sample Program file class 11.pdf
YashMirge2
 
Chapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docxChapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docx
tiffanyd4
 
CSE 115 l project
CSE 115 l projectCSE 115 l project
CSE 115 l project
Mohin Ibn Mohammad
 
The problem statement
The problem statementThe problem statement
The problem statement
Stephon Dookhan
 
Common problems solving using c
Common problems solving using cCommon problems solving using c
Common problems solving using c
ArghodeepPaul
 
Unit1 jwfiles
Unit1 jwfilesUnit1 jwfiles
Unit1 jwfiles
mrecedu
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
Jesuraj Love
 
COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEW
shyamuopeight
 
Important C program of Balagurusamy Book
Important C program of Balagurusamy BookImportant C program of Balagurusamy Book
Important C program of Balagurusamy Book
Abir Hossain
 
Basic pogramming concepts
Basic pogramming conceptsBasic pogramming concepts
Basic pogramming concepts
Anurag Prajapat
 
Csci101 lect07 algorithms_ii
Csci101 lect07 algorithms_iiCsci101 lect07 algorithms_ii
Csci101 lect07 algorithms_ii
Elsayed Hemayed
 
C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2
Animesh Chaturvedi
 
Xi CBSE Computer Science lab programs
Xi CBSE Computer Science lab programsXi CBSE Computer Science lab programs
Xi CBSE Computer Science lab programs
Prof. Dr. K. Adisesha
 
L- 14. 0 Algorithm_Flowchart_Example.pdf
L- 14. 0 Algorithm_Flowchart_Example.pdfL- 14. 0 Algorithm_Flowchart_Example.pdf
L- 14. 0 Algorithm_Flowchart_Example.pdf
TonmoyIslam16
 
Sample Program file class 11.pdf
Sample Program file class 11.pdfSample Program file class 11.pdf
Sample Program file class 11.pdf
YashMirge2
 
Chapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docxChapter 8Exercise1.Design an application that accept.docx
Chapter 8Exercise1.Design an application that accept.docx
tiffanyd4
 
Common problems solving using c
Common problems solving using cCommon problems solving using c
Common problems solving using c
ArghodeepPaul
 
Unit1 jwfiles
Unit1 jwfilesUnit1 jwfiles
Unit1 jwfiles
mrecedu
 
Algorithmsandflowcharts1
Algorithmsandflowcharts1Algorithmsandflowcharts1
Algorithmsandflowcharts1
Jesuraj Love
 
Ad

Recently uploaded (20)

Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...
Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...
Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...
Rajdeep Bavaliya
 
How to Manage Inventory Movement in Odoo 18 POS
How to Manage Inventory Movement in Odoo 18 POSHow to Manage Inventory Movement in Odoo 18 POS
How to Manage Inventory Movement in Odoo 18 POS
Celine George
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdfBlack and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
Vikas Bansal Himachal Pradesh: A Visionary Transforming Himachal’s Educationa...
Vikas Bansal Himachal Pradesh: A Visionary Transforming Himachal’s Educationa...Vikas Bansal Himachal Pradesh: A Visionary Transforming Himachal’s Educationa...
Vikas Bansal Himachal Pradesh: A Visionary Transforming Himachal’s Educationa...
Himalayan Group of Professional Institutions (HGPI)
 
How to Manage Multi Language for Invoice in Odoo 18
How to Manage Multi Language for Invoice in Odoo 18How to Manage Multi Language for Invoice in Odoo 18
How to Manage Multi Language for Invoice in Odoo 18
Celine George
 
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition IILDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDM & Mia eStudios
 
Capitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptxCapitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptx
CapitolTechU
 
BINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptxBINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptx
Ramakrishna Reddy Bijjam
 
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
 
Revista digital preescolar en transformación
Revista digital preescolar en transformaciónRevista digital preescolar en transformación
Revista digital preescolar en transformación
guerragallardo26
 
LDMMIA Spring Ending Guest Grad Student News
LDMMIA Spring Ending Guest Grad Student NewsLDMMIA Spring Ending Guest Grad Student News
LDMMIA Spring Ending Guest Grad Student News
LDM & Mia eStudios
 
LDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation SamplerLDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation Sampler
LDM & Mia eStudios
 
Introduction to Generative AI and Copilot.pdf
Introduction to Generative AI and Copilot.pdfIntroduction to Generative AI and Copilot.pdf
Introduction to Generative AI and Copilot.pdf
TechSoup
 
GEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdfGEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdf
SHERAZ AHMAD LONE
 
How to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 EmployeeHow to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 Employee
Celine George
 
Overview of Off Boarding in Odoo 18 Employees
Overview of Off Boarding in Odoo 18 EmployeesOverview of Off Boarding in Odoo 18 Employees
Overview of Off Boarding in Odoo 18 Employees
Celine George
 
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdfFEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
ChristinaFortunova
 
How to Create an Event in Odoo 18 - Odoo 18 Slides
How to Create an Event in Odoo 18 - Odoo 18 SlidesHow to Create an Event in Odoo 18 - Odoo 18 Slides
How to Create an Event in Odoo 18 - Odoo 18 Slides
Celine George
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptxAnalysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
Allomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdfAllomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdf
Abha Pandey
 
Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...
Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...
Paper 109 | Archetypal Journeys in ‘Interstellar’: Exploring Universal Themes...
Rajdeep Bavaliya
 
How to Manage Inventory Movement in Odoo 18 POS
How to Manage Inventory Movement in Odoo 18 POSHow to Manage Inventory Movement in Odoo 18 POS
How to Manage Inventory Movement in Odoo 18 POS
Celine George
 
Black and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdfBlack and White Illustrative Group Project Presentation.pdf (1).pdf
Black and White Illustrative Group Project Presentation.pdf (1).pdf
AnnasofiaUrsini
 
How to Manage Multi Language for Invoice in Odoo 18
How to Manage Multi Language for Invoice in Odoo 18How to Manage Multi Language for Invoice in Odoo 18
How to Manage Multi Language for Invoice in Odoo 18
Celine George
 
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition IILDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDM & Mia eStudios
 
Capitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptxCapitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptx
CapitolTechU
 
BINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptxBINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptx
Ramakrishna Reddy Bijjam
 
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
 
Revista digital preescolar en transformación
Revista digital preescolar en transformaciónRevista digital preescolar en transformación
Revista digital preescolar en transformación
guerragallardo26
 
LDMMIA Spring Ending Guest Grad Student News
LDMMIA Spring Ending Guest Grad Student NewsLDMMIA Spring Ending Guest Grad Student News
LDMMIA Spring Ending Guest Grad Student News
LDM & Mia eStudios
 
LDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation SamplerLDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation Sampler
LDM & Mia eStudios
 
Introduction to Generative AI and Copilot.pdf
Introduction to Generative AI and Copilot.pdfIntroduction to Generative AI and Copilot.pdf
Introduction to Generative AI and Copilot.pdf
TechSoup
 
GEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdfGEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdf
SHERAZ AHMAD LONE
 
How to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 EmployeeHow to Manage & Create a New Department in Odoo 18 Employee
How to Manage & Create a New Department in Odoo 18 Employee
Celine George
 
Overview of Off Boarding in Odoo 18 Employees
Overview of Off Boarding in Odoo 18 EmployeesOverview of Off Boarding in Odoo 18 Employees
Overview of Off Boarding in Odoo 18 Employees
Celine George
 
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdfFEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
ChristinaFortunova
 
How to Create an Event in Odoo 18 - Odoo 18 Slides
How to Create an Event in Odoo 18 - Odoo 18 SlidesHow to Create an Event in Odoo 18 - Odoo 18 Slides
How to Create an Event in Odoo 18 - Odoo 18 Slides
Celine George
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptxAnalysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
Allomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdfAllomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdf
Abha Pandey
 
Ad

Comp 122 lab 3 lab report and source code

  • 1. TO Buy the Tutorial Visit Our Website COMP 122 Week 3 iLab Complete the following two programs: Programming Problem 1 Write a program that generates all the factors of a number entered by the user. For instance, the number 12 has the factors 2 * 2 * 3. This program has the following requirements: A. The user must enter a positive integer. If the user enters something else, your program should output an error message and let the user enter a new value. Use a do/while loop to make sure the user input is successful. B. The factors must be output in increasing order. The lowest factor your program should report is 2. C. Your program should output 4 factors per line, each factor in a field of 10 characters. (Hint: the number of factors output determines when to output endl!) D. You will need a while loop to report the factors. Here are some helpful hints: 1. If (a % b == 0) then a is a factor of b.
  • 2. 2. When you have found a factor, output the factor and then reduce the number you are working with by dividing the number by the factor… ie) / a; 1. Design an algorithm in pseudocode to solve the problem. Make sure to include steps to get each input and to report the output. Include steps to deal with error cases as specified above. 2. Identify three test cases, one using a number with 4 factors, one using a negative number, and one using a number with more than 4 factors. For each of the three test cases show what inputs you will use and what your expected outputs should be. 3. Write the program to implement your algorithm. Test your program using your test cases. Programming Problem 2 This program is designed to analyze the growth of two cities. Each city has a starting population and annual growth rate. The smaller city has the larger growth rate (required). Show the comparative populations of each city year by year until the smaller city has grown larger than the bigger city. As an example, Dogville has a population of 5000 growing at 20% annually while Cattown has a population of 7000 growing at 10% annually. The projected populations are: Year DogvilleCattown 1 6000 7700 2 7200 8470 3 8640 9317 4 10368 10249 1. Identify the inputs and outputs of the problem. 2. Identify the processing needed to convert the inputs to the outputs
  • 3. 3. Design an algorithm in pseudocode to solve the problem. Make sure to include steps to get each input and to report each output. 4. Identify three significant test cases including one for incorrect input (ie Small town has lower growth rate). For each of the three test cases show what inputs you will use and calculate what your expected outputs should be. 5. Write the program to implement your algorithm. Test your program using your test cases.