Computer Science: An Overview (13th Edition) (What's New in Computer Science)
13th Edition
ISBN: 9780134875460
Author: Glenn Brookshear, Dennis Brylow
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 6, Problem 7CRP
Suppose the function f expects two numeric values as its inputs and returns the smaller of the two values as its output value. If w, x, y, and z represent numeric values, what is the result returned by f(f(w, x), f(y, z))?
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Going missing
Some calculations involving blank values may give different results to what you might expect. For example, when you pass a blank value into the AND() function, it is treated as TRUE. This is often unhelpful. To make blanks behave in a sensible way in calculations, you must first convert them to be "not available" using NA(). This function takes no inputs, and returns a missing value. To convert a blank value to a missing value, use this pattern.
=IF(ISBLANK(cell), NA(), cell)
Instruction
In column H, use AND() to find women who have kids and get benefits.
In column I, convert the blanks in column G to missing values.
In column J, again find women who have kids and get benefits, this time using column I rather than G.
please show the formula used to "has kids and gets benefits" , "gets benefits with missing values", has kids and gets benefits". Thank you
Is non-white
Has over 12 years of school?
Is married?
Has kids?
Has young kids?
Is head of household?
Gets…
2. Write a Java program to find out the greatest common divisor of two input values using
a function.
A = 3 B = 6 C = 9 D= 7
mod10(X) is a function that returns the modulus of X after dividing it to
10.
abs(X) is a function that returns the absolute value of X.
Examples: mod10(6) = 6, mod10(16)=6, mod10(0) = 0, mod10(15)=5, mod10(41)+12 = 13
abs(4-8) = 4, abs(8-4)=4, abs(2-9) = 7, abs(8-1) = 7, abs(4-4)=0, abs(2-9)+8 = 15
Calculate the following:
K1 = mod10(A+B) + 1= …….
K2 = abs(C-D) + 3 = …….
K3 = abs(D-2) + 1 = …….
K4 = mod10(A+B+C+D) + 1 = …….
K1 = mod((A+B), 10) + 1;
K2 = abs(C-D) + 3;
K3 = abs((D-2)) + 1;
K4 = mod((A+B+C+D),10)+1;
Chapter 6 Solutions
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Ch. 6.1 - In what sense is a program in a third-generation...Ch. 6.1 - We can summarize the imperative programming...Ch. 6.1 - Prob. 4QECh. 6.2 - Why is the use of a constant considered better...Ch. 6.2 - Prob. 2QECh. 6.2 - Prob. 3QECh. 6.2 - Identity some common control structures found in...Ch. 6.2 - What is the difference between an array and an...Ch. 6.3 - Prob. 1QECh. 6.3 - Prob. 2QE
Ch. 6.3 - Why do many programming languages implement I/O...Ch. 6.3 - Prob. 4QECh. 6.3 - Prob. 5QECh. 6.4 - Prob. 1QECh. 6.4 - What is a symbol table?Ch. 6.4 - What is the difference between a terminal and a...Ch. 6.4 - Prob. 4QECh. 6.4 - Prob. 5QECh. 6.4 - Prob. 6QECh. 6.5 - What is the difference between an object and a...Ch. 6.5 - Prob. 2QECh. 6.5 - Suppose the classes PartTimeEmployee and...Ch. 6.5 - What is a constructor?Ch. 6.5 - Why are some items within a class designated as...Ch. 6.6 - Prob. 1QECh. 6.6 - Prob. 2QECh. 6.6 - Prob. 3QECh. 6.7 - Prob. 2QECh. 6.7 - Prob. 3QECh. 6.7 - Prob. 4QECh. 6 - Prob. 1CRPCh. 6 - Translate the following Python program into the...Ch. 6 - Prob. 3CRPCh. 6 - Why was it necessary to identify the type of data...Ch. 6 - Prob. 6CRPCh. 6 - Suppose the function f expects two numeric values...Ch. 6 - Suppose f is a function that returns the result of...Ch. 6 - Prob. 9CRPCh. 6 - Summarize the distinction between a machine...Ch. 6 - John Programmer argues that the ability to declare...Ch. 6 - Summarize the distinction between declarative...Ch. 6 - Explain the differences between a literal, a...Ch. 6 - a. What is operator precedence? b. Depending on...Ch. 6 - Prob. 16CRPCh. 6 - What is the difference between the meaning of the...Ch. 6 - Draw a flowchart representing the structure...Ch. 6 - Prob. 19CRPCh. 6 - Prob. 20CRPCh. 6 - Draw a flowchart representing the structure...Ch. 6 - Rewrite the following program segment using a...Ch. 6 - Summarize the following rats-nest routine with a...Ch. 6 - Prob. 24CRPCh. 6 - Prob. 25CRPCh. 6 - Suppose the variable X in a program was declared...Ch. 6 - Prob. 27CRPCh. 6 - Why would a large array probably not be passed to...Ch. 6 - Sometimes an actual parameter is passed to a...Ch. 6 - Prob. 32CRPCh. 6 - What ambiguity exists in the statement X = 3 + 2 ...Ch. 6 - Suppose a small company has five employees and is...Ch. 6 - Prob. 35CRPCh. 6 - Prob. 36CRPCh. 6 - Prob. 37CRPCh. 6 - Prob. 38CRPCh. 6 - Prob. 39CRPCh. 6 - Design a set of syntax diagrams that describes the...Ch. 6 - Prob. 41CRPCh. 6 - Prob. 42CRPCh. 6 - Add syntax diagrams to those in Question 5 of...Ch. 6 - Prob. 44CRPCh. 6 - What code optimization could be performed by a...Ch. 6 - Simplify the following program segment Y = 5 if (Y...Ch. 6 - Simplify the following program segment while (X !=...Ch. 6 - In an object-oriented programming environment, how...Ch. 6 - Describe how inheritance might be used to develop...Ch. 6 - What is the difference between the public and...Ch. 6 - a. Give an example of a situation in which an...Ch. 6 - Describe some objects that might be found in a...Ch. 6 - Prob. 53CRPCh. 6 - Prob. 54CRPCh. 6 - Prob. 55CRPCh. 6 - Prob. 56CRPCh. 6 - Prob. 57CRPCh. 6 - Prob. 58CRPCh. 6 - Prob. 59CRPCh. 6 - In general copyright laws support ownership rights...Ch. 6 - By using a high-level programming language, a...Ch. 6 - Prob. 3SICh. 6 - Prob. 4SICh. 6 - Prob. 5SICh. 6 - Suppose an amateur programmer writes a program for...Ch. 6 - Prob. 7SI
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- We can assign a value to each character in a word based on their position in the alphabet (a = 1, b = 2, ..., z = 26). A balanced word is one where the sum of the values on the left side of the word equals the sum of the values on the right side. For odd-length words, the middle character (balance point) is ignored. Write a function that returns true if the word is balanced and false if it is not. Examples balance("zips") → true // "zips" = "zi|ps" "zips" = 26+9 | 16+19 = 35 35 = true balanced ("brake") → false // "brake" = "br|ke" = 2+18 11+5 = 2016 = false liarrow_forwardIf you implement the function F(A,B,C,D)= Sum m (3,4,6,11,12,13,14) using a 8-1 MUX then which of the input position will be equal to D : a. I1 & I6 b. only I5 c. I2 & I6 & I7 d. Only I7 e. None of the choices f. I1 & I5arrow_forwardWe can assign a value to each character in a word, based on their position in the alphabet (a = 1, b = 2, ..., z = 26). A balanced word is one where the sum of values on the left-hand side of the word equals the sum of values on the right-hand side. For odd length words, the middle character (balance point) is ignored. Write a function that returns true if the word is balanced, and false if it's not. Examples balanced ("zips") → true // "zips" = "zi|ps" = 26+9|16+19 = 35|35 = true balanced ("brake") // "brake" = "br|ke" false = 2+18 | 11+5 = 20 16 = falsearrow_forward
- In lisp programming Consider the two versions of the function computing the combinations. Add a global variable counter and increment it by one at the top of both functions. This will count the number of function calls required to complete the calculations in each case. Try the two versions of the function for a few pairs of numbers n and m and print out the value of the counter after each of them. Don't forget to reset the counter to 0 before each call. Comment on the observed difference between the numbers of function calls.arrow_forwardSolution please.arrow_forwardIn Matlab: Write a function that takes a month, day, and year as inputs and returns the number of days that have passed since January 1, 780, the year al-Khwarizmi, the "father of algebra", was born (include the 1/1/780 date as day 1). The function should include a subroutine to deal with all leap year calculations. The subroutine is a function that will take a year as an input and will return a 1 if that year is a leap year or a 0 if that year is not a leap year. As a check, the number of days between 1/1/780 and 6/21/2011 is 449,786. Shown below is your starter code with some pseudocode to get you started:arrow_forward
- Write a function safe(n) that takes a non-negative integer n as input where n has at most 2 digits. The function determines if n is a safe number. A number is not safe if it contains a 9 as a digit, or if it can be divided by 9. The function should test if n is safe and return True if n is safe and False otherwisearrow_forwardWrite a value-returning function, isVowel, that returns the value true if a given character is a vowel and otherwise returns false. For the input E, your output should look like the following: E is a vowel: 1arrow_forwardUPVOTE WILL BE GIVEN. USE MATLAB. NO LONG EXPLANATION NEEDED. TAKE A SCREENSHOT.arrow_forward
- Write a function that takes two integers and returns True if the integers have a common divisor that is different than 1, otherwise returns False. For example, notRelPrime(3,5) returns False, whereas notRelPrime (8,12) returns True. Because, 3 and 5 have only one common divisor, which is 1, whereas 8 and 12 are both divisible by 1, 2 and 4. def notRelPrime (a, b):arrow_forward-Gryphon 3. Section 3: Coding assign... ▼ Question 1 Revisit Later How to Attempt? A number is called as Perfect number if the sum of it's factors(excluding itself,including 1) is equal to the same number Write a function to test whether given number is Perfect number or not? Return 1 if given number is perfect, else return 0 Here are some test cases with expected output for given inputs input1 given number Output - Return Value Calculation/Analysis 16 1 1+2+3 == 6 10 1+5+71= 35 1 1+2+4+7+4 = = 28 35 28 Saved: 30 seconds ago € 2 > Attempted: 0/2 C 10 # 1 #include 2 #include 3 11 Read only region start 4 5 int is perfect (int input1) 6 7 11 Read only region end 8 11 Write code here 9 } Use Custom Input +1(800) 265-6038 Compiler: gcc 5.4.0 +91 80471-89190arrow_forwardGiven the following function f, what will be the output of the function call f(3)? int f(int n){ if(n==0) return 1; else return n*f(n+1); }arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Algebraic Expressions – Algebra Basics; Author: TabletClass Math;https://www.youtube.com/watch?v=U-7nq7OG18s;License: Standard YouTube License, CC-BY
Python Tutorial for Beginners 3 - Basic Math, Mathematical Operators and Python Expressions; Author: ProgrammingKnowledge;https://www.youtube.com/watch?v=Os4gZUI1ZlM;License: Standard Youtube License