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

  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.

  Matlab code to solve for temperature and pressure variation

Write down the MATLAB code to solve for temperature and pressure variation throughout the expansion process and to evaluate work and heat produced in processes for variable values of n.

  Calculate and plot the error in the numerical derivative

Write a program to calculate and plot the error in the numerical estimate of the derivative.

  Linear support vector machine svm

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

  Write a functions

The function range basis takes a matrix A as input, and outputs a basis (again written as columns) for the range space of A.

  Fit the exponential function to the relaxation data

Fit the exponential function to the relaxation data and report the filename as well as the A, tau and B values and run all 3 functions in sequence to analyze ALL data

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  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.

  Obtain the cross products using matlab cross function

Use MATLAB cross function to obtain the above cross products. Note that the accelerations are known functions of the derivatives of the three coordinates.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Matlab: create a function that will use the secant method

MATLAB: Create a function that will use the Secant method

  Write matlab scripts

Write MATLAB scripts for to accept two numbers from the user; Display all prime numbers between these two numbers.

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