100% found this document useful (1 vote)
408 views

Pascal Tasks IV

The document provides instructions for writing Pascal programs to convert between decimal, binary, octal, and hexadecimal number systems. It instructs the reader to write an algorithm, code, compile, and test programs to convert decimal to binary, decimal to octal, and decimal to hexadecimal. It then asks the reader to modify the programs to use subprograms and allow user input for the desired conversion type. Finally, it suggests further expanding the program to allow for conversion in both directions.

Uploaded by

sedmondsbrown
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
408 views

Pascal Tasks IV

The document provides instructions for writing Pascal programs to convert between decimal, binary, octal, and hexadecimal number systems. It instructs the reader to write an algorithm, code, compile, and test programs to convert decimal to binary, decimal to octal, and decimal to hexadecimal. It then asks the reader to modify the programs to use subprograms and allow user input for the desired conversion type. Finally, it suggests further expanding the program to allow for conversion in both directions.

Uploaded by

sedmondsbrown
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

Pascal Tasks IV

For each of the following tasks:

 Write a basic algorithm (plan your program)


Type the code into the Pascal editor
Compile the code
Run the code
 Test the code – check that the answers are correct

Write a program to convert decimal to binary. Your program should:


 Prompt the user to enter a binary number.
 Convert the binary number to a decimal number.
 Display the decimal number.

Write a program to convert decimal to octal. Your program should:


 Prompt the user to enter an octal number.
 Convert the octal number to a decimal number.
 Display the decimal number.

Write a program to convert decimal to hexadecimal. Your program should:


 Prompt the user to enter a hexadecimal number.
 Convert the hexadecimal number to a decimal number.
 Display the decimal number.

Convert the above programs into subprograms and allow the user to choose which
type of conversion he/she wants the program to perform.

Advanced:
Expand your program to go both ways.

You might also like