The following program determines if someone is eligible to receive social security payments. The rules are: • If someone is less than or equal the age of 45, they are not eligible. The code outputs "NOT ELIGIBLE" • If they are above the age of 45, and have less than 180 paid monthly subscriptions, they are eligible but to half the total retirement wage. The code outputs "ELIGIBLE-LESS" • If they are above the age of 45, have paid between 181 and 360 monthly subscriptions (inclusive), then they are eligible to the total retirement wage. The code outputs "ELIGIBLE-FULL" • If they are above the age of 45, have paid more than 360 monthly subscriptions, then they are eligible to the total retirement wage plus extra. The code outputs "ELIGIBLE- MORE" The program assumes no one aged 70 or more will apply for retirement wage this late, and therefore will output the message "VISIT" to ask them to visit the social security offices to make sure of their identity. However; the code contains many errors. Correct the code below such that it has the correct output for each of the 10 hidden secret test cases.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
#include using namespace std; int main(){ float age; int subscriptions; cin>>age; switch (age/10) { case 1: cout<
The following program determines if someone
is eligible to receive social security payments.
The rules are:
• If someone is less than or equal the
age
of
45, they are not eligible. The code outputs
"NOT ELIGIBLE"
• If they are above the age of 45, and have
less than 180 paid monthly subscriptions,
they are eligible but to half the total
retirement wage. The code outputs
"ELIGIBLE-LESS"
If they are above the age of 45, have paid
between 181 and 360 monthly subscriptions
(inclusive), then they are eligible to the total
retirement wage. The code outputs
"ELIGIBLE-FULL"
If they are above the age of 45, have paid
more than 360 monthly subscriptions, then
they are eligible to the total retirement wage
plus extra. The code outputs "ELIGIBLE-
MORE"
The program assumes no one aged 70 or more
will apply for retirement wage this late, and
therefore will output the message "VISIT" to ask
them to visit the social security offices to make
sure of their identity.
However; the code contains many errors. Correct
the code below such that it has the correct
output for each of the 10 hidden secret test
cases.
Transcribed Image Text:The following program determines if someone is eligible to receive social security payments. The rules are: • If someone is less than or equal the age of 45, they are not eligible. The code outputs "NOT ELIGIBLE" • If they are above the age of 45, and have less than 180 paid monthly subscriptions, they are eligible but to half the total retirement wage. The code outputs "ELIGIBLE-LESS" If they are above the age of 45, have paid between 181 and 360 monthly subscriptions (inclusive), then they are eligible to the total retirement wage. The code outputs "ELIGIBLE-FULL" If they are above the age of 45, have paid more than 360 monthly subscriptions, then they are eligible to the total retirement wage plus extra. The code outputs "ELIGIBLE- MORE" The program assumes no one aged 70 or more will apply for retirement wage this late, and therefore will output the message "VISIT" to ask them to visit the social security offices to make sure of their identity. However; the code contains many errors. Correct the code below such that it has the correct output for each of the 10 hidden secret test cases.
Program Input:
Two values one for the age and the other
for the number of monthly subscriptions.
Program Output:
one line that contains the status of the
applicant (e.g. ELIGIBLE)
Sample Test Case 0
Input:
31
76
Output:
NOT ELIGIBLE
Sample Test Case 1
Input:
64
300
Output:
ELIGIBLE-FULL
Transcribed Image Text:Program Input: Two values one for the age and the other for the number of monthly subscriptions. Program Output: one line that contains the status of the applicant (e.g. ELIGIBLE) Sample Test Case 0 Input: 31 76 Output: NOT ELIGIBLE Sample Test Case 1 Input: 64 300 Output: ELIGIBLE-FULL
Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education