Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Procedure (Design) Think about how to implement this and write it in human language (pseudo-code): First, write generic, high-level steps with little or no detail.
Procedure (Design) Think about how to implement this and write it in human language (pseudo-code): First, write generic, high-level steps with little or no detail. These steps describe basically what your program will do. 1. 2. Next, write more detailed operations between the high-level steps. These operations describe how your program will work. If they haven't made themselves obvious already in Step 1, you'll identify where you should use conditional statements in this step 3. Consider what the program must keep track of (e.g. user inputs, operator, etc.). Identify what your variables will be. 4. Now think about what could possibly go wrong, and add error checking into your plan. For example, what if the user enters an unsupported operator? What if the user enters an equation that has no solution (such as division by zero)? You can decide how the program will handle errors. It can report the problem, ask the user to start over, or simply quit altogether. In any case, it should not continue to process bad input. Before you start writing code, save a copy of your design. If you did your design on paper, type the main steps into a text file for later use in your code. Write Code Create a New Project (Eclipse) Click on "Hello world" in the Project Type box and be sure MinGW GCC" is selected in Toolchains. Click "Finish". Expand the project if necessary to view its contents Recall you're selecting the "Hello World" project to sove yourself o few steps setting up a new project. 1) Copy your pseudo-code into your C source file. a. b. c. After you copy them into the file, select them. Right-click on the selection Choose "Source" and then choose "Toggle Comment" 2) Begin writing valid C statements to do what the pseudo-code describes. Don't delete your pseudo-code. It should remain in your code as helpful commentary to indicate what you intended that line or section of code to do. 3) Use a fflush(stdout) statement before each scanf0. This ensures any preceding printf statements show on the screen 4) Consider using a switch) statement as an alternative to several if)-else statements to check which operator the user typed. (Consult your book or online resources on how to use switch().) 5) Loops are not required to create this program. Procedure (Design) Think about how to implement this and write it in human language (pseudo-code): First, write generic, high-level steps with little or no detail. These steps describe basically what your program will do. 1. 2. Next, write more detailed operations between the high-level steps. These operations describe how your program will work. If they haven't made themselves obvious already in Step 1, you'll identify where you should use conditional statements in this step 3. Consider what the program must keep track of (e.g. user inputs, operator, etc.). Identify what your variables will be. 4. Now think about what could possibly go wrong, and add error checking into your plan. For example, what if the user enters an unsupported operator? What if the user enters an equation that has no solution (such as division by zero)? You can decide how the program will handle errors. It can report the problem, ask the user to start over, or simply quit altogether. In any case, it should not continue to process bad input. Before you start writing code, save a copy of your design. If you did your design on paper, type the main steps into a text file for later use in your code. Write Code Create a New Project (Eclipse) Click on "Hello world" in the Project Type box and be sure MinGW GCC" is selected in Toolchains. Click "Finish". Expand the project if necessary to view its contents Recall you're selecting the "Hello World" project to sove yourself o few steps setting up a new project. 1) Copy your pseudo-code into your C source file. a. b. c. After you copy them into the file, select them. Right-click on the selection Choose "Source" and then choose "Toggle Comment" 2) Begin writing valid C statements to do what the pseudo-code describes. Don't delete your pseudo-code. It should remain in your code as helpful commentary to indicate what you intended that line or section of code to do. 3) Use a fflush(stdout) statement before each scanf0. This ensures any preceding printf statements show on the screen 4) Consider using a switch) statement as an alternative to several if)-else statements to check which operator the user typed. (Consult your book or online resources on how to use switch().) 5) Loops are not required to create this program
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