Unit & Temperature Converter CLI
A menu-driven console application that converts between common units (temperature, length, weight) using a lookup-based conversion engine, with input validation and a loop for repeated conversions. Learners practice switch statements, function pointers for conversion dispatch, and input validation in C.
- Estimate
- ~6.5h
- Steps
- 5
- Completed by
- 0
- Proposed by
- codeseed.app
stdio.h · math.h
Project roadmap
- 01
Design the menu and category structure
~1hBuild a text menu letting users pick a conversion category (temperature, length, weight).
- 02
Implement conversion functions
~1.5hWrite individual functions for each conversion pair (C to F, km to miles, kg to lb, etc.).
- 03
Add function-pointer based dispatch
~1.5hUse an array of function pointers keyed to menu choices to avoid a long if/else chain.
- 04
Add input validation and retry loop
~1.5hValidate numeric input with strtod and re-prompt on invalid entries instead of crashing.
- 05
Add a conversion history log
~1hKeep the last N conversions in memory and let the user view them before exiting.
Resources
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack