I need help with my code for this in Python This is what I have tried:
Q: Explain the C++ keywords. List some C++ keywords you learned in this chapter.
A: Keywords are the words which are predefined by Compiler. We cannot used these keywords as an…
Q: Consider each of the following code fragments below that could be part of a C++ program. Each…
A: Assuming necessary packages like cmath, iostream etc. have been imported
Q: Write a program that includes a function that calculates the equation F= x" sin x. Write the values…
A:
Q: Do you have any recommended practises for Python?
A: In this comprehensive guide, we discussed various recommended practices for Python programming.…
Q: How can you subscript and superscript small and big letters from a-z also from numbers 1-100 in c++…
A: It is possible Given are all the possible subscript and superscript along with the following…
Q: You are beginning to work on a problem that needs to output names in several formats along with the…
A: Actually, given information is: You are beginning to work on a problem that needs to output names in…
Q: C++ PROGRAMMING ONLY 10. Calculator by CodeChum Admin Bonjour, I am Blaise Pascal, and I love math.…
A: #include <iostream>using namespace std; int main(){ char opt; float opr1, opr2; // Enter…
Q: i should have clarified that it is c++
A: I attached your answer below.
Q: Deliverable #2: The Program Once your concept has been approved by your instructor you can begin…
A: SOLUTION- I have solved this problem in python code with comments and screenshot for easy…
Q: What are the different types of loop mechanisms in C++? What are the different ways to control…
A: Loop means executes the same statements multiple times The different types of loop mechanisms are:…
Q: What are the different data types that are available in C++
A: The objective of the question is to understand the different data types that are available in the…
Q: Differentiate between a Run Time Error and Syntax Error. Also give suitable examples of each in c++
A:
Q: USE PYTHON Source: en.wikipedia.org/wiki/Camel_case In some languages, it’s common to use…
A: Program Approach: Create a function camel_to_snake which takes a camel case string var_name as…
I need help with my code for this in Python
This is what I have tried:
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
- Answer in C languangeThe great circle distance is the distance between two points on the surface of a sphere. Let (x1, y1) and (x2, y2) be the geographical latitude and longitude of two points. The great circle distance between the two points can be computed using the following formula: d = radius * arccos(sin(x 1) * sin(x 2) + cos(x 1) * cos(x 2) * cos(y1 - y2)) Write a program that prompts the user to enter the latitude and longitude of two points on the earth in degrees and displays its great circle distance. The average earth radius is 6,371.01 km. Note that you need to convert the degrees into radians using the math.radians function since the Python trigonometric functions use radians. The latitude and longitude degrees in the formula are for north and west. Use negative to indicate south and east degrees.21. The five line bellow are used to determine the profit or loss of a sale based on the buying cost and selling result after a margin calculation. The correct order of the program is . 1n = int (input () ) 2 buycost - 1000 * n + 1000 3 sellResult - 1200 • n 4 if (sellPrice-buyPrice>0) : profit = True if (sellPrice-buyPrice<=0): profit = False 6. a. 1,2, 3, 4, 5, no line of code can be reversed b. 1, 2. 3, 4, 5. with line-1, line-2, line-3 can be reversed each other c. 1, 2. 3, 4, 5. with line-4 and line-5 can be reversed with line-6 and line-7 d. Line-4 untul line-7 must be in sequence but can be placed in any order
- 1. Federal law requires that hourly employees be paid “time-and-a-half” for work in excess of 40 hours in a week.For example, if a person’s hourly wage is $12 and he or she works 60 hours in a week, the person’s gross pay shouldbe (40 *12) + (1.5 *12 * (60-40)) = $840.Write a program that requests the floating number of hours a person works in a given week and the person’s hourlywage as input, and then displays the person’s gross pay. Save it as overtimePay.pyneed help!Interest on a credit card’s unpaid balance is calculated using the average daily balance. Suppose that netBalanceis the balance shown in the bill, paymentis the payment made, d1is the number of days in the billing cycle, and d2is the number of days payment is made before the billing cycle. Then the average daily balance is: averageDailyBalance = (netBalance * d1 –payment * d2) / d1 if the interest rate per month is say, 0.0152, then the interest on the unpaid balanceis: interest = averageDailyBalance * 0.0152 Design a program that accepts as input netBalance, payment, d1, d2, and interest rate per month. The program outputs the interest charged. Format your output to two decimal places. C++
- 1a. It is known that x and n are integers, where x has a value of -1 and n has a value of 5. What is the valueof the following expression? !(++x || n) + 6 - (!n && n * (n < n)) I know this equals 6 but how do I work it out 1a .Compute the values of the following expressions if x is 1, y is 4 and z is 14. Assume thattrue relations have a value of 1 (I want to see how these problems are worked out) 1B. work out each of these. x+5<=z-(x||z)-y z/y%z-6<=!y x>=1&&y==3+y||z<14 x-!y-y<=z*z/6>yWhen you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making periodic payments over a certain period of time. Of course, the lending company will charge interest on the loan. Every periodic payment consists of the interest on the loan and the payment toward the principal amount. To be specific, suppose that you borrow $1,000 at an interest rate of 7.2% per year and the payments are monthly. Suppose that your monthly payment is $25. Now, the interest is 7.2% per year and the payments are monthly, so the interest rate per month is 7.2/12 = 0.6%. The first months interest on $1,000 is 1000 0.006 = 6. Because the payment is $25 and the interest for the first month is $6, the payment toward the principal amount is 25 6 = 19. This means after making the first payment, the loan amount is 1,000 19 = 981. For the second payment, the interest is calculated on $981. So the interest for the second month is 981 0.006 = 5.886, that is, approximately $5.89. This implies that the payment toward the principal is 25 5.89 = 19.11 and the remaining balance after the second payment is 981 19.11 = 961.89. This process is repeated until the loan is paid. Write a program that accepts as input the loan amount, the interest rate per year, and the monthly payment. (Enter the interest rate as a percentage. For example, if the interest rate is 7.2% per year, then enter 7.2.) The program then outputs the number of months it would take to repay the loan. (Note that if the monthly payment is less than the first months interest, then after each payment, the loan amount will increase. In this case, the program must warn the borrower that the monthly payment is too low, and with this monthly payment, the loan amount could not be repaid.)Q3: By using Select-Case; write a program to calculate (BMI body mass index) (11 M) weight BMI = hieght And print the result as follows Underweight = 30
- Exercise III: Catalan numbers For n e N, denote by c, to be the number of ways to form a "mountain range" with n upstrokes (U) and n downstrokes (D) that all stay above a horizontal line. For instance: for n = 1, only UD is allowed, so c = 1; • for n = 2, only UUDD and UDUD are allowed, so c2 = 2. 1. Check that c3 = 5 by writing down or drawing all possible options. 2. Consider the power series +00 g(x) = 2 n=0 (by definition co = 1) called the generating function of the sequence (en). Justify that cn < 4" for each n, and deduce that the radius of convergence of g is at least 1/4. 3. It can be show that for r E (-1/4, 1/4), g(x) = 1+ xg(r)? and therefore 1- VI 4.x g(x) = 2.x Use this formula and the known power series of V1+ x to write the first terms of the power series expansion of g, in the form g(x) = co + c1x + c2x2 + C3x + c4x* + ·.. Show how you obtain a few terms, but you do not need to show all computations and you can use a calculator for fractions. Check that you recover co,…Need help coding in Java Morgan’s Department Store distributes bonuses to its salespeople after the holiday rush. Table 9-6 shows the bonuses, which are based on full weeks worked during the season and the number of positive online customer reviews. Write a program that allows a user to continuously enter values for the number of weeks worked and the number of positive reviews received and displays the appropriate bonus until the user enter a sentinel value: 99."" Hosoya triangle (originally Fibonacci triangle) is a triangular arrangement of numbers, where if you take any number it is the sum of 2 numbers above. First line is always 1, and second line is always {1 1}. This printHosoya function takes argument n which is the height of the triangle (number of lines). For example: printHosoya( 6 ) would return: 1 1 1 2 1 2 3 2 2 3 5 3 4 3 5 8 5 6 6 5 8 The complexity is O(n^3). """ def hosoya(height, width):.