To return the degree of an angel that its sin= 0, we should use one of the following * :commands sin(0) O sin 0 O sind(0) asind(0)
Q: One day, Fred and his N friends were playing a card game in which each player throws a card with a…
A: Introduction:Here we are given the task of creating a Python system to assist Fred in browsing the…
Q: Find the numbers that can be expressed as the product of two nonnegative integers in succession and…
A: Answer:-
Q: C++ Code Mr. Naughty loves to play with balls. So, his friend, Mr. Nice, gave him n balls to play…
A: Code process The first line contains the same number n - the number of balls. Inext n lines contain…
Q: Write the inverse of the following statement: “If it is winter, then it is snowing.”
A: As given, we need to write the inverse of the given statement. The given statement - "If it is…
Q: n integer is called squarefree if it is not divisible by any perfect squares other than 1. For…
A: Required: An integer is called squarefree if it is not divisible by any perfect squares other than…
Q: def foo(arg): if isinstance (arg, -): 11 oops return 'yeah' else : oops yeah return 'oops' 12 print…
A: Here, Code is given.
Q: Suppose you are given the following information: Integer:first_day. This is the day on Jan 1…
A: #include <bits/stdc++.h>using namespace std; int main(int argc,char *argv[]) { int…
Q: What method of the Math class is used to determine the smallest whole number that is greater or…
A: Given: What Math class method is used to get the smallest whole number greater than or equal to a…
Q: Example 15. Evaluate $\int_{C} \frac{1}{\sinh z} d z$, where $C$ is the $\mathrm{Circh}$ $Iz|=4$
A: Code the solution:
Q: After lunch let's go out for a coffee. .9 (after) pronoun O nrenosition
A: A preposition is a word or gathering of words utilized before a noun, pronoun, or noun expression to…
Q: What is the value of x in the given code? def getX(num): if num > 10: return 10 else: return 20 x =…
A: b. x = 20 Explanation:- the parameter for getX is 5. So, num =5 condition: if num > 10 then…
Q: Complete the Team class implementation. For the instance method get_win_percentage(), the formula…
A: Floating point Division is the division in which if one or two sides has a floating point number,…
Q: Discount = ticket price * discount rate / 100 final price ticket price- Discount Number of…
A: Your java program is given below as you required with an output.
Q: Coupon collector is a classic statistic problem with many practical applications. The problem is to…
A: Given: Coupon collector is a classic statistic problem with many practical applications. The problem…
Q: void functionThree(int number) { time = 0; %3D for ( int i =0; i< number; i++) for( int j=0; j< i *…
A:
Q: following
A:
Q: f wchart Wo2 BadDate.spp 2 Term W This is the work of the housekeeping) method W This Is the work of…
A: The flowchart for the code is given below
Q: implementation
A: Actually, python is a easiest programming language. It is a dynamically typed programming…
Q: a) FindMinIterative public int FindMin(int[] arr) { int x = arr[0];…
A: Please refer below for your reference: Time complexitites are below: a) FindMinIterative public int…
Q: int max3(int x,int y,int z){ if(xy) if(x>z) return x; else return z; else if(y>z) return y; else…
A: GIVEN:
Q: Complete the following one-line method that returns true if x is a negative odd integer and r alse…
A: Since you have not provided the language to write the code so I am using java language to write the…
Q: * If MyNumber = 6.8, what is the value of ?Int(My Number * 4^2)
A: MATLAB doesn't have the Int() function as described in the question, instead Matlab has int8 and…
Q: int z = 2.2; %3D if(x 3) z = X + y; if(z > -1){ cout <« "z is " + y; } else cout <« "z is + z;
A: int z = 2.2 would result in z = 2 as decimal would be ignored. And instead of + I am taking <<…
Q: uppose, you are working in a company ‘X’ where your job is to calculate the profit based on their…
A: Note:- I am taking the Python part. Program: class FinalQ: def print(self,array,idx):…
Q: What method of the Character class is used to change a given character value to a capital letter if…
A: Answer: w. toUpperCase
Q: ?What will the following code do ; j=0 ; 1=5 (while (j<0 ; j=j-1 ; i=i+5 ; j=1 end اخترأحد الخيارات…
A: Please find the answer below step.
Q: String[] name={"John", "Mary", "Jim", "Sam"}; Which choice is correct? Group of answer choices…
A: String Datatype: The datatype is a set of values and each datatype have its own purpose. Based on…
Q: Using the Pair0fDice class from PP 4.9, write a program that rolls a pair of dice 1000 times,…
A: The Program code that rolls a pair of dice 1000 times, counting number of box cars (two sixes) that…
Q: (THIS IS THE GIVEN CODE) int main(int argc, char *argv[]) { int first_day = atoi(argv[1]);…
A: I have implemented the given requirements as mentioned above in C++. Proper validations are in…
Q: /*A program that calculates the tax due or the refund*/ int main () double inc, tax; int n; printf…
A: The explanation of the code is given below:
Q: T/F Java methods can return more than one item if they are modified with the reserved word…
A: Question. T/F Java methods can return more than one item if they are modified with the reserved…
Q: What is returned by the call greeting(12) ? def greeting(time): if time < 12: return "Good Morning"…
A: Given Program: def greeting(time): if time <12: return "Good Morning" elif time <…
Q: QtAnswer the following (you are free to (assign the variables) sqrt(x)+abs(-20) S=…
A: let x=9 y= 5.5
Q: using the code below Run it and help me fix any problem mylist =…
A: Random is not imported. So the error says random not defined. So we will import random. The list…
Q: What is the probability that in a classroom of x people, at least 2 will be born on the same day of…
A: Introduction What is the probability that in a classroom of x people, at least 2 will be born on the…
Q: What method of the Math class is used to determine the absolute value o a given integer? Choose from…
A: As per the given question, we have to choose from the given options, the correct method of Math…
Q: cashier in a supermarket returns change to customers. Suppose we want to write a program to help the…
A: C++ Code for above : #include <bits/stdc++.h> using namespace std; vector<int>…
Q: To compare if the original cells are kept in the cells * * For example, cell 1 1 in original cell is…
A: Program1 class Test{ public static void main(String[] args) { int[] arr=…
Q: Make this code more efficient numb = int(input("What is your favourite number? ")) name =…
A: To make this code more efficient do not use NOT and AND operation instead of this use nested if to…
Q: Given code: int s=0; for ( int i=1; i<5; i++ ){ s = s + i ; } Which one is correct,…
A: After running the given code, the variable “s” holds the value of “10”. Hence, correct choice is…
Q: Modify the program to also print the powers of 2 for 2^20 and 2^30. And label 2^10, 2^20, 2^30 as K,…
A: Code : #include <stdio.h> #include <math.h> //Main function int main() { int i=0,…
Q: public static int foo(int a, int b) { if (a < b) return 0; else return 1 + foo(a-b, b);
A: The value returned for foo(4, 2) is 2. The value returned for foo(5, 3) is 1.
Q: # Write python codes here. print("Total E-Customer:", ECustomer.count) c1 = ECustomer("James")…
A: Here I have created a class named ECustomer.In this class, I have created a static variable named…
Q: https://www.codingame.com/ide/puzzle/horse-racing-hyperduals Casablanca’s hippodrome has grown…
A: Here we have to write a program for given requirements. Here Python programming is used
Q: What method of the Math class is used to determine the smallest whole number that is lesser or equal…
A: CORRECT ANSWER IS : g.floor BECAUSE : floor will return smallest whole number that is lesser then…
Q: Medium resistance: This class includes all resistances of values between 10 Q and 100 k Q. Most of…
A: Below is the complete solution and explanation to the given question in detail.
Q: The code I am using will not return the correct type. For example the expected answer is [1] and my…
A: I correct the code ,give the correct code ,correct output screenshot ,code screenshot and I also…
Q: What does the following code do? In [1]: def mystery (a, b) : if b == 1: ...: return a else: return…
A: recursion is used here.
Q: Find and correct error(s) in the following method definition: public static void doubleNum (int x)…
A: Hey, since multiple questions posted, we will answer first question according to our policy. If you…
Step by step
Solved in 2 steps
- Suppose you can buy chocolate bars from a vending machine for $1 each.Inside every chocolate bar is a coupon. You can redeem 7 coupons for 1chocolate bar from the machine.For example, if you have $20, you can initially buy 20 chocolate bars.This gives you 20 coupons. You can redeem 14 coupons for 2 additionalchocolate bars. These 2 chocolate bars have 2 more coupons, so you now have atotal of 8 coupons. This gives you enough to redeem for 1 final chocolate bar.Write a recursive function that would accept the amount of dollars andcoupons as its parameters and output the total number of chocolate bars thatcan be bought (including those redeemed via coupons).Write a test program in C++that would allow the user to enter amount of dollarsand then use the recursive function to compute the number of chocolate barsthe user can buy, and output the number to the screen.Implement the design of the Patient class so that the following output is produced:[For BMI, the formula is BMI = weight/height^2, where weight is in kg and height inmeters] Driver Code # Write your code herep1 = Patient("A", 55, 63.0, 158.0)p1.printDetails()print("====================")p2 = Patient("B", 53, 61.0, 149.0)p2.printDetails() Outputa) FindMinIterative public int FindMin(int[] arr) { int x = arr[0]; for(int i = 1; i < arr.Length; i++) { if(arr[i]< x) x = arr[i]; } return x; } b) FindMinRecursive public int FindMin(int[] arr, int length) { if(length == 1) return arr[0]; return Math.Min(arr[length - 1], Find(arr, length - 1)); } What is the Big-O for this functions. Could you explain the recurisive more in details ?
- Find the Other Two Side Lengths in Java Given the shortest side of a 30° by 60° by 90° triangle, find out the other two sides. Return the longest side and medium-length side in that order. Examples otherSides(1) ➞ [2.0, 1.73] otherSides(12) ➞ [24.0, 20.0] otherSides(2) ➞ [4.0, 3.46] otherSides(3) ➞ [6.0, 5.2] Notes 30° by 60° by 90° triangles always follow this rule: let's say the shortest side length is x units, the hypotenuse would be 2x units and the other side would be x * square root of 3. The results in the Tests are rounded up to 2 decimal places. Return the result as an array.plzz help no need to show work...just the answerA number is called a perfect number if it is equal to the sum of all of its divisors, not including the number itself. For instance, 6 is a perfect number because the divisors of 6 are 1, 2, 3, 6 and 6 = 1 + 2 + 3. As another example, 28 is a perfect number because its divisors are 1, 2, 4, 7, 14, 28 and 28 = 1 + 2 + 4 + 7+ 14. However, 15 is not a perfect number because its divisors are 1, 3, 5, 15 and 15 6= 1 + 3 + 5. Write an algorithm that asks the user to enter a positive integer n and prints all the perfect numbers that are less than n.
- The number of permutations of a set of n items taken r at a time is given by the following formulan!/r!(n−r)!: where n! is the factorial of n, r! is the factorial of r, and (n-r)! is the factorial of the result of n-r. The factorial of a number n can be solved using the following formula: n !=e−n nn √ 2 πn. If there are 18 people in your class and you want to divide the class into programming teams of 3 members, you can compute the number of different teams that can be arranged using this formula (n!/r!(n−r)!). When writing a C++ program that determines the number of potential team arrangements. You will need to use the double type for this computation.Mutiple Answers Which of the following matches regexp /(very )+(fat )?(tall|ugly) man/a) very fat manb) fat tall manc) very very fat ugly mand) very very very tall man Please Answer With Detailed Explanation!Use the following methods trash() and takeOut() to answer questions (a) – (d). 1 public void trash (int x) 12 public int takeOut (int a, int b) 2 { int m, n; 13 { int d, e; 3 m = 0; 14 d = 42* a; 4 if (x > 0) 15 if (a > 0) 5 m = 4; 16 e = 2*b+d; 6 if (x > 5) 17 else 7 n = 3*m; 18 e = b+d; 8 else 19 return (e);} 9 n = 4*m; 10 int o = takeOut (m, n); 11 System.out.println ("o is: " + o);} (a) Draw separate graph for each trash() and takeOut() , then show the connection between them at call site, using the line numbers given on graph’s nodes. (b) Determine Caller, Callee, Callsite, Actual parameters and Formal parameters, in table. (c) Give all Coupling DU-pairs of last-defs and first-uses, in table. (d) find the values of m, n, a, d, b, e and o when x = -1 , 3 , 6 , in table.
- Implement the design of the Passenger class so that the following output is produced: The assumption is Bus base-fare is 450 taka. A passenger can carry upto 20 kg for free. 50 taka will be added if bag weight is between 21 and 50 kg. 100 taka will be added if bag weight is greater than 50 kg. [You are not allowed to change the code below] # Write your code here print(“Total Passenger:”, Passenger.count) p1 = Passenger(“Jack”) p1.set_bag_weight(90) p2 = Passenger(“Carol”) p2.set_bag_weight(10) p3 = Passenger(“Mike”) p3.set_bag_weight(25) print("=========================") p1.printDetail() print("=========================") p2.printDetail() print("=========================") p3.printDetail() print("=========================") print(“Total Passenger:”, Passenger.count) Output: Total Passenger: 0 ========================= Name: Jack Bus Fare: 550 taka ========================= Name: Carol Bus Fare: 450 taka ========================= Name: Mike Bus Fare: 500 taka =========================…You have a card on which the letter J is written on one side and K on the other. You want to seeall of the possible ways the card will land if you drop it n times. Write a recursive method thatprints each session of dropping the cards with J's and K's. For example if you drop it 4 times in agiven session, all possible ways to drop it are as follows (in exactly the specified order): J J J JJ J J KJ J K JJ J K KJ K J JJ K J KJ K K JJ K K KK J J JK J J KK J K JK J K KK K J JK K J KK K K JK K K Kuse python Implement the design of the Chillox and Customer classes so that the following code generates the output below:print(f"It's been a good day!. \nToday, we have already served {Chillox.order_id} customers.")print("**************************************************")outlet1 = Chillox()print("1.==========================================")print("Burger Menu:")print(Chillox.menu)print("2.==========================================")outlet1.addBurger("Chicken Burger",180,"Chicken with Cheese",200)print("3.==========================================")print("Burger Menu:")print(Chillox.menu)print("4.==========================================")c1 = Customer("Samin")c1.order = "2xChicken Burger"outlet1.placeOrderof(c1)print("5.==========================================")outlet1.addBurger('Chicken Smoky BBQ Cheese',225)c2 = Customer("Rafi")c2.setOrder("2xChicken with Cheese,3xChicken Smoky BBQ…