Sunday, August 19, 2018

Year Level Checker Using If Statement in C++

Here is a sample program to ask the user to give the year level and then our program will determine what is the year level of the student using if statement in C++.

I am currently accepting programming work, it project, school 

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 in my website kindly contact me also in my email address also. Thank you.
My email address are the following jakerpomperada@gmail.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.

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



Program Listing

if.cpp

// year_level.cpp
// Author   : Mr. Jake R. Pomperada, BSCS, MAED-IT
// Date     : August 16, 2018      Thursday
// Website  : http://www.jakerpomperada.com
// Email    : jakerpomperada@jakerpomperada.com

#include <iostream>

using namespace std;

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

No comments:

Post a Comment