Machine Problem
Make a program that will input age, Check… age<=20 Display "Young" Age>=21 Display "Adult"
Your program will be terminated if you input zero in age.
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 at 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.
Program Listing
/*
Author : Prof. Jake Rodriguez Pomperada, MAED-IT, MIT
www.jakerpomperada.blogspot.com and www.jakerpomperada.com
jakerpomperada@gmail.com
Bacolod City, Negros Occidental Philippines.
Machine Problem in C++
Make a program that will input age,
Check… age<=20 Display "Young"
Age>=21 Display "Adult"
Your program will be terminated if you input zero in age.
*/
#include <iostream>
int main()
{
int age=0;
do {
std::cout << "\n\n";
std::cout << "\tAge Checker in C++";
std::cout <<"\n\n";
std::cout <<"\tEnter Your Age : ";
std:: cin >>age;
if (age==0) {
break;
}
if (age <= 20) {
std::cout <<"\n";
std::cout <<"\tYoung";
} else if (age>= 21) {
std::cout <<"\n";
std::cout <<"\tAdult";
}
} while (age!=0);
std::cout << "\n\n";
std::cout << "\tEnd of Program";
std::cout <<"\n";
}
No comments:
Post a Comment