944,144 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 802
  • C RSS
Mar 9th, 2007
0

can you help me in this program

Expand Post »
You are to write a numerical base converter. This application will present the
user with a menu to select the originating base and a subsequent menu to select
the destination base. You will loop through these menus until the user wishes to
quit.
You are required to break the code into logical functions (eg. a function that
converts to hexadecimal, another function to convert to binary, etc.).
Notes
• The code for this assignment will be more rigorously graded than for
assignment #1.
• You will need arrays to validate the input. You may choose to use arrays
to display the output – but it is not necessary.
• The atoi() C function is very useful for this assignment. Investigate it.
• It is recommended to take the numbers in as a string, validate each
character based on the base required (e.g. 3G4 is not a valid hexadecimal
value, nor is 21 a valid binary).
• Based on what happened in assignment #1, start early and ask
questions.
• Refer to the submission standards.
Sample Output:
Please select a base to start:
1) Decimal
2) Hexidecimal
3) Binary
Selection: 3
Please enter a value: 2
That is invalid, please enter a value: 101
Please select a base to convert to:
1) Decimal
2) Hexidecimal
3) Binary
Selection: 1
Binary 101 converts to Decimal 5.
Would you like to do another conversion? Y
CST8811:
Programming II
Assignment #2
Assignment Two – Numerical
Conversions
Page 2 of 2 ©2007 Algonquin College
Shawn Unger
02-CST8811-Assignment-Two.doc
Please select a base to start:
1) Decimal
2) Hexidecimal
3) Binary
Selection: 2
Please enter a value: 2F
Please select a base to convert to:
1) Decimal
2) Hexidecimal
3) Binary
Selection: 3
Hexadecimal 2F converts to Binary 00101111.
Would you like to do another conversion? N
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
alaaharb is offline Offline
1 posts
since Mar 2007
Mar 9th, 2007
0

Re: can you help me in this program

Sure. Here it is.
Reputation Points: 254
Solved Threads: 74
Practically a Posting Shark
thekashyap is offline Offline
804 posts
since Feb 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: array or string
Next Thread in C Forum Timeline: Newbie question





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC