| | |
can you help me in this program
![]() |
•
•
Join Date: Mar 2007
Posts: 1
Reputation:
Solved Threads: 0
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
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
- Playing .Wav/MIDI files in a Visual Basic Program (Visual Basic 4 / 5 / 6)
- What's the HARDEST program you've written? (Computer Science)
- Cool little Program to disable startup programs (Windows NT / 2000 / XP)
- Program is shutting down right after program is executed (C++)
- 3d Program (Game Development)
Other Threads in the C Forum
- Previous Thread: array or string
- Next Thread: Newbie question
| Thread Tools | Search this Thread |
#include adobe api array arrays asterisks binarysearch calculate char cm copyanyfile copyimagefile copypdffile cprogramme creafecopyofanytypeoffileinc createcopyoffile csyntax database directory dynamic feet fflush fgets file fork forloop frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hacking hardware highest homework i/o include incrementoperators input interest kernel kilometer linked linkedlist linux linuxsegmentationfault list lists locate logical_drives loopinsideloop. match matrix meter microsoft motherboard mqqueue mysql number odf open opensource owf pattern pdf performance pointer posix probleminc process program programming pyramidusingturboccodes radix read recursion recv repetition research scanf scheduling scripting segmentationfault send sequential shape socket socketprograming stack standard string systemcall turboc unix user voidmain() wab win32api windows.h





