Autocad lisp programming3/15/2024 ![]() ![]() ![]() (if (= "Yes" (getkword "\nConvert Celsius to Fahrenheit? : " )) (defun C:CONV-TEMP( / C C2F F F2C ) localize variables I have fixed your code please compare it with yours to understand my changes (since I didn't commented them all). That means that you have some un-balanced pharenthesis - please pay more attention to code formatting to be able to notice those issues by yourself. (prompt (strcat (rtos C 2 1) "\ndegrees FahrenheitĮquivalent to" (rtos F2C 2 1) "degrees Celsius.")) ![]() (prompt (strcat (rtos F 2 1) "\ndegrees Celsius is equivalent to" Here is what I have thus far for setting Celsius to C and the formula for Celsius to F is represented by C2F: Output: xx.x degrees Fahrenheit equivalent to x.x degrees Celsius. Input: Enter temperature in Fahrenheit: x The second program will simply be flipped: Ouput: x.x degrees Celsius is equivalent to xx.x degrees Farhrenheit. I again need some assistance with a lisp program to convert Celsius to Fahrenheit and vise versa, these will need to be in two separate programs in a single file. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |