The first option of your program will prompt the user to enter a positive binary number (base 2 -- I's and O's only) of no more than 6 digits. Read this value as an int type value and your program must make sure that it is indeed a binary number (only I's and O's). If it isn't, then the user is prompted again. If it is binary, then your program is to calculate the equivalent decimal value (base 10 -- the number system). MSB Binary Digit 254 12 32 4 4 21 Representation of a binary number So for example, converting a Binary to Decimal number would be: Decimal Digit Value 256 128 64 32 16 8 4 2 1 Binary Digit Value 1 0 11 0 0 1 o By adding together ALL the decimal number values from right to left at the positions that are represented by a "I" gives us:(256) + (64) + (32) + (4) + (1) - 35710 or three hundred and fifty-seven as a decimal number. The second option of your program will prompt the user to enter 3 positive numbers in the rangel to 10, and will tell the user whether the three inputs will form the sides of a triangle. That is, your program is to determine whether or not the three input values can possibly be the three sides of a triangle. For instance, 3, 4, and 10 cannot be sides of a triangle because the longest side is greater than the sum of the other two sides (they don't satisfy the "triangle inequality"). The third option will be Quit. Maintain a log of outputs to an output.txt file. Write three functions, menu function, this function will display menu options repeatedly, there is no returned values from this function. binary decimal _function, this function will take as input one integer (base 2) number and retum as output its equivalent decimal value. tringle_function, this function will receive as input three integer positive numbers in the range 1-10, and determine whether or not the three input values can possibly be the three sides of a triangle. Example valid/invalid inputs and the expected outputs. (D er ) te convert inary uber to its evivalent decinal (T er t) te findout wether three bers will fore tringle sides (0 er e) te Qit Inter you cheice enetra positive binary er (base a1's and e's only) or ne ere than digits arning reng input try gain z enetr a positive sinary nuber (hase a-- l's and 's aniy) of no more than digits arning..rong input try again z enetra positive binary uber (base 21's and 's only) of ne ere than igits The equivalent decinal nuber is as for the input binary uber 1 -(D or d) to convert binary number to its equivalent decinal (T or t) to findout wether three numbers will form tringle sides (Q or a) to Quit Enter you choice t Plz enter 3 positive numbers in the rangel to 100 30 90 se0 Marning....rong input try again Plz enter 3 positive numbers in the rangel to 100 30 90 se The three input values 30, 90 ,s0 can possibly be the three sides of a triangle (D or d) to convert binary nunber to its equivalent decimal -(T or t) to findout wether three numbers wil form tringle sides -(Q or a) to Quit Enter you choice t Plz enter 3 positive numbers in the rangel to 100 30 10 se The three input values 30, 10, se can NOT be the three sides of a triangle
The first option of your program will prompt the user to enter a positive binary number (base 2 -- I's and O's only) of no more than 6 digits. Read this value as an int type value and your program must make sure that it is indeed a binary number (only I's and O's). If it isn't, then the user is prompted again. If it is binary, then your program is to calculate the equivalent decimal value (base 10 -- the number system). MSB Binary Digit 254 12 32 4 4 21 Representation of a binary number So for example, converting a Binary to Decimal number would be: Decimal Digit Value 256 128 64 32 16 8 4 2 1 Binary Digit Value 1 0 11 0 0 1 o By adding together ALL the decimal number values from right to left at the positions that are represented by a "I" gives us:(256) + (64) + (32) + (4) + (1) - 35710 or three hundred and fifty-seven as a decimal number. The second option of your program will prompt the user to enter 3 positive numbers in the rangel to 10, and will tell the user whether the three inputs will form the sides of a triangle. That is, your program is to determine whether or not the three input values can possibly be the three sides of a triangle. For instance, 3, 4, and 10 cannot be sides of a triangle because the longest side is greater than the sum of the other two sides (they don't satisfy the "triangle inequality"). The third option will be Quit. Maintain a log of outputs to an output.txt file. Write three functions, menu function, this function will display menu options repeatedly, there is no returned values from this function. binary decimal _function, this function will take as input one integer (base 2) number and retum as output its equivalent decimal value. tringle_function, this function will receive as input three integer positive numbers in the range 1-10, and determine whether or not the three input values can possibly be the three sides of a triangle. Example valid/invalid inputs and the expected outputs. (D er ) te convert inary uber to its evivalent decinal (T er t) te findout wether three bers will fore tringle sides (0 er e) te Qit Inter you cheice enetra positive binary er (base a1's and e's only) or ne ere than digits arning reng input try gain z enetr a positive sinary nuber (hase a-- l's and 's aniy) of no more than digits arning..rong input try again z enetra positive binary uber (base 21's and 's only) of ne ere than igits The equivalent decinal nuber is as for the input binary uber 1 -(D or d) to convert binary number to its equivalent decinal (T or t) to findout wether three numbers will form tringle sides (Q or a) to Quit Enter you choice t Plz enter 3 positive numbers in the rangel to 100 30 90 se0 Marning....rong input try again Plz enter 3 positive numbers in the rangel to 100 30 90 se The three input values 30, 90 ,s0 can possibly be the three sides of a triangle (D or d) to convert binary nunber to its equivalent decimal -(T or t) to findout wether three numbers wil form tringle sides -(Q or a) to Quit Enter you choice t Plz enter 3 positive numbers in the rangel to 100 30 10 se The three input values 30, 10, se can NOT be the three sides of a triangle
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
![The first option of your program will prompt the user to enter a positive binary number
(base 2 -- I's and O's only) of no more than 6 digits. Read this value as an int type value
and your program must make sure that it is indeed a binary number (only I's and Os). If it
isn't, then the user is prompted again. If it is binary, then your program is to calculate the
equivalent decimal value (base 10 -- the number system).
MSB
Binary Digit
LSB
256 128 64 32 16 4
2
1
Representation of a binary number
So for example, converting a Binary to Decimal number would be:
Decimal Digit Value 256 128 64 32 16 8 4 2
Binary Digit Value O I1 o 0 1 0
By adding together ALL the decimal number values from right to left at the positions
that are represented by a "1" gives us:(256) + (64) + (32) + (4) + (1) = 35710 or three
hundred and fifty-seven as a decimal number.
The second option of your program will prompt the user to enter 3 positive numbers in
the rangel to 10, and will tell the user whether the three inputs will form the sides of a
triangle. That is, your program is to determine whether or not the three input values can
possibly be the three sides of a triangle. For instance, 3, 4, and 10 cannot be sides of a
triangle because the longest side is greater than the sum of the other two sides (they don't
satisfy the "triangle inequality").
The third option will be Quit.
Maintain a log of outputs to an output.txt file.
Write three functions,
menu_function, this function will display menu options repeatedly, there is no
returned values from this function.
binary_decimal_function, this function will take as input one integer (base 2)
number and returm as output its equivalent decimal value.
tringle_function, this function will receive as input three integer positive
numbers in the range 1-10, and determine whether or not the three input
values can possibly be the three sides of a triangle.
Example valid/invalid inputs and the expected outputs.
(D or d) to convert binary nuber to its equivalent decinal
(T or t) to findout wether three numbers will fore tringle sides
(Q or a) to Quit
Enter you cheice D
Plz enetra positive binary nunber (base 2-- 1's and e's only) of no nore than d6 digits
arning rong input try again
1z enetr a positive binary number (base 2- 1's and o's only) of no more than 6 digits
darning ..rong input try again
Plz enetr a positive binary nunber (base 2-- 1's and e's only) of no more than 6 digits
The equivalent decinal nunber is 25 for the input binary nunber 111
-(D or d) to convert binary number to its equivalent decimal
-(T or t) to findout wether three numbers will form tringle sides
-(Q or a) to Quit
Enter you choice t
Plz enter 3 positive numbers in the rangel to 100
30 90 see
Warning ....wrong input try again
Plz enter 3 positive numbers in the rangel to 100
30 90 80
The three input values 30 , 90 ,80 can possibly be the three sides of a triangle
- (D or d) to convert binary number to its equivalent decimal
-(T or t) to findout wether three numbers will form tringle sides
-(Q or a) to quit
Enter you choice t
Plz enter 3 positive numbers in the rangel to 10e
30 10 se
The three input values 30, 10, se can NOT be the three sides of a triangle](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ff1741c43-0758-4a09-843b-c2bd58bac29e%2Faa15b9c4-8e12-4550-9ceb-2f30c6554908%2F2eom4u_processed.jpeg&w=3840&q=75)
Transcribed Image Text:The first option of your program will prompt the user to enter a positive binary number
(base 2 -- I's and O's only) of no more than 6 digits. Read this value as an int type value
and your program must make sure that it is indeed a binary number (only I's and Os). If it
isn't, then the user is prompted again. If it is binary, then your program is to calculate the
equivalent decimal value (base 10 -- the number system).
MSB
Binary Digit
LSB
256 128 64 32 16 4
2
1
Representation of a binary number
So for example, converting a Binary to Decimal number would be:
Decimal Digit Value 256 128 64 32 16 8 4 2
Binary Digit Value O I1 o 0 1 0
By adding together ALL the decimal number values from right to left at the positions
that are represented by a "1" gives us:(256) + (64) + (32) + (4) + (1) = 35710 or three
hundred and fifty-seven as a decimal number.
The second option of your program will prompt the user to enter 3 positive numbers in
the rangel to 10, and will tell the user whether the three inputs will form the sides of a
triangle. That is, your program is to determine whether or not the three input values can
possibly be the three sides of a triangle. For instance, 3, 4, and 10 cannot be sides of a
triangle because the longest side is greater than the sum of the other two sides (they don't
satisfy the "triangle inequality").
The third option will be Quit.
Maintain a log of outputs to an output.txt file.
Write three functions,
menu_function, this function will display menu options repeatedly, there is no
returned values from this function.
binary_decimal_function, this function will take as input one integer (base 2)
number and returm as output its equivalent decimal value.
tringle_function, this function will receive as input three integer positive
numbers in the range 1-10, and determine whether or not the three input
values can possibly be the three sides of a triangle.
Example valid/invalid inputs and the expected outputs.
(D or d) to convert binary nuber to its equivalent decinal
(T or t) to findout wether three numbers will fore tringle sides
(Q or a) to Quit
Enter you cheice D
Plz enetra positive binary nunber (base 2-- 1's and e's only) of no nore than d6 digits
arning rong input try again
1z enetr a positive binary number (base 2- 1's and o's only) of no more than 6 digits
darning ..rong input try again
Plz enetr a positive binary nunber (base 2-- 1's and e's only) of no more than 6 digits
The equivalent decinal nunber is 25 for the input binary nunber 111
-(D or d) to convert binary number to its equivalent decimal
-(T or t) to findout wether three numbers will form tringle sides
-(Q or a) to Quit
Enter you choice t
Plz enter 3 positive numbers in the rangel to 100
30 90 see
Warning ....wrong input try again
Plz enter 3 positive numbers in the rangel to 100
30 90 80
The three input values 30 , 90 ,80 can possibly be the three sides of a triangle
- (D or d) to convert binary number to its equivalent decimal
-(T or t) to findout wether three numbers will form tringle sides
-(Q or a) to quit
Enter you choice t
Plz enter 3 positive numbers in the rangel to 10e
30 10 se
The three input values 30, 10, se can NOT be the three sides of a triangle
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 6 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education