Module2 Assign2.1 NestedIf
Module2 Assign2.1 NestedIf
QUEZON CITY
COLLEGE OF INFORMATION TECHNOLOGY EDUCATION (CITE)
ITE001- Computer Programming 1
SAMPLE PROGRAM ONLY : Selection Control Structure using Nested If condition ( NOT GRADED)
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 input year level and status base on the table below. The output
should be based on the possible combination of year level and status.
GENDER AGE
INPUT OUTPUT INPUT OUTPUT
F or f Female 1 to 17 Minor
M or m Male 18 to 59 Adult
Other 60 and
Invalid Senior
input above
Others 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<<" \nInvalid & Invalid";
}
}
TECHNOLOGICAL INSTITUTE OF THE PHILIPPINES
QUEZON CITY
COLLEGE OF INFORMATION TECHNOLOGY EDUCATION (CITE)
ITE001- Computer Programming 1
NAME: CANDELARIO, Lovely B.
PROGRAM/SECTION: IT11S2-A21
ASSESSMENT TASK: Selection Control Structure using Nested If () Condition (GRADED)
The following question supports 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 input year level and status based on the table below. The output
should be based on the possible combination of year level and status.
Sample Output(1):
Name : Juan Cruz
Section: IT11S1
Enter Year Level : 1
Enter Status :r
The student is First Year and Regular
#include<iostream>
main()
cout<<("\nSection: IT11S2-A21");
if ( year == 1)
else if ( year == 2)
else if ( year == 3)
else if ( year == 4)
else cout<<"Invalid";
if ( year == 1)
cout<<" \nThe student is First Year and Irregular";
else if ( year == 2)
else if ( year == 3)
else cout<<"Invalid";
else {
if ( year == 1)
else if ( year == 2)
else if ( year == 3)
else cout<<"Invalid";
2. OUTPUT: Show two(2) sample output - one combination of year level and status and one show
invalid combination.
Honor Pledge
“I affirm that I have not given or received any unauthorized help on this
assignment and that this work is my own.”