Concept explainers
Which of the following preprocessor directive is correct?
Want to see the full answer?
Check out a sample textbook solutionChapter 1 Solutions
Introduction to Programming with C++
Additional Engineering Textbook Solutions
C++ How to Program (10th Edition)
Absolute Java (6th Edition)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Starting Out with Programming Logic and Design (4th Edition)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
C How to Program (8th Edition)
- Using Dev C ++, create a program: Number Conversion:Convert a Binary Number to Decimal, Octal, and Hexadecimal. The process of how to solve Binary to Octal (ONLY) must be seen at the end of the output or during run time. Requirements: The program created should include the following structures: conditional looping programmer-defined functions (no header file creation) arrays and/or strings p.s. use beginner code only.arrow_forwardInstructions Consider the provided C++ code in the main.cpp file: The function func2 has three parameters of type int, int, and double, say a, b, and c, respectively. Write the definition of func2 so that its action is as follows: Prompt the user to input two integers and store the numbers in a and b, respectively. If both of the numbers are nonzero: If a >= b, the value assigned to c is a to the power b, that is, aᵇ. If a < b, the value assigned to c is b to the power a, that is, bᵃ. If a is nonzero and b is zero, the value assigned to c is the square root of the absolute value of a. If b is nonzero and a is zero, the value assigned to c is the square root of the absolute value of b. Otherwise, the value assigned to c is 0. The values of a, b, and c are passed back to the calling environment. After completing the definition of the func2 and writing its function prototype, run your program. Code Given: #include <iostream> #include <cmath> #include <iomanip>…arrow_forwardConvert Infix expression to postfix expression by applying following checks:1.There should be not an operator occurring twice in an expression.2.There should be no closing bracket without opening bracket.3.If there is a bracket after operand then perform multiplication. Write comments for above checks. Code in C++ Dont use pointers. I want above three checks Please dont send code from internet of infix to postfix.arrow_forward
- Which of the following preprocessor directive will work with all C++ compilers? a. #include < iostream>b. #include <iostream >c. include <iostream>d. #include <iostream>arrow_forwardDon't use any inbuilt function.arrow_forward1. Which of the following statements are correct? (Select all that applies.) Group of answer choices "ABCDEFG" and "XZACKDFWGH" have "ACDG" as a longest common subsequence. If X is of length n, then it has 2^n subsequences. There is a dynamic programming approach to the longest common subsequence problem. 2. What is the correct syntax to create a NumPy array? Group of answer choices np.object([1, 2, 3]) np.createArray([1, 2, 3]) np.array([1, 2, 3]) 3. What is the correct Pandas function for loading CSV files into a DataFrame? Group of answer choices csv_read() read_csv() loadcsv()arrow_forward
- Binary Addition. Write a Python program that adds numbers together in binary. The user will be prompted to enter integers to be added and the program will output the addition result in binary. You must create a toBinary() function that converts an integer to binary. (You are not allowed to use the python bin() function). You must also create a binary Add() function that takes two binary strings and adds them together. You are not allowed to use ‘+’ or sum meaning that you must also convert the integers to binary before adding the binary strings together.arrow_forwardC++ Select one of the following A-D that is the proper keyword to deallocate memory? A. free B. delete C. clear D. removearrow_forwardAdd a function to get the CPI values from the user and validate that they are greater than 0. 1. Declare and implement a void function called getCPIValues that takes two float reference parameters for the old_cpi and new_cpi. 2. Move the code that reads in the old_cpi and new_cpi into this function. 3. Add a do-while loop that validates the input, making sure that the old_cpi and new_cpi are valid values. + if there is an input error, print "Error: CPI values must be greater than 0." and try to get data again. 4. Replace the code that was moved with a call to this new function. - Add an array to accumulate the computed inflation rates 1. Declare a constant called MAX_RATES and set it to 20. 2. Declare an array of double values having size MAX_RATES that will be used to accumulate the computed inflation rates. 3. Add code to main that inserts the computed inflation rate into the next position in the array. 4. Be careful to make sure the program does not overflow the array. - Add a…arrow_forward
- Q NO 1: There are two ways to pass arguments to functions. Pass by value and pass by reference. Let’s suppose you have to write multiplication function which receives two integers (as arguments) given by user from main. The multiplication operation will be carried out through their addresses. Solve this problem by writing a C++ program.arrow_forwardUsing c++ oop solve below program.Make function and call them into main function. Add new Shop Keeper To add a new shop keeper, your program should ask some credentials from the user to register a shop keeper. Credentials you must ask includes: S-id (Shop keeper id) should be in proper format as string to use in future modules [All the info should be taken in same order] ⮚ First Name ⮚ Last Name ⮚ S-id (should be auto generated by the system in increasing order) [format should be Shopkeeper e.g., 0001 for first shopkeeper and 1001 for one thousand and one shopkeeper number] ⮚ Username ⮚ Email ⮚ Password ⮚ Registration Date ⮚ Gender ⮚ Blood Group ⮚ Contact No ⮚ Address After this, you must record all the above-mentioned data save data within a file named as “shopkeeper.txt” present in the same directory. \ Edit Shopkeeper details Your program should be capable of editing the shopkeeper's basic details. The details that administrator can edit includes: ⮚…arrow_forwardIdentify errors from the following C++ code:arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning