1. Engineering
  2. Computer Science
  3. program description in this introductory assignment you will write a...

Question: program description in this introductory assignment you will write a...

Question details

PROGRAM DESCRIPTION In this introductory assignment, you will write a complete C program that will implement a simple menu-driven calculator that will prompt for the arithmetic operation (addition, subtraction, multiplication, or division) along with two integers between 1 and 100, inclusively, and then perform that operation on those integers to produce the result. The twist is that each arithmetic operation must be performed using bitwise operators rather than the traditional operations This project will be organized in a header file called major0.h, a source code file called major0.c, which will contain the main() function, and four individual source code files called addition.c, subtract.c, multiply.c, and division.c that will contain the function definition for their respective arithmetic operations. The entire group will be responsible in general for non-operation specific functionality in the major0.h and major0.c source code files while each individual group member is responsible for his/her own arithmetic operation in the appropriate files (including the header file and inside the main() function) In particular, you are expected to have the following functionality for each file major0.h This is the overall header file for the project that will contain any include directives and function prototypes. While the include directives are general for the team, each member is expected to add their own function prototype for the arithmetic operation he/she is responsible for major0.c This is the code file with the main ) function that will do the following: (1) display the menu, (2) read in the users response for the menu selection, (3) prompt for and read in two integer operands between 1 and 100, inclusively, and then, based on the menu selection, (4) call the appropriate function call for the specified operation, passing the integer operands as parameters to the function This functionality will be contained in a loop that will continue to iterate until the user selects the option to end the program. If the user enters a valid outside of 1 of 5the 1 - 5 range, you will print a meaningful error message and re-display the menu. Additionally, you will continue to prompt for and read in each integer operand until the user enters an appropriate value (no error message is needed here). While the menu and integer operands are general for the team, each member is expected to add the function call for the arithmetic operation he/she is responsible for addition.c This code will contain a single function (and the include directive to your header file) to perform the addition operation with the two integer operands passed to this function. However, this operation must be done using bitwise operators, and not the “+ operator (or related equivalent function calls). One team member, and only one team member, will be responsible for the source code in this file, though collaboration with other team members may be done if needed subtract . c This code will contain a single function (and the include directive to your header file) to perform the subtraction operation with the two integer operands passed to this function. However, this operation must be done using bitwise operators, and not the - operator (or related equivalent function calls). One team member, and only one team member, will be responsible for the source code in this file, though collaboration with other team members may be done if needed multiply.o This code will contain a single function (and the include directive to your header file) to perform the multiplication operation with the two integer operands passed to this function. However, this operation must be done using bitwise operators, and not the operator (or related equivalent function calls). One team member, and only one team member, will be responsible for the source code in this file, though collaboration with other team members may be done if needed This code will contain a single function (and the include directive to your header file) to perform the integer division operation with the two integer operands passed to this function. However, this operation must be done using bitwise operators, and not the / operator (or related equivalent function calls). One team member, and only one team member, will be responsible for the source code in this file, though collaboration with other team members may be done if needed Note that the expectation for this assignment assumes that a group contains 4 students but if, for some reason, a team has only 3 students, then only 3 operations (i.e., five files) would need to be supported. This means that each team member is responsible for one and only one arithmetic operationSAMPLE OUTPUT (user input shown in bold) $ ./mathmenu Enter the menu option for the operation to perform: (1) ADDITION (2) SUBTRACT (3) MULTIPLY (4) DIVISION (5) EXIT Error Invalid option. Please try again Enter the menu option for the operation to perform: (1) ADDITION (2) SUBTRACT (3) MULTIPLY (4) DIVISION (5) EXIT Error Invalid option. Please try again Enter the menu option for the operation to perform: (1) ADDITION (2) SUBTRACT (3) MULTIPLY (4) DIVISION (5) EXIT Enter first operand between 1 and 100, inclusively:-1 Enter first operand between 1 and 100, inclusively: 72 Enter second operand between 1 and 100, inclusively: 101 Enter second operand between 1 and 100, inclusively: 41 7241113 Enter the menu option for the operation to perform: (1) ADDITION (2) SUBTRACT (3) MULTIPLY (4) DIVISION (5) EXIT Enter first operand between 1 and 100, inclusively: 87 Enter second operand between 1 and 100, inclusively: 26 87-26-61

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution