Prepare a new test table with at least two distinct test

Assignment Help C/C++ Programming
Reference no: EM131258540

Assignment

Overview:

This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the program description, Analysis, Design(program design, pseudocode), 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.

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.

A float number (rain) will also be needed to input the individual rain data.

An integer variable (Count) is needed to keep count of how many rain data elements were entered. This will keep track to make sure we don't go over 60 and we print only valid rain 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 hard coding 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, where the outer loop will be years and the inner loop will be months. A similar nested for loop can also be used to print the data in the array, where the outer loop will be years and the inner loop will be months. An 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 try:

1. Modify the program to sum the rainfall for eachyear.

(Hint: this is NOT part of the input. You have all the data collected, you need to sum for each year from the data you collected during the input.) You can do this using a looping structure during the output function printdata.) 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). (Hint: you will need another array). Note, the user should be able to enter both rainfall and windspeed in your new implementation.-

You will need to update the input data and print data functions. Support your experimentation with screen captures of executing the new code. Submit your code as a separate .txt (or .c )file.

3. Prepare a new test table with at least 2 distinct test cases listing inputand expected output for the code you created after step2

4. What happens if you change the NUMMONTHS and NUMYEARS de finitions to other values? Be sure to use both lower and higher values. Describe what happens if you use larger numbers to Declare thearrays. Describe what happens if you use lower numbers to Declare thearrays.

Support your experimentation with screen captures of executing the new code.

Attachment:- Lab_Assignment.rar

Reference no: EM131258540

Questions Cloud

How consumer buying decisions are heavily influenced : Lamb et al. (2014) explain that the same basic principles of marketing apply to businesses as they do for consumers. However, businesses make buying decisions differently than consumers due to the different characteristics that influence their buy..
What is the total normal time for sharpening one pencil : Sharpening your pencil is an operation that may be divided into eight small elemental motions. - What is the total normal time for sharpening one pencil?
Batter the profits of some us companies : The rise of the dollar could batter the profits of some U.S. companies this year and slice into capital spending.
Produce a downward movement of the price : Assume Qs represents the quantity supplied at a given price and Qd represents the quantity demanded at the same given price.Wich of the following market conditions produce a downward movement of the price?
Prepare a new test table with at least two distinct test : Prepare a new test table with at least 2 distinct test cases listing inputand expected output for the code you created after step 2.
How do the two articles relate to one another : Are the ideas in the articles contradicted by more recent thinking on the subject of global market entry strategies; for example, by the ideas in this module's text resources? Describe any contradictions you found regarding global marketing entry ..
Aspects of greek and roman culture including religion : Discuss the extent to which myths told by the Romans reflected aspects of Greek and Roman culture including religion - what extent is a myth a ‘traditional sacred story...of archetypal or universal significance' (Cupitt). Illustrate your answer with..
Calculate the hydraulic residence times : Assume that both lakes currently are polluted with the same compound at a concentration that is 10 times the maximum acceptable level. If all sources of the compound are removed, how long will it take the con-centration to reach acceptable levels ..
Recession in the coming 12-months : As the presidential election looms, we are hearing more about the potential for a recession in the coming 12-months. What signs should we be looking for to determine if it is indeed on its way? What are the implications on "your company" and how ..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a function named totamt

Write a function named totamt() that uses four parameters named quarters, dimes, nickels, and pennies, which represent the number of each of these coins in a piggybank.

  Take four unsigned char bytes and combine

Take four unsigned char bytes and combine them into a single integer type. You will needed shifts and one of the logical bit operators.

  Cashregister class that can be used with the retailitem clas

Write a CashRegister class that can be used with the RetailItem class that you wrote in Part 1. The CashRegister class should simulate the sale of a retail item. It should have a constructor that accepts a RetailItem object as an argument.

  Principle ofsuperposition to determine that system is linear

Apply the principle of superposition to determine whether the following systems are linear. Sketch what the plot of the function looks like.

  Display a list of items and the location in the store

The program should display a list of items and the location in the store. The user must be able to enter the items and location in the store. You will use a class for the items. For this assignment you will implement creating the list, adding eleme..

  Authentication method for android

For the fourth program under Connector for Pi to be able to (Connect between File Handle and Client+Server socket program).

  Write function to find whether number is perfect number

Write down the function perfect which determines whether number is perfect number or not. This function must receive number and return true if number is perfect.

  Program to declare array alpha of components of type int

Write C++ statements to do the following: Declare an array alpha of 15 components of the type int. Output the value of the tenth component of the array alpha.

  Write an iterative version and a recursive version

Write a main program that illustrates the work of your functions. E.g., if a[ ]={1,2,3,3,4,5} then 3 occurs 2 times and 7 occurs 0 times.

  Buy the radio with the higher purchase

Joel is selling a radio cassette with a hire purchase of $360, He can also buy the radio in cash of $300, The deposit is given to be $160. Emmanuel decided to buy the radio with the higher purchase in 4 months how much is his installment?

  Develop and test a website for the new look beauty salon

Develop and test a website for the New Look Beauty Salon - critically explore the work you have done to produce your Project.

  The overloaded assignment operator.

You have a class called MyBag that contains this partial implementation of the overloaded assignment operator.  The first line is missing.

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