Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions

Question

1-4 How will MIS help my career?

Answered: 1 week ago