Answered step by step
Verified Expert Solution
Question
1 Approved Answer
i am supposed to write the second function as g being an integer and the length to be lemgth=(int)log2(g)+1 but i do not even know
i am supposed to write the second function as g being an integer and the length to be lemgth=(int)log2(g)+1 but i do not even know where to start to get the function to read the values pertaining to b
here is a clearer picture of this
the clearer images are posted below here are the guidelines on the function computegreyint(g) must calculate using the math length=(int)log2(g)+1. i do not know how to properly write this function because everytime i try to do it i always popping up with an empty output any help could greatly be appreciated!! thank uou very much! the output is supposed to display the computed result in decimal value i.e. 0101= 5 etc
if someone could show me how to to properly write the second function to properly read from input and using the lemgth=log2(g)+1 portion in it so that i may see exactly how it is done that would be greatly appreciated in c++. like i said i am completely lost on how to do this i have tried reading as a string but that is not the correct way to be done and switching to the int conversion i am completely lost
Input:input will be from the file named "graycodes.dat". The first line of input gives the number of test cases, Nat most 25), test cases follow. Each test case is a line and starts with an Aora B. f the line starts with an A then there will follow 2 integers: number of bits. (1 Se 58) and position *{O SEStep 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