Get Instant Help From 5000+ Experts For

Writing: Get your essay and assignment written from scratch by PhD expert

Rewriting: Paraphrase or rewrite your friend's essay with similar meaning at reduced cost

Programming Assignment: Using Loops, File Input, and Arrays to Solve Weather Planning and Scheduling

Objectives

Objectives

1. To review using loops for repetition.

2. To learn how to read (large amounts of) information from files.

3. To learn how to use arrays to store many pieces of information.

Problem A: Weather Planning

Arup plans on having an outdoor wedding. However, as everyone knows, outdoor weddings are contingent upon the weather. You’ve decided that you’d like to help Arup and others planning an outdoor wedding by writing a computer program that gives historical data about the average temperature on the day and month of the planned wedding.

You will be reading files from the following website that contains average daily temperature data for many cities:

Your program will ask the user for their wedding day (month, day) and the file that stores the city in which they will get married. (For example, the file name for Orlando is FLORLAND.txt.)

Based on this information, output the following pieces of information:

a) The average temperature on the given wedding day in each of the years listed in the file.

b) The average temperature on the given wedding month in the years listed in the file.

Problem B: Scheduling Problems

Since Arup enjoys many different activities, he often overbooks himself. In the past, this wasn’t a problem. Either he would simply go to parts of two events that coincided, or he’d simply call the person hosting one of the two events telling them he couldn’t make it. Normally, this didn’t cause a problem because none of his appointments were ones that he absolutely had to keep. But now that he’s getting married, his fiancée occasionally has very important tasks for him that he can’t simply call to get out of, if he has doublebooked.

In this problem you will help Arup identify schedules that contain double booking and schedules that don’t. Though this problem can be solved in many ways, you’ll be asked to solve it in a specific manner.

You’ll be given a set of responsibilities/events Arup has over the course of a week. Your goal will simply be to determine if there are any overlapping events at all.

In particular, you’ll be given several weekly schedules. Each weekly schedule will be a list of events. Each listing of events will contain the day (0 – 6, where Sunday = 0, Saturday = 6), a start hour (0 – 23, where 0 is midnight, 23 is 11 pm), and an end hour (1 – 24, where 1 is 1am and 24 is midnight of the following day.) It is guaranteed that the end hour is greater than the start hour, so each event has a duration that is a positive integer number of hours.

Problem C Resolving Scheduling Problems

Ultimately, the only way to resolve the scheduling problems is to put different priorities on each activity and schedule activities from most important to least important. If a less important activity conflicts with a previously scheduled activity, you simply don’t do it.

In this program, you’ll take the same input as the previous problem, assuming that the order of events in the file is in the order of importance of those events. Thus, you’ll put in the schedule every event that fully fits at the time you try to schedule it. Once an event is placed in the schedule, no event that conflicts with it may be placed in the schedule. Once the schedule has been processed, you’ll calculate the total number of scheduled hours (out of 168) for that week.