def area(side1, side2): return side1 * side2 s1 = 12 s2 = 6 Identify the statements that correctly call the area function. Select ALL that apply. Question options: A print(f'The area is {area(s1,s2)}') B answer = area(s1,s2) C result = area(side1,side2) D area(s1,s2)
Q: 1. [LO 1, LO 2, LO 3 & LO 4, Treasure Hunter Description You are in front of a cave that has…
A: Answer: I have done code and also I have attached code and code screenshot as well as output
Q: Java Script You go to a jewelry shop and try to find the most expensive piece of jewelry. You write…
A: Algorithm - Design a method with one argument as a string. Now use the below logic to solve the…
Q: 4. Area of a Rectangle • Write a program that compares the area of two rectangles. You can do this…
A: len_rect1 = float(input("Enter the length of first rectangle: ")) # taking the length of rect1…
Q: Private Sub btnDisplay_Click(...) Handles btnDisplay.click Dim acres As Double 'number of acres in a…
A: Given that What is the output displayed when the button is clicked? Private Sub…
Q: write the psuedocode and drow the flowchart Create a program to enter grades and calculate averages…
A: In this question it asked to give the pseudocode and draw a flowchart. The question needs to create…
Q: public void setQuantity(int quantity}{ minimum quantity is 10 if invalid set it to 10 if(quantity <…
A: Given: Fill in the blanks.
Q: (PYTHON) A nutritionist who works for a fitness club helps members by evaluating their diets. As…
A: - We yave to help the nutritionist with the code.
Q: C++ Visual 2019 A particular talent competition has five judges, each of whom awards a score…
A: Note: As score can double data type ,so, return type of findLowest() and findHighest() function…
Q: (Rounding Numbers) Function floor can be used to round a number to a specific decimal place. The…
A: Given: (Rounding Numbers) Function floor can be used to round a number to a specific decimal…
Q: **3.19 (Geometry: point in a circle?) Write a program that prompts the user to enter a point (x, y)…
A: Step-1: StartStep-2: Declare variable x, y, distanceStep-3: Calculate distance by using square root…
Q: Assignment Description This program will simulate part of the game of Yahtzee! This is a dice…
A: Python code: yahtzee.py:
Q: A particular talent competition has 5 judges, each of whom awards a score between 0 and 10 to each…
A: Given: To write a program that uses these rules to calculate and display a contestant’s score. A…
Q: Enter the number of days: Day Cents $ 0.01 2 $ 0.02 3 $ 0.04 4 $ 0.08 $ 0.16 $ 0.32 $ 0.64 $ 1.28 $…
A: Find Your Code Below
Q: Java Script You go to a jewelry shop and try to find the most expensive piece of jewelry. You write…
A: The Javascript code is given below with output screenshots
Q: Java Script You go to a jewelry shop and try to find the most expensive piece of jewelry. You write…
A: Algorithm - Design a method with one argument as a string. Now use the below logic to solve the…
Q: 3. Write an application that reads the radius of a sphere then calculates and displays the…
A: Introduction
Q: (Simple computation) The formula for computing the discriminant of a quadratic equation ax^2 + bx +…
A: Given Information-The quadratic equation is shown below- 3x2 + 4x + 5=0Comparing it to standard…
Q: q1) provide commneted code for each line of code
A: I have given the whole code with proper comments so that you can understand it well. Hope it will…
Q: Q5: Complete the function that calculates the position of an object at any time t> 0. The initial…
A: code def calculate_position(s0,u0,a,t): position = u0*t + 0.5*a*t*t position=position+s0…
Q: **3.23 (Geometry: point in a rectangle?) Write a program that prompts the user to enter a point (x,…
A: C++ Program for above : #include <iostream> using namespace std; int main() { int…
Q: Asap!! C# language A bank is offering Gold and Silver Credit Cards to its customers. Gold Card…
A: Objective: This program creates classes for storing information about two types of cards, i.e. Gold,…
Q: C# language A bank is offering Gold and Silver Credit Cards to its customers. Gold Card allows a…
A: using System; class InvalidCreditAmount : Exception{ public InvalidCreditAmount(String…
Q: Hospital Patients Write a program that computes and displays the charges for a patient’s hospital…
A: Programming is a way to instruct the computer devices to operate. Every computer needs a set of…
Q: This program assigns values to two variables // and performs mathematical operations with them
A: Errors 1. System.out.println("adding " + x + y); The above statement concatenates the value of x and…
Q: Transcribed Image Text JAVA Programming Problem: In the game of "Assassin's Creed", you control a…
A: As per the given problem statement we are required to develop a JAVA program to output the number of…
Q: 10) The assignment statement p = d; is legal even though p is not a Dog.
A: Please see the next step for solution
Q: Function Name: dominosTime() Parameters: N/A Returns: None Description: During the summer, you…
A: Python used to answer this question
Q: (Simple computation) The formula for computing the discriminant of a quadratic equation ax^2 + bx +c…
A: 1) Since you have not specified programming language, I have written program in C language 2)…
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: Questions - (Has 2 Parts). Based on each code, which answer out of the choices "A,B,C,D,E" is…
A: Refer to step 2 for the answer.
Q: Value returning method Write a program to calculate items sale price
A: Given: Value returning method Write a program to calculate items sale price
Q: ISSUE NEEDED TO BE SOLVED: I attached the error codes that keep presenting themselves with the code…
A: Below is the explanation:
Q: Code a game of sudoku in C++ where the user needs to guess the missing numbers in the grid. The grid…
A: The code implementation is given in the below steps.
Q: Write a loan calculator program that computes both monthly and total payments for a given loan…
A: As no language was mentioned, So, solving with C++. #include<iostream> using namespace std;…
Q: Write method IsEven that uses the remainder operator (%) to determine whether an integer is even.…
A: Program : import java.util.Scanner; public class Main { public static boolean isEven(int z){…
Q: 2.15 (Geometry: area of a hexagon) Write a program that prompts the user to enter the side of a…
A: here in this question we have asked to write a program which take hexagon side from the user and…
Q: ++ program int quadrant() This method will return at which quadrant does this point lie in our…
A: Required: C++ program int quadrant() This method will return at which quadrant does this point lie…
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: Note: The code is written you can just tell the explanation what is happening in the code Explain in…
A: The program is for getting next prime number. The explanation of the following code is given by:…
Q: Method: sumOdds(value: int): This method will sum all the odd values from 1 upto the value passed by…
A: A Python code for the given methods is as follows,File name: “main.py”import randomdef…
Q: Unfair hurdles are hurdles which are either too high, or way too close together. Create a function…
A: I give the code in Python along with output and code screenshot
Q: (Algebra: solve quadratic equations) The two roots of a quadratic equation ax + bx + c = 0 can be…
A: read a , b and c from user. pass value of a,b and c to function RootFind. check if a==0 display…
Q: Program Unit Score Calculator Console App Write a Python Console Application program that allows…
A: First, we will input all the marks. Then we will find the total marks by doing the summation of all…
Q: Trivia Game In this programming exercise, you will create a simple trivia game for two players. The…
A: Question.py • Define the class named “Question”. ○ Define “__init__()” method for “Question”…
Q: Q1 Write T if the sentence is true and F if the sentence is false and correct the false sentence.…
A: Note - As per the guidelines we are only allowed to answer 1 question with three sub parts at a…
Q: (Simple computation) The formula for computing the discriminant of a quadratic equation ax^2 + bx +…
A: class Exercise01_01Extra { public static void main(String[] args) { // Declaring variables…
Q: Program4 - (from ch7) - Computer-Assisted Instruction (Project Name: AITeacher) - The use of…
A: Actually, given information: The use of computers in education is referred to as computer-assisted…
Q: a) Print the even numbers between 3 and 43. b) Print every third letter starting with 'B'. c) Print…
A: #include <iostream>using namespace std; void a() { int i; cout << "a() ->" <<…
def area(side1, side2):
return side1 * side2
s1 = 12
s2 = 6
Identify the statements that correctly call the area function. Select ALL that apply.
Question options:
A |
print(f'The area is {area(s1,s2)}') |
B
|
answer = area(s1,s2) |
C
|
result = area(side1,side2) |
D
|
area(s1,s2) |
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
- Assignment Description This program will simulate part of the game of Yahtzee! This is a dice game that involves rolling five dice and scoring points based on what show up on those five dice. The players would record their scores on a score card, and then total them up, and the player with the larger total wins the game. A Yahtzee score card has two portions: The upper portion has spaces for six scores, obtained by adding up all of the 1's, 2's, 3's, etc. The lower portion has special scores for various combinations: Three of a kind -- at least 3 dice are the same number;the score is the sum of all five dice Four of a kind -- at least 4 dice are the same number;the score is the sum of all five dice Small straight -- four consecutive numbers are represented, e.g. 2345;the score is 25 points Large straight -- five consecutive numbers are represented, e.g. 23456;the score is 30 points Full House -- three of one kind, two of another; the score is 30 points Yahtzee! -- five of a kind; the…Text-based adventure game: Pretend you are creating a text-based adventure game. At different points in the game, you want the user to select to fight, run, or hide from certain enemies. Modify the application below (week3.py) so that the selection variable is sent as an argument into the choice() function. The user should enter 1 to fight, 2 to run, or 3 to hide in the main(). The choice() function should print one of the three options. You will need to add an if statement in the choice() function to make the correct selection.def main(): monthlySales = getSales() printbonus=print_bonus(storeAmount,empAmount) #This function gets the monthly salesdef getSales(): monthlySales = float(input('Enter the monthly sales $')) monthlySales = getSales() #call to get sales salesIncrease = getIncrease(monthlySales) return monthlySales #This function gets the percent of increase in salesdef getIncrease(monthlySales): storeAmount = storeBonus(monthlySales) salesIncrease = float(input('Enter percent of sales increase: ')) salesIncrease = float(salesIncrease) salesIncrease = salesIncrease / 100 return salesIncrease #This function determines the storeAmount bonusdef storeBonus(monthlySales): if monthlySales >= 110000: storeAmount = 6000 elif monthlySales >= 100000: storeAmount = 5000 elif monthlySales >= 90000: storeAmount = 4000 elif monthlySales >=80000: storeAmount = 3000 else: storeAmount = 0 return storeAmount #This function…
- Javascript Programming <script>function getCardType() {var cNum1 = document.getElementById("ccNum1").value;var cardname = "";if (cNum1 != "") {if (cNum1.startsWith("4")) {cardname = "Visa";} else if (cNum1.startsWith("5")) {cardname = "MasterCard";} else if (cNum1.startsWith("6")) {cardname = "Discover";} else if (cNum1.startsWith("3")) {cardname = "American Express";}}document.getElementById("cardType").innerHTML = cardname;}</script></body>Plus x: A first function Assign y with 5 plus x. Ex: If x is 2, then y is 7. If x is 19, then y is 24. Note: Some challenge activities require completing a function (as above), or writing a new function. You can create test calls to the function in the "Code to call your function" window, then press "Run". Try appending this call to that window: IncreaseValue(9) When done writing and testing your function, press "Submit for Assessment", which will automatically apply various test calls to your function.write the psuedocode and drow the flowchart Create a program to enter grades and calculate averages and letter grades. Need a class which will contain: Student Name Student Id Student Grades (an array of 3 grades) A constructor that clears the student data (use -1 for unset grades) Get functions for items a, b, and c, average, and letter grade Set functions for items a, n, and c Note that the get and set functions for Student grades need an argument for the grade index. Need another class which will contain: An Array of Students (1 above) A count of number of students in use You need to create a menu interface that allows you to: Add new students Enter test grades Display all the students with their names, ids, test grades, average, and letter grade Exit the program Add comments and use proper indentation.
- MONTY HALL LAB write this code in python and use # to answers questions - You are only allowed to use the following functions/methods: print(), range(), len(), sum(), max(), min(), and .append(). It is not mandatory to useall of these functions/methods. In this lab, you will write a code that simulates the Monty Hall Game Show. Thegame host gives the participant the choice of selecting one of three doors. Twodoors has a goat behind them and one door has a prize. The set of choices arerandomized each round. The participant needs to select the door with the prizebehind it. When the participant selects a door, the game host reveals a door with agoat behind it. The game host opens a door (different from the one selected by theparticipant) that has a goat behind it. The participant is then given the option tochange their choice. When you run your code, the code would display a message prompting the user toinput their door choice, labelled as 1, 2, and 3. Then the code will display a…PLEASE HELP ME! ? Maximize and use alternative method to this code! package com.btech.pf101; import java.io.bufferedreader; import java.io.inputstreamreader; import java.util.calendar; import java.util.date; public class pawnshopcode { private static final bufferedreader br = new bufferedreader(new inputstreamreader(system.in)); private static string name; private static int age; private static string address; private static string contactno; private static int itemtype; private static string itemtypename; private static final int itemtype_gagdet = 1; private static final int itemtype_jewelry = 2; private static final int itemtype_musicinstrument = 3; private static final int itemtype_homeequipment = 4; private static final int itemtype_landtitle = 5; private static string itemdescription; private static int periodtype; private static string periodtypename; private static final int periodtype_days = 1; private…design patterns quetion public double calculatePerimeter(Shapes [] shapes) { double p = 0;for (Shape shape : shapes) { if (shape is Rectangle) { Rectangle rectangle = (Rectangle) shape; p += (rectangle.Width+rectangle.Height) * 2; } else { Circle circle = (Circle)shape; p += 2 * circle.Radius * Math.PI; } } return p; } which design principle is violated in the above code? what is the issue/ limitation of this code? rewrite the code to not violate the design principle you answered in part 1?
- int getUpperScore(){ int upperScore = 0; for(int i = ONES; i <= SIXES; i++){ upperScore += score[i]; } return upperScore + getBonusScore(); } //Returns the score of the upper part of the board int getLowerScore(){ int lowerScore = 0; for(int i = THREE_OF_KIND; i <= YAHTZEE; i++){ lowerScore += score[i]; } return lowerScore; } //Returns the bonus points int getBonusScore(){ const int UPPER_SCORES_THRESHOLD = 63; const int BONUS_POINTS = 35; if(getUpperScore() >= UPPER_SCORES_THRESHOLD){ return BONUS_POINTS; } return 0; } //Returns the total score int getTotalScore(){ return getUpperScore() + getLowerScore(); } Test 10: Check upper board and having bonus correctly (0/3) failed9. Trivia Game In this programming exercise, you will create a simple trivia game for two players. The program will work like this: Starting with player 1, each player gets a turn at answering 5 trivia questions. (There should be a total of 10 questions.) When a question is displayed, 4 possible answers are also displayed. Only one of the answers is correct, and if the player selects the correct answer, he or she earns a point. After answers have been selected for all the questions, the program displays the number of points earned by each player and declares the player with the highest number of points the winner. To create this program, write a Question class to hold the data for a trivia question. The Question class should have attributes for the following data: A trivia question Possible answer 1 Possible answer 2 Possible answer 3 Possible answer 4 The number of the correct answer (1, 2, 3, or 4) The Question class also should have an appropriate _…9. Trivia Game In this programming exercise, you will create a simple trivia game for two players. The program will work like this: Starting with player 1, each player gets a turn at answering 5 trivia questions. (There should be a total of 10 questions.) When a question is displayed, 4 possible answers are also displayed. Only one of the answers is correct, and if the player selects the correct answer, he or she earns a point. After answers have been selected for all the questions, the program displays the number of points earned by each player and declares the player with the highest number of points the winner. To create this program, write a Question class to hold the data for a trivia question. The Question class should have attributes for the following data: A trivia question Possible answer 1 Possible answer 2 Possible answer 3 Possible answer 4 The number of the correct answer (1, 2, 3, or 4) The Question class also should have an appropriate _…