Write a simple program that stores the high temperatures

Assignment Help MATLAB Programming
Reference no: EM13160622

A meteorological company wants you to write a simple program that stores the high temperatures and low temperates for each of the months of the year. After consulting with trusted programming partners, you come up with a great idea. It is as follows:

  • create an array called month that lists all twelve month names as strings
  • create another array called highs that initializes 12 element members to 0.
  • create another array called lows that also initializes 12 element members to 0.
  • prompt the user to enter the high temperature and low temperature for each month.
  • create a module called findHighest, that searches the highs array for the highest temperature.
  • create a module called findLowest that searches the lows array for the lowest temperature.
  • output which month was the hottest month and which month was the coldest month.

The main module looks like this minus a few adjustments. Use the answer text area to write-in the code to complete the main definition and then define the methods findHighest and findLowest.

def main():
month = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}

   highs = #create an array of 12 elements initialized to 0

   lows = #create an array of 12 elements initialized to 0

   for temps in range (len(months)):
highs[temps] = int(input("Enter the highest temperature for " + month[temps] + ": "))
lows[temps] = int(input("Enter the lowest temperature for " + month[temps] + ": "))
highMonth = #the module call to find the position of the highest month
lowMonth = #the module call to find the position of the lowest month
print("The hottest month was ", month[highMonth], " at ", highs[highMonth], " degrees")
print("The coldest month was ", month[lowMonth], " at ", lows[lowMonth], " degrees")

def findHighest(arr):
'''define how to find the highest value in an array and return the position of that highest value'''

def findLowest(arr):
'''define how to find the lowest value in an array and return the position of that lowest value '''

 

Reference no: EM13160622

Questions Cloud

Explain carbon monoxide or nitrogen monoxide : Helium= ? g/mL Neon= ? g/mL Carbon monoxide= ? g/mL Nitrogen monoxide= ? g/mL If the density of air at 25 degrees C and 1.00 atm is 0.00117 g/mL, will any of the balloons float in this air? Which ones?
What will be the volume of the gas sample : A gas sample has an original volume of 680 ml when collected at 720mm and 28C. what will be the volume of the gas sample if the pressure increases to 820 mm and the temperature increases to 55C?
Problem on realized gain of loss : Elizabeth's property had an adjusted basis of $9000 and a fair market value of $10,500, and Elizabeth gave Debbie $4500 in cash. Determine Debbie's and Elizabeth's realized gain of loss, recognized gain or loss and the basis in their new property.
Compute the weight percentages of ccl : Then the potential of the mercury cathode was adjusted to -1.80 V vs. SCE, and the quantity of electricity passed during this second electrolysis was 64.17 cou- lombs. Calculate the weight percentages of CCl4 and CHCl3 in the original sample.
Write a simple program that stores the high temperatures : A meteorological company wants you to write a simple program that stores the high temperatures and low temperates for each of the months of the year. After consulting with trusted programming partners, you come up with a great idea
What is the number of moles of o2 needed : What is the number of moles of O2 needed to burn 260.0g of C2H2 in the reaction: 2C2H2 + 5O2 yields 4CO2 + 2H2O?
Calculate the amount of fe2(so4)3 formed : 2.9 mol Fe(OH)3 and 7.7 mol H2SO4 react according to the equation 2 Fe(OH)3 + 3H2SO4 -!> Fe2(SO4)3 + 6H2O. If the limiting reactant is Fe(OH)3, calculate the amount of Fe2(SO4)3 formed. Answer in units of mol.
Discussing overlap of crime-punishment and poverty : Write a paper discussing the overlap of crime, punishment, and poverty. Please elaborate on the following points in your essay, each of which is raised by Wheelock and Uggen:
Suggest how other types of spectroscopy might be useful : The compounds below cannot be identifed from IR and H NMR spectra alone. Explain. Suggest how other types of spectroscopy might be useful in solving the structure

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Import the data into matlab and name the array ace_data

Parameter is related to the energy of the storm, since kinetic energy is proportional to velocity squared. However, it does not take into account the size of the storm, which would be necessary for a true total energy estimate.

  Parking in garage using matlab

In matlab: parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $0.50 per hour for each hour.

  Construct the shear force and bending moment diagrams

Write the algorithm and draw the flowchart for each problem

  Determine the inputs, outputs, relevant formulas

determine the inputs, outputs, relevant formulas

  Secant method to tryt to find out the root

create a function that will use the secant method to tryt to find out the root

  Develop a simulation program

Develop a simulation program

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  One-dimensional steady-state heat flow

A one-dimensional steady-state heat flow, the mathematical formulation of problem - find out the temperature differences at each locations and calculate the temperatures at each locations

  Impact of zigbee on telecommunication systems

Report on Impact of zigbee on telecommunication systems

  Find general solution of the ordinary differential equation

Find a general solution of the following ordinary differential equations and find the general solution of the following ordinary differential equation

  Time domain design and analysis

To design a "custom" controller to reduce the vibrations of the seat and a PID controller to reduce the vibration of the seat

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd