Question
Binary [01]+ Octal [0-7]+ Decimal [0-9]+ Hexadecimal [0-9a-fA-F]+ Using the following data for your input file: 210 134 998 a34 A0 87 2398 10010 101
Binary "[01]+" Octal "[0-7]+" Decimal "[0-9]+" Hexadecimal "[0-9a-fA-F]+" Using the following data for your input file:
210 134 998 a34 A0 87 2398 10010 101 10 DeAd beEF
Example output provided shows the first sentence provided by main() and the second sentence by baseConvert(). Your program will produce the following output to the screen:
210 is a valid octal number. 210 base 8 is 136 base 10. 210 is a valid decimal number. 210 base 10 is 210 base 10. 210 is a valid hexadecimal number. 210 base 16 is 528 base 10.
134 is a valid octal number. 134 base 8 is 92 base 10. 134 is a valid decimal number. 134 base 10 is 134 base 10. 134 is a valid hexadecimal number. 134 base 16 is 308 base 10.
998 is a valid decimal number. 998 base 10 is 998 base 10. 998 is a valid hexadecimal number. 998 base 16 is 2456 base 10.
a34 is a valid hexadecimal number. a34 base 16 is 2612 base 10.
A0 is a valid hexadecimal number. A0 base 16 is 160 base 10.
87 is a valid decimal number. 87 base 10 is 87 base 10. 87 is a valid hexadecimal number. 87 base 16 is 135 base 10.
2398 is a valid decimal number. 2398 base 10 is 2398 base 10. 2398 is a valid hexadecimal number. 2398 base 16 is 9112 base 10.
10010 is a valid binary number. 10010 base 2 is 18 base 10. 10010 is a valid octal number. 10010 base 8 is 4104 base 10. 10010 is a valid decimal number. 10010 base 10 is 10010 base 10. 10010 is a valid hexadecimal number. 10010 base 16 is 65552 base 10.
101 is a valid binary number. 101 base 2 is 5 base 10. 101 is a valid octal number. 101 base 8 is 65 base 10. 101 is a valid decimal number. 101 base 10 is 101 base 10. 101 is a valid hexadecimal number. 101 base 16 is 257 base 10.
10 is a valid binary number. 10 base 2 is 2 base 10. 10 is a valid octal number. 10 base 8 is 8 base 10. 10 is a valid decimal number. 10 base 10 is 10 base 10. 10 is a valid hexadecimal number. 10 base 16 is 16 base 10.
DeAd is a valid hexadecimal number. DeAd base 16 is 57005 base 10.
beEF is a valid hexadecimal number. beEF base 16 is 48879 base 10.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started