VB icon

Civil Status Checker in C++

Email
Submitted on: 9/19/2018 10:37:15 PM
By: Jake R. Pomperada  
Level: Beginner
User Rating: By 1 Users
Compatibility: C++ (general)
Views: 666
author picture
 
     In this article, I would like to share with you a simple program that is being requested of me by a student who visited my website. It is a civil status checker that I wrote using C++ as our programming language. What the program does is to ask the user to give his or her name and then it will ask again for the civil status of the person and the program will display the result on the screen. The code is very simple and easy to understand. I am currently accepting programming work, it projects, 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 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. My personal website is http://www.jakerpomperada.com

 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
//**************************************
// Name: Civil Status Checker in C++
// Description:In this article, I would like to share with you a simple program that is being requested of me by a student who visited my website. It is a civil status checker that I wrote using C++ as our programming language.
What the program does is to ask the user to give his or her name and then it will ask again for the civil status of the person and the program will display the result on the screen. The code is very simple and easy to understand.
I am currently accepting programming work, it projects, 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 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.
My personal website is http://www.jakerpomperada.com
// By: Jake R. Pomperada
//**************************************

// civil_status.cpp
// Written By Mr. Jake Rodriguez Pomperada, MAED-IT
// Date : September 20, 2018
// Tool : Dev C++ 5.11
// www.jakerpomperada.com
// jakerpomperada@aol.com and jakerpomperada@gmail.com
#include <iostream>
#include <cctype>
#include <cstring>
#include <cstdio>
using namespace std;
int main()
{
	string status;
	char civil_status;
	char option,reply;
	char name[200];
do {
	system("cls");
	cout <<"\n\n";
	cout <<"\tCivil Status Checker in C++";
	cout <<"\n\n";
	cout << "\tWhat is your name : ";
	gets(name);
	cout <<"\n\n";
	cout <<"\t1-Single,2-Married,3-Annulled,4-Separated and 5-Widow";
	cout <<"\n\n";
	cout <<"\tWhat is your Civil Status? : ";
cin >> civil_status;
if (civil_status == '1') {
	status ="SINGLE";
	}
	else if (civil_status == '2') {
	status ="MARRIED";
	}
	else if (civil_status == '3') {
	status ="ANNULLED";
	}
	else if (civil_status == '4') {
	status ="SEPARATED";
	}
	else if (civil_status == '5') {
	status ="WIDOW";
	}
	else {
		status ="Invalid Civil Status Try Again.";
	}
	for (int i=0; i<strlen(name); i++) {
	name[i] = toupper(name[i]);
}
	cout <<"\n\n";
	cout <<"\t===== DISPLAY RESULT =====";
	cout <<"\n\n";
	cout <<"\tHi " <<name <<".";
	cout <<"\n\n";
	cout <<"\tYour Civil Status is " << status <<".";
	cout <<"\n\n";
	cout <<"\tDo you want to continue Y/N? : ";
	cin >> reply;
	option = toupper(reply);
 } while(option=='Y');
cout <<"\n\n";
cout <<"\tThank you for using this software";
	cout <<"\n\n"; 
	}


Other 85 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

9/20/2018 3:58:17 PMThomas1965

OMG, gets has been deprecated even in C, but people use it in C++.
https://wiki.sei.cmu.edu/confluence/display/c/MSC24-C.+Do+not+use+deprecated+or+ obsolescent+functions

(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.