Another way to write this code. #Declare variables and constants year = 0 YEARLY_RISE = 1.80 #Print header print("Year\t\tRise (in millimeters)") print("\n--------------------------------------\n") #Iterate 25 times for i in range(1, 26): #Calculate the rise in millimeters print(f"{i}\t\t{YEARLY_RISE * i:.2f}")

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 14PE
icon
Related questions
Question
Another way to write this code. #Declare variables and constants year = 0 YEARLY_RISE = 1.80 #Print header print("Year\t\tRise (in millimeters)") print("\n--------------------------------------\n") #Iterate 25 times for i in range(1, 26): #Calculate the rise in millimeters print(f"{i}\t\t{YEARLY_RISE * i:.2f}")
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning