SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 5 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 14 Nov 2017 My Price 7.00

float Raindata[NUMYEARS][NUMMONTHS];

How do i modify this code to include the sum the rainfall for each year and windspeed?

 

#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 timen");

}

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;

4

}

}

}

// Function to printdata

void printdata(){

// Print data

printf ("yeart montht rainn");

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

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

printf("%st %st %5.2fn", years[year],months[month],Raindata[year][month]);

}

}

}

Answers

(5)
Status NEW Posted 14 Nov 2017 01:11 PM My Price 7.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)