PUA Assign2.1 NestedIf
PUA Assign2.1 NestedIf
QUEZON CITY
ITE001 – Computer Programming 1
NAME: Pua, Lorenz Jacob B.
PROGRAM/SECTION: ITE001 / CE21S7
ASSESSMENT TASK: Selection Control Structure using Nested Switch Case Condition
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 screenshot the correct output. Copy and paste the source code or program
code and the required sample output (screenshot) in the format below. The output should also display the
school name, course name, student name, program, section, date and title of the assessment task.
PROBLEM: Write a program that will let the user to input year level and status based on the table below. The
output should be based on the possible combination of year level and status.
#include <iostream>
#include <string>
using namespace std;
int main() {
int yearLev;
char status;
string name, section;
switch (yearLev) {
case 1: cout << "First Year";
break;
case 2: cout << "Second Year";
break;
case 3: cout << "Third Year";
break;
case 4: cout << "Fourth Year";
default: cout << "Invalid Year Level";
break;
}
return 0;
}
2. OUTPUT: Show two(2) sample outputs - one combination of year level and status and one showing an
invalid combination.
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".