I have a user inputting different units for temperature. However, I only want the program to be able to accept Capital letters, so if they put a lowercase, it would tell them to input it again. What would be the code for this? I have something like this right now. The while part needs fixing.
Unit = input('Enter the units of the inputted temperature:','s'); while Unit == c Unit == k Unit == f Unit == r Unit = input('Please enter the unit with a Capital Letter:','s'); end
Best Answer