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.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 20PE: When you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making...
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr