Friday, October 4, 2019

Year Level Checker Using Switch Statement in C++

A simple program that I wrote using a switch statement to check if the given year level of the students belongs to freshmen, sophomore, juniors, seniors and invalid year level if the given year level does not belong to the group of values using C++.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.


My personal website is http://www.jakerpomperada.com.







Sample Program Output


Program Listing

switch_example.cpp

#include <iostream>

using namespace std;


int main() {
int year_level=0;
cout << "\tYear Level Checker Using Switch Statement in C++";
cout << "\n\n";
cout << "\tWhat is your year level? :";
cin >> year_level;
cout << "\n\n";
switch(year_level) {
case 1 : cout <<"\tYou belong to Freshmen.";
         break;
case 2 : cout <<"\tYou belong to Sophomore.";
         break;
case 3 : cout <<"\tYou belong to Juniors.";
         break;
case 4 : cout <<"\tYou belong to Seniors.";
         break;
default  : cout << "\tInvalid Year Level. Try Again";         
}
cout <<"\n\n";
cout <<"\tEnd of Program";
return 0;
}





No comments:

Post a Comment