PYTHON HOMEWORK QUESTION def area(side1, side2): return side1 * side2 s1 = 12 s2 = 6 Select all statements that correctly call the area function. A. answer = area(s1,s2) B. print(f'The area is {area(s1,s2)}') C. area(s1,s2) D. result = area(side1,side2)
Q: PYTHON PROGRAMMING A retail company assigns a $5000 store bonus if monthly sales are more than…
A: Introduction PYTHON PROGRAMMING A retail company assigns a $5000 store bonus if monthly sales are…
Q: Help code in Java 21. Compound Interest When a bank account pays compound interest, it pays…
A: Programming Approach: Importing necessary packages. Defining the main class. Create an object of…
Q: Problem 1: Decimal to Binary Conversion Write a program that takes an integer value as an input…
A: import java.util.*;class Test109 { public static void main(String args[]) { Scanner sc = new…
Q: Automate the biconditional. Build a function that will calculate the correct truth value based on…
A: NOTE - Here I have used the Java programming language. I have created a function named…
Q: Package Newton’s method for approximating square roots (Case Study: Approximating Square Roots) in a…
A: Given: Package Newton’s method for approximating square roots (Case Study: Approximating Square…
Q: (Prism Program) Write a program that can calculate the value of the surface area and volume of a…
A: As Programming language is not mentioned, taking C as reference. Inputs : Lenght, Width and Height…
Q: Directions: Create a calculator that has functions than arithmetic operations e.g. scientific…
A: import java.util.Scanner; import java.lang.Math;class Calc { public static void…
Q: Description: A calculator simulator code is presented here to be used for basic mathematical…
A: Answer is given below .
Q: Define a function drawCircle.This function should expect a Turtle object, the coordinates of the…
A: Algorithm: 1.Import math and turtle libraries 2.Define function named draw cirlce with its…
Q: Question:Code the function that returns the number of digits of the integer sent to it with an…
A: function digitCount(int n) START DECLARE count =0 WHILE n>0 do step 4 and 5 SET n=n/10 INCREMENT…
Q: Samples run of the program: le 1 se enter how many line equations you would Like to generate: -4 r:…
A: It is defined as a set of instructions that a computer uses to perform a specific task. The program…
Q: Programming Language (Code With C Programming Language) Problem Title : Visible Trees There is a…
A: #include <stdio.h>int main(){ //number of trees int N; scanf("%d",&N); //array to…
Q: Package Newton’s method for approximating square roots (Case Study: Approximating Square Roots) in a…
A: def newton(n): l = 0.001 x = n while True: root = 0.5 * (x + (n / x)) if…
Q: 3). In a math class you learn about the different operations that can be done to a series. Imagine…
A: Below is C program with explanation: - Explanation: - For the given problem array is used to sort…
Q: Best Race Day In this last problem, we will identify which of the three stages the rider was the…
A: Since the programming language is not mentioned in the question, we will answer this question in the…
Q: write a program which will accept one integer argument and returns count of digits of that argument…
A: First, we pass the argument to function Digitcounter using the main function. Using while loop l…
Q: 9: perfect.cpp) A number is called perfect if the sum of its divisors is equal to the original…
A: #include <iostream>using namespace std; const int LIMIT = 5000; int sumOfDivisors(int); int…
Q: Package Newton’s method for approximating square roots (Case Study: Approximating Square Roots) in a…
A: def newton(n): sgn = 0 if n < 0: sgn = -1 n = -n val = n while True:…
Q: Python Returning Funtion function name: bound_0_to_100 parameters:a number grade returns: the grade…
A: Pseudocode: Define a function named bound_0_to_100 having grade as its parameter If the grade is…
Q: C Programming Language (Code With C Programming Language) Problem Title : Visible Trees There is a…
A: Take the example of Lestari. Lestari will be able to see the following tree in first row 1. 22 1 10…
Q: Define a function drawCircle. This function should expect a Turtle object, the coordinates of the…
A: the code is an given below : Use this code from turtle import *def drawCircle (turtle, x,y, radius):…
Q: Machine Problem:(Computing Body Mass Index)Body Mass Index (BMI) is a measure of health on weight.…
A: Your python program is given below as you required with an output.
Q: Create a program that has the following methods and corresponding usage. AreaCircle - compute…
A: Introduction: In this question, we are asked to write a C# programming to create the two methods :…
Q: Write a program about triangles. You need two files, a module file and an executable file with a…
A: import mathdef isRightTriangle(side1, side2, side3): if math.sqrt(side1 * side1 + side2 * side2)…
Q: Type Code On Program Quartus represent function R(Y, B, S) =(B+S Bar) +(S bar + S) + (BS) +(Y+B bar)…
A: Below i have given:
Q: Define a function drawCircle. This function should expect a Turtle object, the coordinates of the…
A: According to the information given:- We have to follow the instruction to get the desired outcome.
Q: Instructions Define an enumeration type triangleType that has the values scalene, isosceles,…
A: 1) define enumeration 2)declare prototype for the function 3) write switch cases for knowing the…
Q: The Game of Nim Problem Description: Two players alternately take marbles from a pile. In each move,…
A: Program Requirements as per question: The program must define and use the following methods, int…
Q: function/method Write a program that asks the user for his first name and then prints it using a…
A: Code: import java.util.*;public class Main{ void printName(String s){…
Q: Compare Numbers - Python Language please! Programming challenge description: Little Tommy is in…
A: Complete Python Code is below:
Q: function area calculateArea (x, y) % Function to calculate an area given two lengths (x, y) area =…
A: 2. Using MATLAB, output for the given program has been identified by passing the given inputs and…
Q: Python Assignment: In India McDonald's has the n number of customers and they are famous for their…
A: Required:
Q: Congrats! You work for Zillow now. Your first task is to write an algorithm that recommends…
A: Algorithm: 1. Input Apartment size 2. Input number of pets 3. Input rent 4. Display output
Q: 2. Classify Numbers The main parts of the program are:: initialize the variables, read and classify…
A: C++ program
Q: Java Script You go to a jewelry shop and try to find the most expensive piece of jewelry. You write…
A: In this problem, we need to design a javascript program. Input - one map with multiple arguments…
Q: The process of finding the largest number is frequently used in computer applications. For example,…
A: logic:- input 10 positive number and store it in array using loop. store first array value in max…
Q: this assignment you will write a computer program from scratch using the Python programming…
A: Code: def add(a,b): return a+b def subtract(a,b): return a-b def multiply (a,b): return a*b def…
Q: Create a c++ program that will compute for the area of a Triangle, Square, Rectangle, Ellipse, and…
A: The answer is..
Q: Please convert this from Python to C (thank you) def math_game(lv, lmf, lsf, lrf, rv, rmf, rsf,…
A: - We have to implement the python code in c. - We have 8 integers in the function used and the…
Q: Java Script You go to a jewelry shop and try to find the most expensive piece of jewelry. You write…
A: In this problem, we need to design a javascript program. Input - one map with multiple arguments…
Q: Python Assignment: In India McDonald's has the n number of customers and they are famous for their…
A: Coded in Python 3.
Q: Rectangle Area The area of a rectangle is calculated according to the following formula: Width X…
A: Program Code: #include<stdio.h>int area(int w,int l){ int area; area=w*l; return;}main(){ int…
Q: rint a ticket indicating the person's seat number and whether it’s in the first class or economy…
A: The below program is a code for railway reservation(seat selection) for users. It has features of…
Q: IN JS PROGRAMMING LANGUAGE Your local bank has decided to upgrade its ATM machines by incorporating…
A: Your JavaScript program is given below as you required with an output.
Q: Requirements: Include pseudocode that describes all steps required to solve the problem. Employ…
A: import random def show_larger(num1, num2): if num1 > num2: print(num1, "is larger…
Q: Python Returning function function name: is_prime parameters: a number n returns: True if n is…
A: python code A prime number (or a prime) is a natural number greater than 1 and that has no positive…
Q: Create a calculator program that works like a real calculator. It means that the user could enter as…
A: Program: // C programming#include <stdio.h> // Function to evaluate the sum operationint…
Q: Use C Language Airline Reservation System A small airline has just purchased a computer for its…
A: Answer :
Q: n:Temperature Statistics Learning Objectives In this lab, you will
A: def check_input(temperature): # check if the temperature is possible or not # if the…
Q: "Python" a function that asks user for Name First Last Birthday: Month (numeric, e.g. 04, 07, 12,…
A: Step 1 : Start Step 2 : Define a function which takes input from the user the Name(First and Last) ,…
PYTHON HOMEWORK QUESTION
def area(side1, side2):
return side1 * side2
s1 = 12
s2 = 6
Select all statements that correctly call the area function.
A. answer = area(s1,s2)
B. print(f'The area is {area(s1,s2)}')
C. area(s1,s2)
D. result = area(side1,side2)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- this is a python deck of card question, please help with the questions thank you!! heres my code: import random def card_draw():suits = ["s", "h", "d", "c" ]faces = ["2","3","4","5","6","7","8","9","T","J","Q","K","A"]deck = [ ] for suit in suits:for face in faces:deck.append((face+suit[0]))return deck def shuffled_deck( ):#card_draw()new = [ ]# n = random.shuffle(card_draw())new.append(random.shuffle(card_draw())) return new def main():print("Original deck is:")print(card_draw())print("The shuffled deck is:")print(shuffled_deck) if __name__ == "__main__":main()Problem Description: The international standard letter/number mapping found on the telephone keypad is shown below: Write a pseudocode and program that reads a letter and displays its corresponding digit. 2 3 1 ABC DEF 4 5 6 GHI JKL MNO 7 8 9 PQRS TUV WXYZ 0 Write a pseudocode on how you would solve the problem in your own word. Write a java program called Phone considering the following directions. Practice here first then write answer on the answer sheet. Also, make sure distinguish high and low caps as Java is case – sensitive. Import and declare a Scanner class Ask user for an Upper – case letter Use the switch statement along with case and break Use the System.exit(1) in the default to terminate the program Print the corresponding digitpython help So, we will try this one from scratch. Implement the function postalLabel() that takes 6 inputs: a first name (as a string) a last name (as a string) an address (as a string) a city (as a string) a state (as a string) a zip code (as an integer) The user will be prompted to enter the six inputs. As noted, the inputs should be entered as strings except for the zip code. Use the string format method to print the label (no other will be accepted). You must provide the appropriate docstring and the comments for every statement. If this information is missing, you will lose points. Your result should look like the example below except it should be your name with other bogus information (do not put in your address, city and state – make them up). This program should consist of input prompts and a string formatted print stamen.>>> postalLabel() >>> Please enter your first name: Parker >>> Please enter your last name: Jones >>> Please enter…
- Can you please find the correct answer or answers for the question below? Program is in Python. def area(side1, side2): return side1 * side2s1 = 12s2 = 6Identify the statements that correctly call the area function. Select ALL that apply. Question 5 options: result = area(side1,side2) print(f'The area is {area(s1,s2)}') answer = area(s1,s2) area(s1,s2)Please help me with this in Python In python Create a Right Triangle to compute its area and perimeter please create it in Class Right Triangle user input of each sidesManhattan skyline def manhattan_skyline(towers):This classic problem in computational geometry (essentially, geometry that can be done using only integer arithmetic; yes, that is an actual thing) is best illustrated by pictures and animations such as those on the page "The Skyline problem", so you can first check that it out to get an idea of what is going on. Given a list of rectangular towers as tuples (s, e, h) where s and e are the start and end x-coordinates (satisfying e>s) and h is the height of that tower, compute and return the total visible area of the towers, being careful not to double count two or more towers that are partially overlapping. All towers share the same flat ground baseline at the height. The classic solution illustrates the important sweep line technique that starts by creating a list of precisely those x-coordinate values where something relevant to the problem takes place. In this problem, the relevant x-coordinates are those where some tower either…
- C++ Program point* nearer(point* p1, point* p2) This method will return whichever point, either p1 or p2 is nearer to this point. You can use our distance method in this function. If their distances to this point are the same, return p1.PLEASE CODE IN PYTHON The Penny Pitch game is popular in amusement parks. Pennies are tossed onto a board that has certain areas marked with different prizes. For example: The prizes available on this board are puzzle, game, ball, poster, and doll. At the end of the game, if all of the squares that say BALL are covered by a penny, the player gets the ball. This is also true for the other prizes. The board is made up of 25 squares (5 x 5). Each prize appears on three randomly chosen squares so that 15 squares contain prizes.In Python, create a PennyPitch application that displays a Penny Pitch board (use [ and ] to indicate squares) with prizes randomly placed and then simulates ten pennies being randomly pitched onto the board. After the pennies have been pitched, the application should display a message indicating which prizes have been won, if any.7) The ideal gas law allows the calculation of volume of a gas given the pressure(P), amount ofthe gas (n), and the temperature (T). The equation is:V = nRT / PSince we only have used integer arithmetic, all numbers will be integer values with nodecimal points. The constant R is 8.314 and will be specified as (8314/1000). This givesthe same result. Implement the idea gas law program where the user is prompted for andenters values for n, T, and P, and V is calculated and printed out. Be careful toimplement an accurate version of this program. Your program should include a properand useful prompt for input, and print the results in a meaningful manner
- (Population projection) The U.S. Census Bureau projects population based on thefollowing assumptions:■■ One birth every 7 seconds■■ One death every 13 seconds■■ One new immigrant every 45 secondsWrite a program to display the population for each of the next five years. Assume thatthe current population is 312,032,486, and one year has 365 days. Hint: In Java, iftwo integers perform division, the result is an integer. The fractional part is truncated.For example, 5 / 4 is 1 (not 1.25) and 10 / 4 is 2 (not 2.5). To get an accurate resultwith the fractional part, one of the values involved in the division must be a numberwith a decimal point. For example, 5.0 / 4 is 1.25 and 10 / 4.0 is 2.5.Python programming In a department store sale, customers who purchase over 2000 are given 10% discount. Write a program that will accept for the purchase amount of a customer, solve for his/her discount if there’s any, ask for the money he/she is going to pay, then output the discounted price and the change of the customer.”One interesting application of computers is drawing graphs and bar charts.Write a program that prompts the user to enter 5 integers, and then outputs abar chart consisting of asterisks. The number of asterisks in each line of thebar chart must be equal to the number the user entered. You may assume theuser will enter only positive integers or 0. C++ please.