Demonstrate you successfully followed the steps in the lab

Assignment Help Computer Engineering
Reference no: EM132193427

Question: Use the following code to complete the lab. Include test tables, screen captures and full text of code used and altered.

// C code

// This program will input and store meteorological data into an array.

// Developer:

// Date: Dec 11, 2018

#define NUMMONTHS 12

#define NUMYEARS 5

#include <stdio.h>

// function prototypes

void inputdata();

void printdata();

// Global variables

// These are available to all functions

float Raindata[NUMYEARS][NUMMONTHS];

char years[NUMYEARS][5] = {"2011","2012","2013","2014","2015"};

char months[NUMMONTHS][12] ={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};

int main ()

{

char enterData = 'y';

printf("Do you want to input Precipatation data? (y for yes)\n");

scanf("%c",&enterData);

if (enterData == 'y') {

// Call Function to Input data

inputdata();

// Call Function to display data

printdata();

}

else {

printf("No data was input at this time\n");

}

printf("Please try the Precipitation program again. \n");

return 0;

}

// function to inputdata

void inputdata() {

/* variable definition: */

float Rain=1.0;

// Input Data

for (int year=0;year < NUMYEARS; year++) {

for (int month=0; month< NUMMONTHS; month++) {

printf("Enter rain for %d, %d:\n", year+1, month+1);

scanf("%f",&Rain);

Raindata[year][month]=Rain;

}

}

}

// Function to printdata

void printdata(){

// Print data

printf ("year\t month\t rain\n");

for (int year=0;year < NUMYEARS; year++) {

for (int month=0; month< NUMMONTHS; month++) {

printf("%s\t %s\t %5.2f\n", years[year],months[month],Raindata[year][month]);

}

}

}

Learning Exercises for you to complete

1. Demonstrate you successfully followed the steps in this lab by preparing screen captures of you running the lab as specified in the Instructions above.

2. 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.

3. 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.

4. Prepare a new test table with at least 2 distinct test cases listing input and expected output for the new code you created allowing the user to enter another meteorological element.

5. 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.

Reference no: EM132193427

Questions Cloud

Which type of companies often adopt hybrid structures : What are the major costs and benefits relative to the Sarbanes-Oxley Act of 2002 ? Explain. Which type of companies often adopt hybrid structures?
Identifying the major areas that the research will focus : This section will focus on clearly identifying the major areas that the research will focus on to establish a foundation of the study within the body.
What is mike rogers weighted average cost of capital : What is Mike Rogers weighted average cost of capital (WACC) - What is the market interest rate on Mike Rogers' debt and its component cost of debt
Example of strategy leading to power change : Provide an example of an strategy leading to power change and consequent hierarchical change.
Demonstrate you successfully followed the steps in the lab : Demonstrate you successfully followed the steps in this lab by preparing screen captures of you running the lab as specified in the Instructions above.
Should you report your suspicions to the corporate office : Should you report your suspicions to the corporate office? Write an essay concerning the best ethical choice for Travis Carter.
Well-managed healthcare organization are credentialed : All clinical professions working in a well-managed healthcare organization are “credentialed,” in the sense that their preparation
Review the schema and identify potential design flaws : Review the schema and identify potential design Flaws. The business process is Billing; the grain should be one row per service line (phone number) on a bill.
Describe the starbucks marketing strategy : Describe the Starbucks marketing strategy and identify their main competitors. Is Starbucks winning? why?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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