The Galactic Security Agency has implemented a sophisticated identification system to enhance security across the star systems. Each citizen is assigned a unique Galactic ID number, and the agency wants to develop a program to validate these IDs and classify them as either "secure" or "compromised." The validation mechanism is as follows: Take the digits at odd positions from left to right and add them up. Take the digits at even positions from left to right, multiply each one by three, and add them up. If the sum of the results from steps 1 and 2 is a prime number, the Galactic ID is considered secure; otherwise, it is compromised.

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
You guys use AI tool to answer. Last time I found plagiarism and AI detection in my answer. Now If you will use these things I'll surely give multiple downvotes and will report ⚠️ sure.
The Galactic Security Agency has implemented a sophisticated identification system
to enhance security across the star systems. Each citizen is assigned a unique
Galactic ID number, and the agency wants to develop a program to validate these IDs
and classify them as either "secure" or "compromised."
The validation mechanism is as follows:
Take the digits at odd positions from left to right and add them up.
Take the digits at even positions from left to right, multiply each one by three, and add
them up.
If the sum of the results from steps 1 and 2 is a prime number, the Galactic ID is
considered secure; otherwise, it is compromised.
Example 1:
Galactic ID: 24681357
Step 1. Take digits at odd positions: 2 +6 +1+3+ 7 = 19
Step 2. Take digits at even positions, multiply by three: 4*3+8*3+1*3 + 5*3=66
Step 3. Sum of results: 19 + 66 = 85
85 is not a prime number; therefore, Galactic ID 24681357 is compromised.
Example 2:
Galactic ID: 13579246
Step 1. Take digits at odd positions: 1+7+9+4 = 21
Step 2. Take digits at even positions, multiply by three: 3*3 + 5*3+2*3+6*3=54
Step 3. Sum of results: 21 +54 = 75
75 is not a prime number; therefore, Galactic ID 13579246 is compromised.
Your task is to create a program that reads Galactic IDs from user input and
categorizes them as "secure" or "compromised." The program should have two arrays
to store secure and compromised IDs, with a maximum size of 20. The program
should continue asking for IDs 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 Galactic Security Agency has implemented a sophisticated identification system to enhance security across the star systems. Each citizen is assigned a unique Galactic ID number, and the agency wants to develop a program to validate these IDs and classify them as either "secure" or "compromised." The validation mechanism is as follows: Take the digits at odd positions from left to right and add them up. Take the digits at even positions from left to right, multiply each one by three, and add them up. If the sum of the results from steps 1 and 2 is a prime number, the Galactic ID is considered secure; otherwise, it is compromised. Example 1: Galactic ID: 24681357 Step 1. Take digits at odd positions: 2 +6 +1+3+ 7 = 19 Step 2. Take digits at even positions, multiply by three: 4*3+8*3+1*3 + 5*3=66 Step 3. Sum of results: 19 + 66 = 85 85 is not a prime number; therefore, Galactic ID 24681357 is compromised. Example 2: Galactic ID: 13579246 Step 1. Take digits at odd positions: 1+7+9+4 = 21 Step 2. Take digits at even positions, multiply by three: 3*3 + 5*3+2*3+6*3=54 Step 3. Sum of results: 21 +54 = 75 75 is not a prime number; therefore, Galactic ID 13579246 is compromised. Your task is to create a program that reads Galactic IDs from user input and categorizes them as "secure" or "compromised." The program should have two arrays to store secure and compromised IDs, with a maximum size of 20. The program should continue asking for IDs 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 3 steps with 1 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