Programming in C
4th Edition
ISBN: 9780321776419
Author: Stephen G. Kochan
Publisher: Addison-Wesley
expand_more
expand_more
format_list_bulleted
Question
Chapter 12, Problem 7E
Program Plan Intro
- Include the necessary header files into program.
- Define the macro named “IS_UPPER_CASE()” to find out the uppercase character.
- Define the macro named “IS_LOWER_CASE()” to find out the lowercase character.
- Define the macro named “IS_ALPHABETIC()” to find out the given letter is alphabetic or not. This macro calls both uppercase and lowercase macros to find out the character.
- Define the main function.
- Declare the variable named “value” in type of character.
- Prompt the user and get the value.
- Using “if…else” condition, call the macro “IS_ALPHABETIC ()” which passes an argument and print the resultant values on screen.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Set a macro with symbol ABOUTME with your Student ID and Full Name in the replacement string.
Computer Science
Write a VBA program that replaces all instances of Oklahoma State University in provided text with the words Rose State College. NOTE: some students have had issues sending Word files with macros, so please include a screenshot of the macro
Which directive stops all further expansion of a macro?
Knowledge Booster
Similar questions
- Which of the following commands stops a macro from developing to its full potential?arrow_forwardIt is desired to write a #define macro to compute the product of two numbers. What is the correct macro? Group of answer choices #define multiply (return(a*b)) #define multiply(a,b) (a*b) #define multiply(a,b) (int a*int b) #define multiply (int a, b; return(a*b)) ============= What does the function fopen return? Group of answer choices an integer a FILE pointer it returns nothing the contents of the file it is opening =============== Consider the following code fragment: int main (int argc, char* argv[]) { cout<<argc; return 0; } The code is compiled and executed from the terminal as: .\a.out What will be the output? Group of answer choices 0 1 argc -1arrow_forwardExercisesGive an example for each of these macros to explain its work: Macro: int WIFSIGNALED (int status)This macro returns a nonzero value if the child process terminated because it received a signal thatwas not handled. Macro: int WTERMSIG (int status)If WIFSIGNALED is true of status, this macro returns the signal number of the signal thatterminated the child process. Macro: int WCOREDUMP (int status)This macro returns a nonzero value if the child process terminated and produced a core dump. Macro: int WIFSTOPPED (int status)This macro returns a nonzero value if the child process is stopped. Macro: int WSTOPSIG (int status)If WIFSTOPPED is true of status, this macro returns the signal number of the signal that causedthe child process to stop. take screen shot for code and output in ubuntu kaliarrow_forward
- The Problem: Parameterized macros can cause unexpected things to happen. Consider the following case:#define SQUARE(x) ((x) * (x))int i = 5;int j = SQUARE(i++);What's the value of j? The answer is that it's compiler dependent. And the value of i is definitely not 6. Why? Just look at the code after the macro is expanded:int j = ((i++) * (i++));From this we can see that i is increment twice. Also since the order of the operations is not specified by the C++ standard, the actual value of j is compiler dependent.arrow_forwardWrite a macro named mDumpMemx that receives a single parameter, the name of a variable.Your macro must call the mDumpMem macro from the book’s library, passing it the variable’soffset, number of units, and unit size. Demonstrate a call to the mDumpMemx macro.arrow_forwardWrite a MACRO that performs CHECKSUM test of a given data. It takes two parameters, DATABYTES array and its LENGTH. For example, LENGTH is 5 and DATABYTES is 25h, 62h, 3Fh, 52h, E8h the last byte (E8h) is CHECKSUM byte. Your macro will move 01h to DX if the checksum test passes, otherwise DX is reset (00h) CHECKSUMTEST MACRO DATABYTES, LENGTH .... ENDMarrow_forward
- Discuss the concept of mouse macros and how they can be created and utilized for complex tasks in Windows. Provide an example of a practical application.arrow_forwardIn the study of assemblers what is a macro command? What is an example of macro command? When we should program a function, and when we should program a macro command?arrow_forwardWrite a macro in VBA to approximate the value of the function f(x) = tan (x) at some nonzero point x in radians, using a Maclaurin series through the second derivative term (MLO 3.3). Allow the point x to be input using the InputBox() command. Calculate (a) an upper bound for the remainder term Rn , (b) the exact value of the function at x , (c) the true error Et and the true relative error (MLO 3.2) Output all these values to a blank Excel sheet, and include proper labels! Neatness counts!arrow_forward
- The Problem: How do you create a macro that performs two statements.For example we wish to create a cleanup macro:#define CLEAN_RETURN \ close(in_fd);close(out_fd); return;But this code doesn't work if we put it in an if statement:if (done) CLEAN_RETURN;Expanding this we get:if (done) close(in_fd);close(out_fd); return;Let's add a little whitespace for clarity:if (done) close(in_fd);close(out_fd);return;This is not what we intended. One “solution” is to enclose the statementsin {}.#define CLEAN_RETURN \ { close(in_fd);close(out_fd); return; }Now our if statement expands to:if (done) { close(in_fd);close(out_fd); return; };This works. Sort of. The problem is if we try an if / else statement:if (done) CLEAN_RETURN;else not_done_yet();This gives us a syntax error when we try and compile it. Why?Let's look at the expanded code:if (done) { close(in_fd);close(out_fd); return; };else not_done_yet();There's an extra semicolon on the line. This didn't bother us when therewas no else, but now…arrow_forwardPrepare a dataset with the name of 10 different countries with the number of total corona affected people. Use macro to find the average number of corona affected people. Now create a button which can show the average by using that recorded macro. Now create a dataset with the data of total death in corona for 10 different countries. Apply the recorded macro in a button to show the average death. Inside the excel file please mention the name of your recorded macro file, anywhere in the same tab.arrow_forwardWhich of the following is a mistake when changes are made to models which are complex or poorly built? Choices: A. Where macros have been written poorly written B. All are instances of mistakes C. Where excessive absolute cell referencing is used D. Models which use hard-coded column or row numbers E. Where formulae are used that refer to range on multiple sheetsarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Np Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage