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

  Plot the lines using the inputted vector of x values and x

Write a function named solveSystem that has three inputs: two vectors consisting of coefficients [a b c] of two line equations of the form ax + by = c and a vector of x values.

  Boundary conditions for the finite element model

The computer program or the finite element model for one value of a and the excel file for finite element results processing;Boundary conditions for the finite element model

  Stepper motor driven xy table

Stepper Motor Driven XY Table - Use Matlab and Labjack to acquire digital inputs from limit switches and use Matlab to analyze acquired data

  Compute the eigenvalues and eigenvectors of the matrix

Compute the eigenvalues and eigenvectors of the matrix

  Impact of zigbee on telecommunication systems

Report on Impact of zigbee on telecommunication systems

  Implement linear support vector machine to classify data

code to implement linear Support vector machine to classify data (without using matlab built in function).

  Write a system program for bus arbiter

The bus arbiter is a device used in multi-master system with shared bus. It is used to allocate the control of the shared system bus to one master at a time depending priority.

  Solve the differential equation

Find a general solution of the following differential equation and solve the differential equation

  Develop a well-structured function

Develop a well-structured function to compute v as a function of t. Then use this function to generate a table of v versus t for t = -5 to 50 at increments of 0.5.

  Determine the volume of the pyramid

Determine the volume of the pyramid. When the user enters every value, they will then be prompted also for either 'i' for inches, or 'c' for centimeters.

  Fourier transform and biosignal analysis

Fourier Transform and Biosignal Analysis - series data into its frequency components for the purpose of signal analysis and processing.

  Linear support vector machine svm

Write a computer program to prepare a Linear Support Vector Machine SVM.

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