Question: For this activity, you've been provided with a fully working program: file. Download weather_prediction.c here, or copy it to your CSE account using the following

 For this activity, you've been provided with a fully working program:

For this activity, you've been provided with a fully working program: file. Download weather_prediction.c here, or copy it to your CSE account using the following command: $cpn /web/dp1091/23T1/activities/weather_prediction/weather_prediction.c While this code produces the correct output, it's been all been implemented in the main function! Your job is to take this working program, and improve its style by breaking it up into well named functions which are less than 30 lines long. You will also have to pass , so you will have to write function comments for the functions that you create. Your changes shouldn't affect the functionality of the program in any way. In other words, they should not change any of the program's behaviour or output. HINT: This task requires very little new code to be written. It's mainly about finding sections of code that can be nicely copy-pasted into functions. For example, you could move all the code to print out intro info into a function with the following prototype: If you need some help figuring out what to move into functions, try looking for any repeated code. Similar or idential sections of code are often easy to replace with a single helper function that can be called multiple times. Also, don't forget that you can call functions inside functions. This is particularly helpful if your helper functions are too long and you need to break them up further. But you may not need to in this exercise

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 Databases Questions!