You are on page 1of 3

Assignment Name Lab Task 5 Submitted By

Subject Programming Fundamentals Muhammad Ehtisham Amjad


Submitted to Dr. Naseer Jan Dated
Program BSSE-II-B March 10, 2024

TASK TO PERFORM
Write a C++ program called DisplayNumberSystems that will display the binary, octal, and
hexadecimal equivalents of the first 50 decimal numbers from 1 to 50. Use Switch statement to
select options of converting decimal to binary, decimal to octal, decimal to hexadecimal, etc.
Important Notes:
Comment each statement or block of statements and explain the purpose of each statement or
block of statements. The C++ program should compile and run without any errors against the
output given in this assignment. Marks or points will be deducted based on the following points:
 Formatting [10 points]
 Naming convention for variables [10 points]
 Comments [10 points]
 Missing loop where required [10 points]
 Program doesn’t compile and run [70 points ]
 Source code (.cpp file) and executable file missing [100 points]
 Turn in to student’s portal (teams)
 Write the program, follow steps, execute your program, capture output and submit a pdf file to
the portal (teams).
 Submit source code: DisplayNumberSystems.cpp,
 Execute all possible test cases and document your results in pdf against different inputs
 We discussed memory types in detail. Copying, plagiarism, and sharing your answers with other
students is strictly prohibited and disciplinary action will be initiated against such students

PERFORMANCE
1. WRITE A C++ PROGRAM CALLED DISPLAYNUMBERSYSTEMS THAT WILL
DISPLAY THE BINARY, OCTAL, AND HEXADECIMAL EQUIVALENTS OF THE
FIRST 50 DECIMAL NUMBERS FROM 1 TO 50. USE SWITCH STATEMENT TO
SELECT OPTIONS OF CONVERTING DECIMAL TO BINARY, DECIMAL TO
OCTAL, DECIMAL TO HEXADECIMAL, ETC.
1.1 CODE
The screenshot of the C++ code for the above problem is down below:
1.2 OUTPUT
The output for the given program is:

You might also like