Answered step by step
Verified Expert Solution
Question
1 Approved Answer
16 #include // For string data type 18 using namespace std; // So std::cout may be abbreviated to cout Paste Font Paragraph Styles Styles Sensitivity
16 #include // For string data type 18 using namespace std; // So "std::cout" may be abbreviated to "cout" Paste Font Paragraph Styles Styles Sensitivity 20 int main() You will write two programs in this lab. You may use one C++ project and switch among your two.cpp files, or create one project for each program. In either case, insure that you save each of your.cpp files. 23 // Declare constants const int BASE = 2; // Declare variables // 1) [13 points] You've been hired by Decimal Dudes to write a C++ console application that converts a decimal number to a binary number. Start with file Lab02-01. cpp and make the following edits: 1) Complete the header comment. 2) Declare two integer variables: pumDec and DumBin 3) Declare one string variable: numStr. 4) Add an application header using cout statements. 5) Add an application close using a cout statement. // Show application header // // Prompt for and get decimal number cout > numDec; o Use of undeclared identifier 'num Dec' Run the program five times with different values for the decimal number. What are the results? Run Decimal number Binary number 37 38 39 // Loop to convert decimal to binary cout @) 0 Use of undeclared identifier 'num Dec' 2 Use of undeclared identifier 'numBin' O Use of undeclared identifier 'numBin' O Use of undeclared identifier 'numStri numBin = numDec % BASE; if (numBin == ) numStr = "9" + numStr; else numStr = "1" + numStr; numDec = numDec / BASE; [your program code herel* O Use of undeclared identifier 'numStri If possible, format your code 11ke this: Font "Courier New Font size "9" Bold cout 53 Page 1 of 3 } - + O Focus E- 107%
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