Question

In: Computer Science

(PYTHON)Your company prints math reference tables for high school and first year college students. You’d like...

(PYTHON)Your company prints math reference tables for high school and first year college students. You’d like to write a flexible program that will display the results for several mathematical functions applied to a range of integers, and the results displayed in a table with a header that includes labels separated by tabs:

Num Sqr SqRt Sin Cos Tan Log Log10

=== === ==== === === === === =====

Write a Python program that prompts the user for a starting integer, ending integer and interval (step) value. Based on these entries, and using functions from the Python math library, calculate and display each integer (x) along with the values for: x​2, sin x, cos x, tan x, log(x) and log10x .

Organize your file using comments for each block of planned code

Import the math library and initialize any necessary variables

Prompt the user for the starting, ending and interval values (integers)

Print the table headers

Create a loop based on the user’s values

Print the formatted values with 2 decimal places

Solutions

Expert Solution

import math
  
print "This program displays the results of several math\nfunctions across a numeric progression"

start = input("Enter the starting integer: ")
end = input("Enter the ending integer: ")
interval = input("Enter the interval (step) vale: ")

print "Num\tSqr\tSqRt\tSin\tCos\tTan\tLog\tLog10"
print "===\t===\t===\t===\t===\t===\t===\t==="
for i in range (start, end, 3):
print str(i)+"\t"+str(i*i)+"\t"+str(round(math.sqrt(i),2))+"\t"+str(round(math.sin(i),2))+"\t"+str(round(math.cos(i),2))+"\t"+str(round(math.tan(i),2))+"\t"+str(round(math.log(i),2))+"\t"+str(round(math.log10(i),2))

Output:


Related Solutions

(PYTHON)Your company prints math reference tables for high school and first year college students. You’d like...
(PYTHON)Your company prints math reference tables for high school and first year college students. You’d like to write a flexible program that will display the results for several mathematical functions applied to a range of integers, and the results displayed in a table with a header that includes labels separated by tabs: Num Sqr SqRt Sin Cos Tan Log Log10 === === ==== === === === === ===== Write a Python program that prompts the user for a starting integer,...
A school district developed an after-school math tutoring program for high school students. To assess the...
A school district developed an after-school math tutoring program for high school students. To assess the effectiveness of the program, struggling students were randomly selected into treatment and control groups. A pre-test was given to both groups before the start of the program. A post-test assessing the same skills was given after the end of the program. The study team determined the effectiveness of the program by comparing the average change in pre- and post-test scores between the two groups....
A researcher conducts a study of college students to decide whether they like math classes. They...
A researcher conducts a study of college students to decide whether they like math classes. They get a list of students with land-line phone numbers from their University and call the first 25 students, all of whom are English majors, on the list. They ask those students “Which is the worst class you’ve had on campus – your math class or another class?” 18 out of 25 say math, so the researcher concludes that students choose English majors because they...
School A would like to get more high school students to ride the school bus rather...
School A would like to get more high school students to ride the school bus rather than driving to school each day to reduce traffic congestion around the school. To try to encourage more students to ride the bus, the school decides to raise the daily rate for parking in the school parking lot. Design and describe a study that uses an interrupted time series design to provide evidence as to whether the parking rate increase led to an increase...
School A would like to get more high school students to ride the school bus rather...
School A would like to get more high school students to ride the school bus rather than driving to school each day to reduce traffic congestion around the school. To try to encourage more students to ride the bus, the school decides to raise the daily rate for parking in the school parking lot. 1. Design and describe a study that uses an interrupted time series design to provide evidence as to whether the parking rate increase led to an...
The following data is the math test scores of students graduating from a particular high school....
The following data is the math test scores of students graduating from a particular high school. The government uses these scores to determine if there will be accreditation awarded. In order for this to occur the mean score must be above 780. A sample of students' scores is drawn at random and they take the test. The scores are in the following table and the population is considered a normal distribution. Test at the .01 level. 980 764 798 760...
How do California high school students compare to students nationwide in their college readiness, as measured...
How do California high school students compare to students nationwide in their college readiness, as measured by their SAT scores? The national average scores for the class of 2017 were 533 on Evidence-Based Reading and Writing and 527 on the math portion.† Suppose that 100 California students from the class of 2017 were randomly selected and their SAT scores were recorded in the following table. Evidence-Based Reading and Writing Math Sample Average 529 521 Sample Standard Deviation 96 99 (a)...
How do California high school students compare to students nationwide in their college readiness, as measured...
How do California high school students compare to students nationwide in their college readiness, as measured by their SAT scores? The national average scores for the class of 2017 were 533 on Evidence-Based Reading and Writing and 527 on the math portion.† Suppose that 100 California students from the class of 2017 were randomly selected and their SAT scores were recorded in the following table. Evidence-Based Reading and Writing Math Sample Average 529 522 Sample Standard Deviation 98 99 (a)...
The scores of students on the SAT college entrance examinations at a certain high school had...
The scores of students on the SAT college entrance examinations at a certain high school had a normal distribution with mean μ=544 and standard deviation σ=29.1. (a) What is the probability that a single student randomly chosen from all those taking the test scores 548 or higher? For parts (b) through (d), consider a simple random sample (SRS) of 35 students who took the test. (b) What are the mean and standard deviation of the sample mean score x¯, of...
The scores of students on the SAT college entrance examinations at a certain high school had...
The scores of students on the SAT college entrance examinations at a certain high school had a normal distribution with mean ?=545.8μ=545.8 and standard deviation ?=28.4σ=28.4. (a) What is the probability that a single student, randomly chosen from all those taking the test, would score 552 or higher? For parts (b) through (d), consider a simple random sample (SRS) of 35 students who took the test. (b) What are the mean and standard deviation of the sample mean score ?¯x¯,...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT