subject

Objectives:
1. To reinforce the use of loops.
2. To learn how to read information from files.

Movies about dragons and dragon training were very popular this summer. Your friend has not stopped talking about how awesome dragons are and how cool it would be to train them. To amuse your friend, you have decided to create a series of programs about dragons.
Problem:
In previous programs, we helped your dragon learn how to fly and train to improve their flight distance. It's time for your dragon's Celebration of the First Flight, similar to a dragon sweet 16. Every day for a month, your dragon is responsible for scheduling demonstration flights with the other members of Dragon Island. Your dragon wants to be presented in the best possible light, so it is up to you to determine the best month for the Celebration.
In this program, you will examine a file of weather data. Ask the user for the name of this file. Then, ask the user for the temperature range that their dragon flies best in. Calculate the percentage of days in each month that fall into that range. Dragon Island does not have a complete set of weather data, so the file of weather data may not contain information for every day in every month. Instead, calculate the percentage by dividing the number of days in range by the number of days that there is data for.
The month with the highest percentage is the month that the dragon should pick for their Celebration of the First Flight.
Arrays are not expected to be a part of this program, except for the name of the input file. Do not attempt to store all the values in the file in your program.

Input Specification:
1. The lower bound temperature will be an integer between 0 and 80
2. The upper bound temperature will be an integer higher than the lower bound and less than 120
3. The file name will be a string less than 30 characters in length

Input File Specification:
There will be 12 months of weather data available. Since months may not have complete information, each month will begin with a header number (n) to indicate how many temperatures are available for that month. The month will then have n real numbers representing the temperature for each day.

Output Specification:
Output to the screen. Show the user the percentage of days in range for each month. Then, print the best month for the Celebration of the First Flight.

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:30, bstine6678
When creating a presentation in libre office impress, where does the editing of slides take place? a. the slides panel b. the center panel c. the tasks panel, under the masters pages tab d. the tasks panel, under the layouts tab
Answers: 1
image
Computers and Technology, 23.06.2019 01:40, littlebirdd987
You have a linux system that has a 1000gb hard disk drive, which has a 90gb partition containing an ext4 filesystem mounted to the / directory and a 4gb swap partition. currently, this linux system is only used by a few users for storing small files; however, the department manager wants to upgrade this system and use it to run a database application that will be used by 100 users. the database application and the associated data will take up over 200gb of hard disk space. in addition, these 100 users will store their personal files on the hard disk of the system. each user must have a maximum of 5gb of storage space. the department manager has made it very clear that this system must not exhibit any downtime as a result of hard disk errors. how much hard disk space will you require, and what partitions would you need to ensure that the system will perform as needed? where would these partitions be mounted? what quotas would you implement? what commands would you need to run and what entries to /etc/fstab would you need to create? justify your answers.
Answers: 3
image
Computers and Technology, 23.06.2019 14:00, ava5015
What is html ? give a small description about html
Answers: 2
image
Computers and Technology, 24.06.2019 13:00, ddaaaeeee2960
Which one of the following functions is not available on the autosum tool? sum average if max
Answers: 3
You know the right answer?
Objectives:
1. To reinforce the use of loops.
2. To learn how to read information from...

Questions in other subjects:

Konu
Mathematics, 30.06.2021 06:30