PLEASE do the following problem in C++ with the screenshot of the output. THANKS!
There are 3 parts. (1) Write a C++ program to check an input string by user is palindrome or not. (2) Write a program to check whether the year provided by a user is a leap year or not. (3) Write a program which accepts days as integer and display total number of years, months and days in it. For example : If user input as 856 days the output should be 2 years 4 months 6 days.
Program 1:
#include<iostream>
#include<string>
using namespace std;
int main()
{
string s,revs;
int i;
cout<<"Enter a string:";
getline(cin,s);
for(i=s.size()-1;i>=0;i--)
{
revs.push_back(s[i]);
}
if(s.compare(revs)==0)
cout<<"String is a Palindrome\n";
else
cout<<"String is not a Palindrome\n";
return 0;
}
Output:

Program 2:
#include<iostream>
using namespace std;
int main()
{
int year;
cout<<"Enter a year:";
cin>>year;
if(year%4==0 && year%400==0)
cout<<"Entered year is a leap year\n";
else if(year%4==0 && year%100!=0)
cout<<"Entered year is a leap year\n";
else
cout<<"Entered year is not a leap year\n";
return 0;
}
Output:

Program 3:
#include<iostream>
using namespace std;
int main()
{
int days,years=0,months=0;
cout<<"Enter number of days:";
cin>>days;
if(days>=365)
{
years=days/365;
days=days-365*years;
}
if(days>=30)
{
months=days/30;
days=days-30*months;
}
cout<<years<<" years "<<months<<" months "<<days<<" days\n";
return 0;
}
Output:

PLEASE do the following problem in C++ with the screenshot of the output. THANKS! There are...
please follow format of example output, do in python A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To account for the difference in time, every 4 years, a leap year takes place. A leap year is when a year has 366 days: An extra day, February 29th. The requirements for a given year to be a leap year are: 1) The year must be divisible by...
Write a C Program that asks the user to input a string and then the user is prompted back whether the input string is a “Palindrome Word” or not. (A Palindrome Word reads the same backward or forward, eg. madam, racecar, etc.) Your program should contain a function that accepts the input string from the main function and returns a value indicating whether the input string is a Palindrome or not. Use Pointers to traverse the string.
In C language, please use at least one user
defined function, and show data validity check for != integers
3) Write a program to find whether a given number is a Palindrome number (number that is same when you read from forward or backward). You need to take a long integer number from user as input and verify whether it's a number and positive or not. If the input is not valid (e.g., string or float) or positive, then notify...
Has to be written in C++ Write a program that asks the user to enter the month (1-12) and the year (0-2019). Validate the input and print an error and stop the program if an invalid month or year was entered. The program should then display the number of days in that month. Use the following criteria to identify leap years: Determine whether the year is divisible by 100. If it is, then it is a leap year if and...
Palindrome Detector C++ A palindrome is any word, phrase, or sentence that reads the same forward and backward. Here are some well-known palindromes: Able was I, ere I saw Elba A man, a plan, a canal, Panama Desserts, I stressed Kayak Write a program that determine whether an input string is a palindrome or not. Input: The program should prompt the user "Please enter a string to test for palindrome or type QUIT to exit: " and then wait for...
Can you please write simple program with comments. A Palindrome is a string that is spelled the same way forward and backward (example: radar). Write a Java program that asks the user to input a string and tests whether the string is a Palindrome or not. Display the message: "The string is a Palindrome" if it is, or "The string is NOT a Palindrome" if it is not. Assume that the user will enter a string without any spaces. The...
Assignment 1 Year 2 ICTEDU term 1 2019 For question 1 and 2 the report should consist the following sections on each task: Task Description: Pseudo code / Algorithm: Testing: implementation (working program) screenshots NOTE: Question 1 and 2 Attach a well commented C source file of the program in a zipped file QUESTION 1-Simple C functions 1. Write a short C function that takes an integer (year) and checks whether the year is a Leap Year or not. If...
Write a class named MonthDays. The class’s constructor should accept two arguments: l An integer for the month (1 = January, 2 February, etc). l An integer for the year The class should have a method named getNumberOfDays that returns the number of days in the specified month. The method should use the following criteria to identify leap years: 1. Determine whether the year is divisible by 100. If it is, then it is a leap year if and if...
Language is C
1. Palindrome Write a program that prompts the user for a positive integer number and output whether the number is a palindrome or not. A palindrome number is a number that is the same when reversed. For example, 12321 is a palindrome; 1234 is not a palindromoe. You will write a function named as palindrome. The function will have two arguments, number and isPalindrome. Both arguments are pass-by-reference. The argument number is a pointer to a variable...
A Palindrome is a string that is spelled the same way forward and backward (example: radar). Write a Java program that asks the user to input a string and tests whether the string is a Palindrome or not. Display the message: "The string is a Palindrome" if it is, or "The string is NOT a Palindrome" if it is not. Assume that the user will enter a string without any spaces. The string can be any length. The String can...