
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
.

Transcribed Image Text:Python Programming Question Python 3
PROGRAM A: APROGRAM.py
This program should use a main function and
two other functions named playlist and
savelist as follows:
The main function:
The main function should create an empty list
and then use a loop to add ten integers to
the list, each in the range from 10-90. These
integers will represent angles measured in
degrees. main should then call playlist and
savelist, in that order. Both of these
functions take the list as a sole argument.
The playlist function:
playlist should use a loop to display the
elements of the list, all on one line
separated by a single space. playlist should
also determine and print the number and sum
of the even numbers and the number and sum of
the odd numbers.
The savelist function:
save list should sort the list and write each
element to a text file named AB.txt, each
element on its own line.
PROGRAM B: BPROGRAM.py
This program should read the angles from
AB. txt and generate a table showing the
trigonometric ratios sine, cosine, and
tangent of the angles. The ratios should be
displayed in formatted columns accurate to 5
decimal places as shown in the sample output
below.
SAMPLE OUTPUT:
Here are the angles in degrees:
23 85 31 55 42 85 72 33 39 20
3 even angles total to 134
7 odd angles total to 351
List of angles was written to file.
End of program A.
Angle
Sine
Cosine
Tangent
0.36397
20
0.34202
0.93969
23
0.39073
0.92050
0.42447
31
0.51504
0.85717
0.60086
33
0.54464
0.83867
0.64941
39
0.62932
15ר0.77
0.80978
42
0.66913
0.74314
0.90040
55
0.81915
0.57358
1.42815
72
0.95106
0.30902
3.07768
85
0.99619
0.08716
11.43005
0.99619
End of program B.
85
0.08716
11.43005
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 6 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Apply The Gauss-seidel method using R pleasearrow_forwardPart 3 Continue your investigation. The following are all suggestions, not requirements, and you certainly shouldn't attempt to investigate all of these. You might investigate: • more quickly convergent methods, like the Gauss-Legendre algorithm, the Borwein algorithm, or others. approximations given by the continued fraction expansion for . digit extraction methods. • the decimal module, for obtaining more accuracy than floating point arithmetic allows. .arrow_forwardNeed the right answer among choices and also an explanation of the answer.arrow_forward
- Help , practicearrow_forwarddiscrete matharrow_forwardWhile each of us has had a reading of our blood pressure taken, many of us may not know what blood pressure actually means. Blood pressure is expressed as a ratio of the maximum (systolic) and minimum (diastolic) pressure found in the aorta during one cardiac cycle. These pressure values are measured in millimeters of mercury (mmHg). Determining abnormal blood pressure is critical for diagnosing and averting a number of serious health problems (e.g. heart disease and stroke). Doctors therefore make decisions about the potential for serious health problems based on a few simple calculations. One simple calculation of interest is mean arterial pressure (MAP). The mean arterial pressure is the average pressure during the cardiac cycle. The MAP of a normal, resting heart can be computed by the formula: MAP = DP + (1/3)PP where DP is the diastolic pressure and PP is the pulse pressure. Create a Java class file called MeanArterialPressure. This program will compute a user's mean arterial…arrow_forward
- You wash ashore an island with two types of people, knights who only speak the truth, and knaves, who only speak lies. Two of the natives come up to you. (a) Ashley tells you: We are the same type. Bernardo tells you: We are different types. What are Ashley and Bernardo?arrow_forwardI need the answer as soon as possiblearrow_forwardWhat is the difference of the meaning of the word ray in math and in computer science? In both areas, the meaning is that a ray is a directed line segment. In both areas, the meaning is that a ray is “half” of a line that has an origin and extends infinitely in one direction. Computer science: A ray is “half” of a line that has an origin and extends infinitely in one direction. Math: A ray is a directed line segment. Computer science: A ray is a directed line segment. Math: A ray is “half” of a line that hasarrow_forward
- 3. An unnamed faculty uses three screens on his desk. One measures 1920 x 1080 pixels and the other two measure 1280 x 1024 pixels. a. Create variables for height and width (in pixels) for each of these displays and set these variables equal to their respective measures. b. Determine the total number of pixels across the three displays. This numerical answer should be represented by a variable. c. If each pixel were to draw 1.2e-5 watts, create a variable for this value and determine the wattage required to activate all the pixels across all three screens at once. This numerical answer should be represented by a variable.arrow_forwardFill in the blanks with the correct choice to complete the se 1- He always .…....…... about trivial things. A. Lies B. Lied C. Lying 2- 1 hope everything is........ Fine tomorrow. A. Will be B. Going to be C. Being 3- She was walking alone When the child.......... to cry. A. Begin B. Began C. begunarrow_forwardplease show work cleary written.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education