Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Lab 15 Due Date: See Blackboard Source File: /2336/15/lab15.(CICPP l cpplc++Icclcxxl cp) Input Output Value: under control of main function under control of main function
Lab 15 Due Date: See Blackboard Source File: /2336/15/lab15.(CICPP l cpplc++Icclcxxl cp) Input Output Value: under control of main function under control of main function Write a recursive function that prints the quaternary representation of a signed, nonzero integer. A sample main function for testing your function is shown in Figure 1 and commands for compiling, linking and running this assignment are shown in Figure 2. To use the Makefile as distributed in class, add a target of lab15 to targets2srcfiles 1 #include #include #include s using namespace std; 7 // printQuaternary is a recursive function that writes the quaternary s // representation of num to output stream os a void printQuaternary (int num, ostream& os); 1 int main) 13int num; while (cin >> num) cout cd 2336 2 newuserQcsunix /2336>./getlab.ksh 15 3 * Checking to see if a folder exists for Lab 15. . "No 4C eating a folder for Lab 15 sChecking to see if Lab 15 has sample input and output files. . .Yes Copying input and output files for Lab 15 from folder /usr/local/2336/data/15 to folder ./15 Checking to see if /usr/local/2336/src/lab15main . C exists. . Copying file /usr/local/2336/src/1ab15main . C to folder ./15 s * .Yes 9 * Checking to see if /usr/local/2336/include/1ab15.h exists. . .No 41Copying file /usr/local/2336/src/Makefile to folder /15 12Adding a target of lab15 to targets2srcfiles 13Touching file ./15/1ab15.cpp Edit file ./15/1ab15.cpp in Notepad++ s newuser@csunix /2336> cd 15 newuser@csunix "/2336/15> ls Makefile 01.dat 18 newuser@csunix /2336/15> make lab15 19 g++ -g -Wall -std-c++11-c lab15main.C -I/usr/local/2336/include I. 2 g++ -g -Wall-std-c++11 lab15.cpp -I/usr/local/2336/include I 21 g+t -o lab15 lab15main.o lab15.o -L/usr/local/2336/1ib -1m -lbits 22 newuser@csunix /2336/15> cat 01.dat 23 0 1 2 3341 2147483647 24 -1-2 -3341-2147483647 25 -2147483648 26 newuser@csunix "/2336/15> cat 01.dat | ./1ab15 01.out lab15.cpp b15main.c 0 base 100 base 4 1 base 101 base 4 2 base 10 2 base 4 3341 base 10 -310031 base 4 31 2147483647 base 101333333333333333 base 4 -1 base 103333333333333333 base 4 -2 base 103333333333333332 base 4 -3341 base 10-3333333333023303 base 4 35 -2147483647 base 102000000000000001 base 4 36 -2147483648 base 102000000000000000 base 4 newuser csunix /2336/15> cat 01.dat ./lab15 my.out s newuser csunix /2336/15> diff 01.out my.out newuser@csunix "/2336/15> Figure 2. Commands to Compile, Link, & Run Lab 15 void printQuaternary(int num, ostream
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