Assignment Instructions

  1. Edit, compile, and run the following program on the UH UNIX shell:
    1. Ask the user to enter a number between 0 and 9.
    2. Use function getchar() to get one character from the user.
    3. Include error-checking in the program. Make sure the character is between '0' and '9'.
    4. Write the number in a language other than English, such as Hawaiian, Japanese, Chinese, Portuguese, Korean, Tagalog, Samoan, Spanish, Gaelic, Mayan, Na'vi, Klingon, Elvish, etc.
    5. Use if-statements or a switch statement.
    6. Email your makefile and C program to the instructor.

Example I/O

walbritt@uhx01:/home/27/walbritt/ics212> ./program                                                       
This program will display the Japanese word for a number of your choice.
Enter a number 0-9: 0
rei

walbritt@uhx01:/home/27/walbritt/ics212> ./program                                                       
This program will display the Japanese word for a number of your choice.
Enter a number 0-9: 5
go

walbritt@uhx01:/home/27/walbritt/ics212> ./program                                                       
This program will display the Japanese word for a number of your choice.
Enter a number 0-9: 9
kyuu

walbritt@uhx01:/home/27/walbritt/ics212> ./program                                                       
This program will display the Japanese word for a number of your choice.
Enter a number 0-9: a
ERROR: 'a' is not a digit in the range 0-9.

walbritt@uhx01:/home/27/walbritt/ics212> ./program                                                       
This program will display the Japanese word for a number of your choice.
Enter a number 0-9: Z
ERROR: 'Z' is not a digit in the range 0-9.

Click to validate the HTML code

Click to validate the CSS code