The goal of this lab is to create a C++ program that converts a number between three numbering systems: binary, decimal, and hexadecimal. Students will gain hands-on experience in base conversions and string manipulation.
--------------------------------
Number System Converter
--------------------------------
Choose input format:
1. Binary
2. Decimal
3. Hexadecimal
Enter your choice (1-3): 1
Please enter binary number: 11001110
Conversion Results:
--------------------------------
Binary: 11001110
Decimal: 206
Hexadecimal: CE
Do you want to convert another number? (y/n): y
--------------------------------
Number System Converter
--------------------------------
Choose input format:
1. Binary
2. Decimal
3. Hexadecimal
Enter your choice (1-3): 2
Please enter decimal number: 256
Conversion Results:
--------------------------------
Binary: 100000000
Decimal: 256
Hexadecimal: 100
Do you want to convert another number? (y/n): y
--------------------------------
Number System Converter
--------------------------------
Choose input format:
1. Binary
2. Decimal
3. Hexadecimal
Enter your choice (1-3): 2
Please enter decimal number: -19
Conversion Results:
--------------------------------
Binary: 11101101
Decimal: -19
Hexadecimal: ED
Do you want to convert another number? (y/n): y
--------------------------------
Number System Converter
--------------------------------
Choose input format:
1. Binary
2. Decimal
3. Hexadecimal
Enter your choice (1-3): 3
Please enter hexadecimal number: FF6D
Conversion Results:
--------------------------------
Binary: 1111111101101101
Decimal: 65389
Hexadecimal: FF6D
Do you want to convert another number? (y/n): n
Thank you for using the converter!
--------------------------------
| Category | Criteria | Points |
|---|---|---|
| Base Input Menu | Display base menu, read user choice | 10 |
| Input Reading | Input number based on selected base | 5 |
| Binary Conversion | Convert to/from binary correctly | 20 |
| Decimal Conversion | Convert to/from decimal correctly | 20 |
| Hex Conversion | Convert to/from hexadecimal correctly | 20 |
| Looping & Menu | Repeat program using do-while loop | 10 |
| Input Validation | Check for correct base input | 5 |
| Comments | Includes meaningful and relevant comments explaining key parts of the code. | 5 |
| A.I. Disclaimer | Includes a clear statement indicating whether AI tools were used and how they contributed to the assignment. | 5 |
Please submit your Lab X source code file: labx.cpp in D2L!
/*
Author: Your Name
Date: Month/Day/Year
Lab Purpose: Number System Conversion - Binary, Decimal, Hexadecimal
*/