The following question support the attainment of Course Intended Learning Outcomes (CILO): Design computing based solution using control structures, functions, array and other statements. INSTRUCTION: Read and study the assignment below. Solve the problem using C++ programming language, compile, run and screen shot the correct output. Copy and paste the source code or program code and the required sample output (screen shot) in the format below. The output should also display the school name, course name, student name, program, section, date and title of assessment task. PROBLEM: Write a program that will let the user to input year level and status base on table below. The output should be based on the possible combination of year level and status. GENDER AGE OUTPU INPUT OUTPUT INPUT T F or f M or m Female 1 to 17 Minor Male 18 to 59 Adult Other 60 and above Invalid Senior input Others Invalid //Sample if , if-else and nested if #include using namespace std; main() { cout<<("*** USING NESTED IF STATEMENT ****"); cout<<("\nEnter your gender : "); cin>> gender; cout<<("\nEnter your age : "); cin>> age; if (gender == 'F'" || gender == 'f') { if ( age >=1 && age <=17) int age; char gender; cout<<" \nFemale & Minor"; else if ( age >=18 && age <=59) cout<<" \nFemale & adult"; else if (age >= 60) cout<<"\nFemale & Senior"; else cout<<"Female & Invalid"; } L else if (gender == 'M' || gender == 'm') { if ( age >=1 && age <=17) cout<<" \nMale & Minor"; else if ( age >=18 && age <=59) cout<<" \nMale & adult"; else if (age >= 60) cout<<" \nMale & Senior"; else cout<<"Male & Invalid"; else { if ( age >=1 && age <=17) cout<<" \nInvalid & Minor"; else if ( age >=18 && age <=59) cout<<" \nInvalid & adult"; else if (age >= 60) cout<<" \nInvalid & Senior"; else cout<<" \nlnvalid & Invalid"; O C:\Users\TIPQC\Desktop\UAC\C++ Program\Sample_nest.. *** USING NESTED IF STATEMENT **** Enter your gender : f Enter your age : 46 Female & adult Process exited after 16.9 seconds w Press any key to cont inue O C:\Users\TIPQC\Desktop\JAC\C++ Program,.. *** USING NESTED IF STATEMENT **** Enter your gender : n Enter your age : 12 Male & Minor Process exited after 16.28 seconds with retu Press any key to continue
The following question support the attainment of Course Intended Learning Outcomes (CILO): Design computing based solution using control structures, functions, array and other statements. INSTRUCTION: Read and study the assignment below. Solve the problem using C++ programming language, compile, run and screen shot the correct output. Copy and paste the source code or program code and the required sample output (screen shot) in the format below. The output should also display the school name, course name, student name, program, section, date and title of assessment task. PROBLEM: Write a program that will let the user to input year level and status base on table below. The output should be based on the possible combination of year level and status. GENDER AGE OUTPU INPUT OUTPUT INPUT T F or f M or m Female 1 to 17 Minor Male 18 to 59 Adult Other 60 and above Invalid Senior input Others Invalid //Sample if , if-else and nested if #include using namespace std; main() { cout<<("*** USING NESTED IF STATEMENT ****"); cout<<("\nEnter your gender : "); cin>> gender; cout<<("\nEnter your age : "); cin>> age; if (gender == 'F'" || gender == 'f') { if ( age >=1 && age <=17) int age; char gender; cout<<" \nFemale & Minor"; else if ( age >=18 && age <=59) cout<<" \nFemale & adult"; else if (age >= 60) cout<<"\nFemale & Senior"; else cout<<"Female & Invalid"; } L else if (gender == 'M' || gender == 'm') { if ( age >=1 && age <=17) cout<<" \nMale & Minor"; else if ( age >=18 && age <=59) cout<<" \nMale & adult"; else if (age >= 60) cout<<" \nMale & Senior"; else cout<<"Male & Invalid"; else { if ( age >=1 && age <=17) cout<<" \nInvalid & Minor"; else if ( age >=18 && age <=59) cout<<" \nInvalid & adult"; else if (age >= 60) cout<<" \nInvalid & Senior"; else cout<<" \nlnvalid & Invalid"; O C:\Users\TIPQC\Desktop\UAC\C++ Program\Sample_nest.. *** USING NESTED IF STATEMENT **** Enter your gender : f Enter your age : 46 Female & adult Process exited after 16.9 seconds w Press any key to cont inue O C:\Users\TIPQC\Desktop\JAC\C++ Program,.. *** USING NESTED IF STATEMENT **** Enter your gender : n Enter your age : 12 Male & Minor Process exited after 16.28 seconds with retu Press any key to continue
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
Related questions
Question

Transcribed Image Text:ASSESSMENT TASK: Sample Selection Control Structure using Nested If condition
The following question support the attainment of Course Intended Learning Outcomes
(CILO): Design computing based solution using control structures, functions, array and
other statements.
INSTRUCTION: Read and study the assignment below. Solve the problem using C++
programming language, compile, run and screen shot the correct output. Copy and
paste the source code or program code and the required sample output (screen shot) in
the format below. The output should also display the school name, course name,
student name, program, section, date and title of assessment task.
PROBLEM: Write a program that will let the user to input year level and status base on table
below. The output should be based on the possible combination of year level and status.
GENDER
AGE
OUTPU
INPUT
OUTPUT
INPUT
For f
Female
1 to 17
Minor
M or m
Male
18 to 59
Adult
Other
60 and
Invalid
Senior
input
above
Others
Invalid
//Sample if , if-else and nested if
#include<iostream>
using namespace std;
main()
{
cout<<("*** USING NESTED IF STATEMENT ****");
cout<<("\nEnter your gender : "); cin>> gender;
cout<<("\nEnter your age: "); cin>> age;
if (gender == 'F' || gender == 'f')
{ if ( age >=1 && age <=17)
int age; char gender;
cout<<" \nFemale & Minor";
else if ( age >=18 && age <=59)
cout<<" \nFemale & adult";
else if (age >= 60)
cout<<"\nFemale & Senior";
else cout<<"Female & Invalid";
}
else if (gender == 'M' || gender == 'm')
{ if ( age >=1 && age <=17)
cout<<" \nMale & Minor";
else if ( age >=18 && age <=59)
cout<<" \nMale & adult";
else if (age >= 60)
cout<<" \nMale & Senior";
else cout<<"Male & Invalid";
else
{ if ( age >=1 && age <=17)
cout<<" \nInvalid & Minor";
else if ( age >=18 && age <=59)
cout<<" \nInvalid & adult";
else if (age >= 60)
cout<<" \nlnvalid & Senior";
else
cout<<" \nlnvalid & Invalid";
I C:\Users\TIPQC\Desktop\JAC\C++ Program\Sample_nest..
*** USING NESTED IF STATEMENT ****
Enter your gender
: f
Enter your age
: 46
Female & adult
Process exited after 16.9 seconds w
Press any key to cont inue
O C:\Users\TIPQC\Desktop\JAC\C++ Program,.
*** USING NESTED IF STATEMENT
Enter your gender
****
: m
Enter your age
: 12
Male & Minor
Process exited after 16.28 seconds with retu
Press any key to continue
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 2 images

Knowledge Booster
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.Recommended textbooks for you

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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education