Reference no: EM13995632
Hands-On Lab
Overview
This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the program description, analysis, test plan, and implementation with C code. The example provided uses sequential, repetition, selection statements, functions, strings and arrays.
Program Description
This program will input and store meteorological data into an array. The program will prompt the user to enter the average monthly rainfall for a specific region and then use a loop to cycle through the array and print out each value. The program should store up 5 years of meteorological data. Data is collected once per month. The program should provide the option to the user of not entering any data.
Analysis
I will use sequential, selection, and repetition programming statements and an array to store data.
I will define a 2-D array of Float number: Raindata[][] to store the Float values input by the user. To store up to 5 years of monthly data, the array size should be at least 5*12 = 60 elements. In a 2D array this will be RainData[5][12]. We can use #defines to set the number of years and months to eliminate hardcoding values.
A float number (rain) will also be needed to input the individual rain data.
A nested for loop can be used to iterate through the array to enter Raindata. A nested for loop can also be used to print the data in the array.
A array of strings can be used to store year and month names. This will allow a tabular display with labels for the printout.
Functions will be used to separate functionality into smaller work units. Functions for displaying the data and inputting the data will be used.
A selection statement will be used to determine if data should be entered.
Learning Exercises for you to complete-
1. Modify the program to add a function to sum the rainfall for each year. (Hint: you need to sum for each year. You can do this using a looping structure). Support your experimentation with screen captures of executing the new code.
2. Enhance the program to allow the user to enter another meteorological element such as windspeed (e.g. 2.4 mph). Note, the user should be able to enter both rainfall and windspeed in your new implementation. Support your experimentation with screen captures of executing the new code.
3. Prepare a new test table with at least 2 distinct test cases listing input and expected output for the code you created after step 2.
4. What happens if you change the NUMMONTHS and NUMYEARS definitions to other values? Be sure to use both lower and higher values. Describe and implement fixes for any issues if errors results. Support your experimentation with screen captures of executing the new code.
Attachment:- Lab.rar
What is the sample proportion
: a. What is the sample proportion, p 5 proportion of contacts that resulted in a sale being made? b. For simple random samples of this size, what is the probability that p # 0.10?
|
Average deviation from perfect accuracy
: If the manufacturer's claim is correct (i.e., µ, 5 30 seconds, a 5 10 seconds), what is the probability that the average deviation from perfect accuracy would be 34 seconds or more?
|
What is the velocity of the box as it leaves the table
: Find the accleration of the box during the sliding period. What is the velocity of the box as it leaves the table. What horizontal distance (R) from the table will the block reach when it hits the ground.
|
What z-score corresponds to the sample mean
: When a production machine is properly calibrated, it requires an average of 25 seconds per unit produced, with a standard deviation of 3 seconds. For a simple random sample of n 5 36 units, the sample mean is found to be }x 5 26.2 seconds per unit..
|
Modify the program to add a function to sum the rainfall
: Modify the program to add a function to sum the rainfall for each year. (Hint: you need to sum for each year. You can do this using a looping structure). Support your experimentation with screen captures of executing the new code
|
What will be the frequency when the block is displaced
: A 2.00-kg block is attached to the end of a horizontal ideal spring and rests on a frictionless surface. What will be the frequency when the block is displaced and released from rest again?
|
What speed can this car travel around curve b
: Two banked curves have the same radius. Curve A is banked at 12.1o, and curve B is banked at an angle of 15.1 o. A car can travel around curve A without relying on friction at a speed of 13.1 m/s. At what speed can this car travel around curve B wi..
|
Find the vertical displacement
: Find the vertical displacement D(t) between the raised hands of the two players for the time period after Boris has jumped (t>tR) but before Arabella has landed.Express your answer in terms of t, tR, g, and H.
|
What is the distance from the equilibrium position
: What is the oscillation frequency? What is the mass position at t= 1.0 sec? What is the distance from the equilibrium position when v = 50 cm/s?
|