- A)
Data types:
The variables use data-type during their declaration.
- The data-type is used to determine the size of memory allocated. Here, the compiler allots the memory.
- All data-type needs different size of memory.
Some of the data-types are:
- Integer
- Boolean
- Character
- Double
- Floating point
From the table 2-6:
Variable to hold numbers in the range from 32 to 6,000
From the table 2-6, “short” or “unsigned short” data-type hold numbers in the range from 32 to 6,000.
- B)
Data types:
The variables use data-type during their declaration.
- The data-type is used to determine the size of memory allocated. Here, the compiler allots the memory.
- All data-type needs different size of memory.
Some of the data-types are:
- Integer
- Boolean
- Character
- Double
- Floating point
From the table 2-6:
Variable to hold numbers in the range from 240,000 to 140,000
From the table 2-6, “int” data-type hold numbers in the range from 240,000 to 140,000.
- C)
Data types:
The variables use data-type during their declaration.
- The data-type is used to determine the size of memory allocated. Here, the compiler allots the memory.
- All data-type needs different size of memory.
Some of the data-types are:
- Integer
- Boolean
- Character
- Double
- Floating point
From the table 2-6:
Literal which uses more memory
From the given literal “20” and “20L”; both the literals uses same amount of memory because both the “int” and “long int” data-types size are 4 bytes.
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
STARTING OUT W/C++,...(LL)-W/ACCESS
- Problem Statement The barcode used by the U.S. Postal System to route mail is defined as follows: Each decimal digit in the ZIP code is encoded using a sequence of three half-height and two full-height bars. The barcode starts and ends with a full-height bar (the guard rail) and includes a checksum digit (after the five-digit ZIP code or ZIP + 4), computed by summing up the original digits modulo 10. Define the following functions: Draw a half-height or full-height bar on stddraw. Given a digit, draw its sequence of bars. Compute the checksum digit. Also define global code that read in a five- (or nine-) digit ZIP code as the command-line argument and draws the corresponding postal barcode.arrow_forwardPython program that contains multiple user-defined functions which calculate storage requirements and costs. These functions will provide useful metrics in the context of data storage and backup solutions. Perform the following steps: 1. Create a function named calculate_backup_size that takes two arguments: data_size (in gigabytes) and backup_frequency. This function should return the data_size multiplied by backup_frequency, representing the total storage needed for backups in a week. 2. Create another function named calculate_storage_cost that takes two arguments: backup_size and cost_per_gb. This function should return the value of backup_size multiplied by cost_per_gb, representing the total cost for the backup storage. 3. Create a third function named storage_info that takes four arguments: data_size, backup_frequency, cost_per_gb, and weeks. This function should call calculate_backup_size and calculate_storage_cost functions, taking the appropriate arguments. Then it should…arrow_forwardKindly answer the Questions below. 1. What is the process used to compute the general average?2. What programming structure is used, enabling the program to select appropriategrade remarks?3. How many segments of the “if-else” statement are needed to show appropriateremarks of the gen. average?4. What logical and relational operators where used to state appropriate range ofgrades?5. l operators were used to state the appropriate range of grades?6. Write the complete pseudocode of the program.arrow_forward
- Variable Root 1, Root 2 and Root 3 , Root 4 must be of data type double. It is currently of type sym. Check where the variable is assigned a value. must contain the following functions or keywords: doublearrow_forwardEnter a function in cell D12, based on the payment and loan details, that calculates the amount of interest paid on the first payment. Be sure to use the appropriate absolute, relative, or mixed cell references. Enter a function in cell E12, based on the payment and loan details, that calculates the amount of principal paid on the first payment. Be sure to use the appropriate absolute, relative, or mixed cell references. Enter a formula in cell F12 to calculate the remaining balance after the current payment. The remaining balance is calculated by subtracting the principal payment from the balance in column B. Enter a function in cell G12, based on the payment and loan details, that calculates the amount of cumulative interest paid on the first payment. Be sure to use the appropriate absolute, relative, or mixed cell references. Enter a function in cell H12, based on the payment and loan details, that calculates the amount of cumulative principal paid on the first payment. Need help…arrow_forwardGiven the table below, declare the following variables with the corresponding data types and initialization values. Output to the screen the variable names together with the values.arrow_forward
- 1. Variables defined with the new ES2015 keyword ______________ behave like let variables except they cannot be reassigned. 2. Most of the time, you want to pass a value back to the code that invoked a function for further processing before displaying it. To do this you will use a ____________statement. 3. In jQuery, there are two ways to canonically use the jQuery function to pass our function where the action is going to take place. The two named functions are jQuery and the ______________. 4. A function that is declared without any names identifier is an___________function. 5. To execute a function as soon as they are created, you will need to use an ___________ function expression. 6. To pass whatever values you like to a function and have it run using those values, you need to pass the function _____________ as defined in the function definition.arrow_forwardStep 1: Consider the following values set to variables. myAge = 32 yourAge = 18 myNumber = 81 yourNumber = 17 votingAge = 18 myName = “Katie” yourName = “Bob” Based on the values to the variables in Step 1, do the following conditions result in a true or false statement? (Reference: Boolean Expressions, page 119). The condition True or False myAge >= yourAge yourAge > myAge myAge == 45 yourAge == votingAge votingAge <= yourAge myAge <= votingAge myName != yourName myNumber <= myAge yourNumber >= myAge yourNumber != 17arrow_forward# Define your function here.def driving_cost(driven_miles, miles_per_gallon, dollars_per_gallon): # edit the return statement on line 6 # enter the variable names in place of VARIABLE-NAME # Hint: miles * (gals / miles) * ($ / gals) --> $ return driven_miles * (1.0 / VARIABLE-NAME) * VARIABLE-NAME if __name__ == '__main__': #leave this statement as is. miles_per_gallon = float(input()) #leave this statement as is. dollars_per_gallon = float(input()) #leave this statement as is. # edit the next three lines replacing the correct variable names # for the VARIABLE-NAME placeholder text print('Cost for 10 miles: {:.2f}'.format(driving_cost(10.0, VARIABLE-NAME, VARIABLE-NAME))) print('Cost for 50 miles: {:.2f}'.format(driving_cost(50.0, VARIABLE-NAME, VARIABLE-NAME))) print('Cost for 400 miles: {:.2f}'.format(driving_cost(400.0, VARIABLE-NAME, VARIABLE-NAME)))arrow_forward
- Please provide the function or module header in in c++ code for each of the following. Include comments that describe the parameters and return values (if a value is returned). Do not define the function, just give the header or prototype and comments. Be sure to indicate if the parameters need to be passed by reference. 1. Swaps two reals. 2. Calculates and returns the sales tax of 8.25 given the price and the amount of the tax rate (both as reals). 3. Returns the concatenation of two strings. 4. Performs a search of a string for a character and returns true if the character is found and false otherwise. Expert Solution arrow_forward Swaps two reals void swap(int&,int&);//used to swap two integers.parameters are passed by reference arrow_forward Calculates and returns the sales tax of 8.25 given the price and the amount of the tax rate float calculate(float,float);//returns the sales tax of 8.25 given the price and the amount of the tax rate…arrow_forwardPlease provide the function or module header in in c++ code for each of the following. Include comments that describe the parameters and return values (if a value is returned). Do not define the function, just give the header or prototype and comments. Be sure to indicate if the parameters need to be passed by reference. 1. Swaps two reals. 2. Calculates and returns the sales tax of 8.25 given the price and the amount of the tax rate (both as reals). 3. Returns the concatenation of two strings. 4. Performs a search of a string for a character and returns true if the character is found and false otherwise.arrow_forwardat most one paragraph, describe a scenario that will require the use of multiple functions and parameters for an application. You may use your Chapter 10 practice problems as a guide: #6, 7. Your assignment should require at least: One function that returns a value One function that does not return a value One or more parameters Then, solve your own problem. The solution should include: an IPO chart to describe the solution a function table that includes a row for EACH function flowcharts for each function in the table a complete Python program that implements your solution.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education