Question: Part 2 : Star Wars Planets ( 3 0 % ) In the Star Wars universe, different planets rotate at different speeds. Few are close

Part 2: Star Wars Planets (30%)
In the Star Wars universe, different planets rotate at different speeds. Few are close to Earth's 24-hour rotation, which are preferential to the human characters.
Write a program that reads in from the provided SWPlanets.txt file and reports (prints) the name and rotational speed of the planets that are within the range of 23-26 hours, inclusively.
To accomplish this, create two lists:
List 1 should store the planet name
List 2 should store the rotational speed of the planet
Use the created lists to report to the user (print) the planets meeting the above rotational speed requirement.
Your program must:
Read and adhere to all software requirements listed below.
Use a main() function
Additional function usage is optional, but not required for Part Two
READ the file ONE LINE AT A TIME (Do not use readlines())
Required: Use a loop and if check to see if rotational speed is within the 23-26 hour range.
HINTS:
You can use the string split()method to separate the data fields for each line read in
If you do it right, each of the lists' corresponding data should be at the same index position

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!