The Intergalactic Financial Bureau (IFB) has devised a method for evaluating the financial stability of space colonies based on their economic indicators. Each colony is assigned a unique economic code, and the IFB wants to develop a program to classify these codes as either "prosperous" or "struggling." The classification mechanism is as follows: Find the sum of the digits in the economic code. If the sum is a multiple of 7, the colony is considered prosperous; otherwise, it's considered struggling. Example 1: Economic Code: 12345 Step 1. Sum of digits: 1+2+3+4+5=15 Step 2. 15 is not a multiple of 7; therefore, the colony with the economic code 12345 is struggling. Example 2: Economic Code: 987654 Step 1. Sum of digits: 9 +8+7+6+5+4=39 Step 2.39 is not a multiple of 7; therefore, the colony with the economic code 987654 is struggling. Your task is to create a program that reads economic codes from user input and categorizes them as "prosperous" or "struggling." The program should have two arrays to store prosperous and struggling colonies, each with a maximum size of 20. The program should continue asking for economic codes until the user enters O, at which point it should display the arrays and terminate. Error handling for non-numeric inputs is not required.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Don't you dare give me AI generated answer or plagiarised answer. If I see these things I'll give you multiple downvotes and will report immediately.
The Intergalactic Financial Bureau (IFB) has devised a method for evaluating the
financial stability of space colonies based on their economic indicators. Each colony
is assigned a unique economic code, and the IFB wants to develop a program to
classify these codes as either "prosperous" or "struggling."
The classification mechanism is as follows:
Find the sum of the digits in the economic code.
If the sum is a multiple of 7, the colony is considered prosperous; otherwise, it's
considered struggling.
Example 1:
Economic Code: 12345
Step 1. Sum of digits: 1+2+3+4+5=15
Step 2.15 is not a multiple of 7; therefore, the colony with the economic code 12345 is
struggling.
Example 2:
Economic Code: 987654
Step 1. Sum of digits: 9 +8+7+6+5+4=39
Step 2. 39 is not a multiple of 7; therefore, the colony with the economic code 987654
is struggling.
Your task is to create a program that reads economic codes from user input and
categorizes them as "prosperous" or "struggling." The program should have two
arrays to store prosperous and struggling colonies, each with a maximum size of 20.
The program should continue asking for economic codes until the user enters O, at
which point it should display the arrays and terminate. Error handling for non-numeric
inputs is not required.
Transcribed Image Text:The Intergalactic Financial Bureau (IFB) has devised a method for evaluating the financial stability of space colonies based on their economic indicators. Each colony is assigned a unique economic code, and the IFB wants to develop a program to classify these codes as either "prosperous" or "struggling." The classification mechanism is as follows: Find the sum of the digits in the economic code. If the sum is a multiple of 7, the colony is considered prosperous; otherwise, it's considered struggling. Example 1: Economic Code: 12345 Step 1. Sum of digits: 1+2+3+4+5=15 Step 2.15 is not a multiple of 7; therefore, the colony with the economic code 12345 is struggling. Example 2: Economic Code: 987654 Step 1. Sum of digits: 9 +8+7+6+5+4=39 Step 2. 39 is not a multiple of 7; therefore, the colony with the economic code 987654 is struggling. Your task is to create a program that reads economic codes from user input and categorizes them as "prosperous" or "struggling." The program should have two arrays to store prosperous and struggling colonies, each with a maximum size of 20. The program should continue asking for economic codes until the user enters O, at which point it should display the arrays and terminate. Error handling for non-numeric inputs is not required.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY