Show the printout of the following code:def f(w = 1, h = 2):print(w, h)f()f(w = 5)f(h = 24)f(4, 5)
Q: C++ Write a while loop that prints userNum divided by 4 (integer division) until reaching 2 or…
A: Algorithm: 1. Start2. Initialize an integer variable "userNum".3. Input value into "userNum".4. If…
Q: print an integer as a binary number.
A: ANSWER: Print an Integer as Binary Number: For change over number n into its parallel design, then…
Q: Implement the following two functions: // Returns true if all the sides of the triangle // are same.…
A: C++ code: #include <iostream>using namespace std; //function returns true if all the sides of…
Q: 4) Complete the Java code for the following for loop: for (int i= 1; i <= 6; i++){ // your code here…
A: Answer: Java Source Code: public class Main{ public static void main(String[] args) { int number…
Q: What is the output of the code below? def mystery_func(input, num, t = 0, x = 10, y = 10) [this…
A: The output of the code is 1.
Q: What is the output of the code below? def mystery_func(input, num, t = 0, x = 10, y = 10) [this…
A: Solution :
Q: 1 #what is the output when the following is executed? 2 E for x in range (1, 6): for y in range (x):…
A:
Q: The language we are using here is in Racket. Please enter the following code: (cond ((equal? 16…
A: 1) The return value of above code is 18. 2) When we replace all the 16s in the above code with 8 the…
Q: 6. Which of the below code contains correct overloading code? Why would the other won't work? Code 1…
A: Code 1 is the correct overloading code. When we make a function call to an overloaded function, to…
Q: Given initial values of x and a code: and count count+=y; if (count 3 X--; else X++; Give the value…
A: Given x=2,y=1,count=2 count =count+y=2+1
Q: What's wrong with this code? float q;int *p;q = 100.7;p = &q;
A: The objective of the question is to identify the error in the given piece of code.
Q: simple shell script program: 1.Using gitbash Find the numbers that can be expressed as the product…
A: simple shell script program: 1. Using gitbash, Find the numbers that can be expressed as the product…
Q: Q2) Write a QBASIC program to compute the volume of cube, right circular cone, sphere depending on…
A: Code: Dim V as DoubleDim op as Integer PRINT "1. Compute the volume of cube"PRINT "2. Compute the…
Q: Write the data type that is used to store the number 4.5
A: Please find the answer below :
Q: X Write a program that converts Fahrenheit to Celsius . The formula for the conversion is as follows…
A: Note: Since you have not provided the language to write the code so I am using C language to write…
Q: (1) Prompt the user to input a food item name, price, and quantity. Output an itemized receipt.
A: Start Input the name of the first food item (item_name) Input the price of the first food item…
Q: 2- Write a Python program that determines a student's grade. The program will read three types of…
A: CODE is given below
Q: ': The output of the following program is for k=1:5 If (rem(k,3) #0 && floor (k/2 # k/2 && floor…
A: Here, we have to choose an option for the above question.
Q: Q4: Create a function that multiply's two numbers together and outputs the answer. The function must…
A: Q4: Following is a simple function in JavaScript that multiplies two numbers, say, x and y: var…
Q: ("2+3=4" A "1+1 = 3") → (“10+2 = 3" v “2+2 = 4"). True O False
A: Option A: True
Q: /*12: Create a function named hello that has a $name parameter and outputs "Hello Dave!" when it is…
A: As per the requirement the program has been completed. Algorithm: Step 1: Start Step 2: Declare the…
Q: A company want to raise the salary of its employee. The raise rate is given as following: • The…
A: THIS IS A MULTIPLE QUESTION BASED PROBLEM. ONLY FIRST QUESTION IS ANSWERED. KINDLY SEND THE…
Q: Trace the following code by showing the values of the 3 variables in the table on the right, for…
A: <Code in java Script> let $x= 1; console.log($x) //$x will be 1 let $y = 2;…
Q: Which of the following is equivalent regular expressions? (i) ((01)*(10)*)* (ii) (10 + 01)* (iii)…
A: We say that two regular expressions R and S are equivalent if they describe the same language.
Q: Write a function called adder which has a variable number of integers as arguments and returns the…
A: The code is given below.
Q: Consider the following code: j = 3 while j < 10 : print("J has value ", j) After how many times does…
A: In the provided code, the loop would run indefinitely. An increment statement such as "j = j + 1" or…
Q: D#include #include #include using namespace std; void rightTriangle(double, double); //function…
A: provided correct code below with output
Q: 7.18 LAB: A jiffy A jiffy" is the scientific name for 1/100th of a second. Define a function named…
A: Algorithm: 1. Take Input. 2. Read the function and return userJiffies/100. 3. Display Output to 3…
Q: %% [0-9] printf("number"); [a-zA-Z] printf("letter"); T+EN+ printf("10"); According to…
A: In lex rules, for some input string output is given according to the first matched rules. And…
Q: PYTHON CODE. KEEP OUTPUT SAME. Implement the following: Given:item1 = 'Pens' item2 = 'Pencils'…
A: item1 = 'Pens'item2 = 'Pencils'price1 = 0.99price2 = 1.5print(f'New Markdown: {item1}\t\t\tBuy one…
Q: The program prompts the user for five to ten numbers all on one line, separated by spaces,…
A: The following code given below
Q: CODE IN C: Input four float numbers; they could be positive or negative. Only add all inputted…
A: We need to write a program to print the sum of all Negetive Decimal numbers inputted by the user. We…
Q: Write code that keeps reading integers until # or until capital letter is entered. For each read…
A: Note: Answering in python as no language is mentioned. Input : Input number until termination…
Show the printout of the following code:
def f(w = 1, h = 2):
print(w, h)
f()
f(w = 5)
f(h = 24)
f(4, 5)
Step by step
Solved in 2 steps with 1 images
- What is the output of the following code ? x = 0 if x < 4 : x = x + 1 print ("x is " , x )6. (Geometry: area of a pentagon) The area of a pentagon can be computed using the following formula (s is the length of a side): Area 5x s² 4 X tan TT 5 Write a program that prompts the user to enter the side of a pentagon and displays the area. Here is a sample run: Enter the side: 5.5 Enter The area of the pentagon is 53.04444136781625[Python Language] A common back-of-the-envelope technique for estimating a runner’s marathon time is to take their best half-marathon time, multiply by two and add ten minutes. This works pretty well unless the marathon course is hilly.If it is hilly, we add an extra 20 minutes to the estimate. Write a program that takes two lines of input: a float giving the half- marathon time in minutes and an integer indicating whether the marathon course is hilly(1) or not (0). It prints a float giving the estimated number of minutes the runner will take to run the full marathon. Write your pro- gram in a file named marathon.py.
- QI: tinclude (a) Write two different techniques to declare and initialize a variable with an example. using namespace std; void repchar(char, int); int main() (b) Write a program that simulates a simple cakulator. It reads two integers and a character. If the character is a +', the sum is printed; if it is a , the difference is printed: if it is a *", the product is printed; if it is a ", the quotient is printed; and if it is a %', the repchar(", 43): cout "Data type Range" endl; repchart-, 23). cout e "char-128 to 127" < endlPrint the given line in F95. "Welcome to programming journey with F95".6. You are given the following function that will calculate the sum of the first n numbers where n is an argument to the function. When n is 10, it should print out 55, but instead it prints out 10. Find and fix the problem. int findsum (int n) { int sum = 0; for (int i=1; iWhat is the output of the following code? a = 200 b = 33 c = 500 if a > b and c> a: print(a+c) else: print(a)Python (this is not graded this is practice work that is not graded) write and test a function which takes two dates (month, day) list arguments.When the function is called with the two arguments, it returns the number of days betweenthose two dates. Print the returned value. It is assumed that the first date occurs first. Forinstance, if the users calls the function with FUNCTION([12, 10], [12, 20]) as arguments, thereturned value is 10 days. However, if FUNCTION([12, 20], [12, 10]) is called, the returnedvalue is -10 days.Assume February has 28 days.Test data: [10, 30], [5, 20] [1, 30], [5, 25] [5, 25], [1, 30] [1, 1], [12, 31]Convert the following statements into intermediate code: int r=0;for (int i=0; i<10; i++) r=r+i;Recommended textbooks for youDatabase 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:PEARSONC 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 EducationDatabase 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:PEARSONC 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