Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can I get assistance with the following. Here are the requirements Modify the program Figure 2.10 (limit/num). Review the book section on the switch statement

Can I get assistance with the following. Here are the requirements

Modify the program Figure 2.10 (limit/num). Review the book section on the switch statement and the 'else if' clause Add new 'const' variables: base2, base3, base8, base10 and base16. Assign them the value the name implies Ask the user to enter a number base (2, 3, 8, 10 or 16) Follow the table below to output the correct value: base output ----- ------ 2 Binary 0..1 3 Trinary 0..2 8 Octal 0..7 10 Decimal 0..9 16 Hexidecimal 0..F In other words, the program used to do this: 99 low Now it should do this 8 Octal 0..7 If you run it again: 2 Binary 0..1 If you run it again: 16 Hexidecimal 0..F Use 'else if' statements AND the 'const' variables to test the input. Use an 'else' at the very end and print an error messge when the input is NOT 2,3,8,10 or 16 

Here is my code.

#include #include

int main(int argc, char** argv) { const int limit = 100; int num; scanf("%d", &num); if(num >= limit){ printf("high "); } else{ printf("low "); }

return (0); }

Thank you

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

More Books

Students also viewed these Databases questions

Question

3. examine special considerations relative to aggression and sport,

Answered: 1 week ago