Answered step by step
Verified Expert Solution
Question
1 Approved Answer
int binary _ to _ decimal ( string s ) ; / / precondition: s is a string that consists of only 0 s and
int binarytodecimalstring s;
precondition: s is a string that consists of only s and s
postcondition: the positive decimal integer that is represented by s
string decimaltobinaryint n;
precondition: n is a positive integer
postcondition: ns binary representation is returned as a string of s and s
string addbinariesstring b string b;
precondition: b and b are strings that consists of s and s ie
b and b are binary representations of two positive integers
postcondition: the sum of b and b is returned. For instance,
if b b then the return value is
void menu;
display the menu. Student shall not modify this function
int grade;
returns an integer that represents the students grade of this projects.
Student shall NOT modify
bool isbinarystring b;
returns true if the given string s consists of only s and s; false otherwise
bool testbinarytodecimal;
returns true if the students implementation of binarytodecimal function
is correct; false otherwise. Student shall not modify this function
bool testdecimaltobinary;
returns true if the students implementation of decimaltobinary function is correct; false otherwise. Student shall not modify this function
bool testaddbinaries;
which returns true if the students implementation of addbinaries function
is correct; false otherwise. Student shall not modify this function
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