Skip to content

KiruthikaJeyashankar/UnitConverter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

UnitConverter

Project Idea: Unit Converter App (Command-Line Based) for practising Swift

Description:

Create a console-based unit converter app where users can convert between different units (e.g., kilometers to miles, Celsius to Fahrenheit, etc.). This project focuses on functions and reinforces your understanding of inputs, outputs, and decision-making.

Features:

Menu for Unit Conversion: Present a menu to the user (e.g., "1. Convert kilometers to miles, 2. Convert Celsius to Fahrenheit"). Functions for Conversions: Write separate functions for each conversion type (e.g., convertKmToMiles(km: Double) -> Double). User Input: Prompt the user for input values (e.g., kilometers or Celsius) and call the appropriate function. Repeat Option: After a conversion, ask the user if they want to perform another conversion or exit the app.

Example Workflow:

Welcome to the Unit Converter! Please choose an option:

  1. Convert kilometers to miles
  2. Convert Celsius to Fahrenheit
  3. Exit

Enter your choice: 1 Enter the distance in kilometers: 5 5 kilometers is equal to 3.11 miles.

Do you want to convert another unit? (yes/no): yes

Concepts Practiced:

  • Function creation and usage.
  • Handling user input and output.
  • Conditional statements (if, switch).
  • Loops (for repetitive tasks).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages