Objective:
Write a program that accepts a string as an input and perform following –
Write a function that accepts a string as an argument and display the reverse of that string and
return that string.
Write another function that accepts a string as its argument and check whether the string is
palindrome or not.
Description:
A palindrome is a string, which when read in both forward and backward ways is the same.
Example: lol, pop, radar, madam, etc.
To check if a string is a palindrome or not, a string needs to be compared with the reverse of
itself.
Demonstrate these two functions in a program that performs the following steps:
1. The user is asked to enter a string.
2. The program displays the following menu:
A) Display the reverse of the string
B) Check the string is palindrome or not
C) Exit the program
3. The program performs the operation selected by the user and repeats until the user
selects E to exit the program.
Given a string on one line, output the length of that string. End with a newline.
Ex: If the input is:
Fuzzy bear
the output is: 10
Write a c++ program to find the length of the skirting board.Where she wants to replace the old skirting board and the coving 2.7,4.1m 32m(All dimensions in Meter)with the door of 0.86 x 2.06meters
Read from the user the maximum number of rolls of toilet paper that may be ordered. Require the maximum number of rools that may be ordered to be an integer from 1 to 10, inclusive. If the user enters a number that is out of range, make them try again until they enter an acceptable number.
Similarly make the user enter the price of one roll of toilet paper as a decimal number of dollars and cents from ten cents(0.10) to three dollars(3.00) inclusive.
Print a table showing the number of rolls in the table for all number of rolls from 1 to the maximum number that the user specified. Each row in the table shows the number of rolls and the price for that number of rolls.
Example:
User enters maximum number of rolls as 48; make them try again.
User enters maximum number of rolls as 4; that is acceptable.
User enters the price per roll as 14.10; make them try again.
User enters the price per roll as -2.70; make them try again.
User enters the price per roll as 0.10; which is acceptable.
Print:Prompt the user to input two integers: firstNum and secondNum note that firstNum
Print "userNum1 is negative." if userNum1 is less than 0. End with newline.
Assign userNum2 with 1 if userNum2 is greater than 10. Otherwise, print "userNum2 is less than or equal to 10.". End with newline.
Create a class Book with title, author, and cost as data members. Include a constructor and a member function show Book () to set and print the member values respectively. Write main a method to demonstrate the Book class.
details for students and staff using inheritance. Student details: name, address, percentage marks. Staff details: name, address, salary.
Develop a C++ program implementing hierarchical inheritance upon a base class "Employee", and derived classes "Full-time" containing basic salary and allowances for calculating the salary of the employee and "Part-time" containing rate_per_day and no. of
Write a program that prompts the user to input a decimal number and outputs the number rounded to the nearest integer. Your program should output only the nearest rounded value on a newline.
Enter a decimal value: 2.2
2