Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part 1: Single le, single main function Changing the case ofalphabetic letters are common tasks in many applications In this project. we will develop a
Part 1: Single le, single main function Changing the case ofalphabetic letters are common tasks in many applications In this project. we will develop a simple program to make this change. User will be asked fora upper or lower case letter and the the corresponding lower or upper case letter is echoed. This program should validate the user input to only accept the required letter An error messaged should be displayed before the user can input again: Sample run Please input an upper case letter: a Invalid input! Please try again! Please input an upper case letter: 1 Invalid input! Please try again! Please input an upper case letter: .it Invalid input! Please try again! Please input an upper case letter: R The corresponding loner case letter is: r Please input a lower case letter: A Invalid input! Please try again! Please input a lower case letter: 1 Invalid input! Please try again! Please input a lower case letter: ll Invalid input! Please try again! Please input a lower case letter: r The corresponding upper case letter is: R Put all logics in your main function and store in a single file. Name your le main.cpp! Incorrect naming will cause the compilation using make to fail! The le will be compiled using the make command make to an executable named main and you can run it using .fmain to run. Hint: . You should never use the standard library functions to convert the case of letters! Implement the logic by yourself! . The lower case letters has greaterASCll code than upper case letter. The differences between the corresponding upper case and lower case letters are the same. Thus you can convert the case by add or subtract this difference to the given letter. - Afterthe arithmetic operaon. you will get int ratherthan char. For example '3' + ('a' - 'A') will give the ASCII code of 'b' ratherthan the char 'b'.You need to use static_cast
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started