GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 06-Oct-2006, 19:32
alfie27 alfie27 is offline
New Member
 
Join Date: Oct 2006
Posts: 12
alfie27 is on a distinguished road

i need help with a simple program!!


Can someone please help me get started on my program. I have trouble with functions and function calls.
Can someone please even just do this for one of the variables so i can see how it should be set up?

Here are the requirements:

Create a simple weather station simulation with two features:
The ability to record current weather conditions
The ability to report current weather conditions
The weather conditions that should be supported are:
temperature (in degrees Farenheit)
wind speed (in miles per hour)
wind direction (see below for how you are to represent this)
dewpoint (in degrees Farenheit)
cloudiness rating (use a scale from 1 to 10 with 1 being clear and 10 being overcast)
barometric pressure (in inches of mercury)
General Specifications:
When the program begins, the user should be prompted to enter all of the weather conditions. Employ reasonable error checking. For example, the dew point should be less than or equal to the temperature. For those conditions represented by a range, make sure the entry falls within the range.
After the conditions have been entered, the conditions should be presented formatted in a reasonable manner.

Use the following table as a guide to represent Wind Direction as a number between 0 and 7:


7 = NW 0 = N 1 = NE
6 = W 2 = E
5 = SW 4 = S 3 = SE


Technical Specifications
This program is worth 20 points.
Implement the two features as two functions (8 points each, total 16 points):
A single function to gather all weather conditions
A single reporting function
The main design decision you will have to make is to determine where it will be necessary to use reference variables in the function arguments in order to implement call by reference where appropriate. (2 point deduction for inappropriate use of reference variables)
You will also have to determine whether the functions need to return values, and if so, what type.
The main program just needs to call the two functions in order. (1 point)
Calculate and display the relative humidity based on the temperature and dewpoint. You will have to find a formula for this. (1 point)
Come up with a way to translate the cloudiness index into an English description (1 point)
  #2  
Old 06-Oct-2006, 21:29
Sokar Sokar is offline
Member
 
Join Date: May 2005
Posts: 243
Sokar has a spectacular aura aboutSokar has a spectacular aura about

Re: i need help with a simple program!!


Here is a simple function and a function call.
CPP / C++ / C Code:
#include <iostream>
#include <ostream>

using namespace std;

void test(int var1)
{
	cout << var1 << endl;
}

int main()
{
	int testvar = 8;
	test(testvar);
	return 0;
}
 
 

Recent GIDBlogInstall Adobe Flash - Without Administrator Rights by LocalTech

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
little help with a simple program patito C++ Forum 3 08-Sep-2005 08:40
[TUTORIAL] Calling an external program in C (Linux) dsmith C Programming Language 4 22-Apr-2005 13:30
Help with simple math table program (was a SIMPLE program) Bubba C Programming Language 3 09-Mar-2005 12:40

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 04:49.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.