Given two input integers for an arrow body and arrowhead (respectively), print a right-facing arrow. Ex: If the input is: 0 1 the output is: 1 11 00000111 000001111 00000111 11 1
Added by Francisco Javier G.
Step 1
The task is to print a right-facing arrow using two integers. The first integer represents the character used for the arrow body, and the second integer represents the character used for the arrowhead. The arrow should have a specific structure where the arrowhead Show more…
Show all steps
Your feedback will help us improve your experience
Willis James and 89 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Shelayah R.
1.18 LAB: Input and formatted output: Right-facing arrow Given two input integers for an arrow body and arrowhead (respectively), print a right-facing arrow. Ex: If the input is: 0 1 the output is: 1 11 00000111 000001111 00000111 11 1 Complete this code to get the output. #include <iostream> using namespace std; int main() { int baseChar; int headChar; /* Type your code here. */ return 0; }
Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binary. For an integer x, the algorithm is: As long as x is greater than 0 Output x % 2 (remainder is either 0 or 1) x = x / 2 Note: The above algorithm outputs the 0's and 1's in reverse order. Ex: If the input is 6, the output is: 011 (6 in binary is 110; the algorithm outputs the bits in reverse). in coral
Gio M.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD