6.1 (Math: pentagonal numbers) A pentagonal number is defined as for and so on. So, the first few numbers are 1, 5, 12, 22, .... Write a function with the following header that returns a pentagonal number: def getPentagonalNumber(n): Write a test program that uses this function to display the first 100 pentagonal numbers with 10 numbers on each line. 1 2 3 4 5 6 7 8 9 10 11 12 def getPentagonalN..
*5.1 (Count positive and negative numbers and compute the average of numbers) Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read, and computes the total and average of the input values (not counting zeros). Your program ends with the input 0. Display the average as a floating-point number. 1 2 3 4 5 6 7 8 9 10 11 12 13 14..
*4.1 (Algebra: solve quadratic equations) The two roots of a quadratic equation, for example, can be obtained using the following formula: is called the discriminant of the quadratic equation. If it is positive, the equation has two real roots. If it is zero, the equation has one root. If it is negative, the equation has no real roots. Write a program that prompts the user to enter values for a,..
3.1 (Geometry: area of a pentagon) Write a program that prompts the user to enter the length from the center of a pentagon to a vertex and computes the area of the pentagon, as shown in the following figure. The formula for computing the area of a pentagon is , where s is the length of a side. The side can be computed using the formula where r is the length from the center of a pentagon to a ver..
2.1 (Convert Celsius to Fahrenheit) Write a program that reads a Celsius degree from the console and converts it to Fahrenheit and displays the result. The formula for the conversion is as follows: fahrenheit = (9 / 5) * celsius + 32 1 2 3 4 5 6 celsius = eval(input("Enter a degree in Celsius: ")) fahrenheit = (9/5) * celsius + 32 print(celsius, " celsius is ", fahrenheit,"Fahrenheit.") Colored ..
- Total
- Today
- Yesterday
- 자바스크립트 자료구조
- 백준 11501
- 파이썬 클래스
- 명품 c++ 실습
- 자바
- 파이썬 진수 변환
- 파이썬 리스트
- 파이썬 예제
- css
- 파이썬 터틀
- 파이썬 함수
- 파이썬 객체
- 버츄어박스
- 자료구조
- 파이썬 문자열
- 백준
- 파이썬 for
- 파이썬 단계적 개선
- 백준 10451
- 웹
- 자바 에센셜 실습문제
- 파이썬 if문
- css 박스
- 파이썬 선택문
- 파이썬 연산자
- 자바스크립트 그래프
- 백준 1874
- css 그리드
- 파이썬
- 파이썬 while
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |