C/C++ :: Room Temperature / Humidity And Heat Index

Jan 20, 2015

What I have to write in "int main" to get 1.room list 2.every room temperature, humidity and heat index 3.and how to increase or decrease every parameter

#include <iostream>
#include <string>
using namespace std;
struct Klinikos //hospital {
string Patalpos; //room
float Temperatura; //temperature
float Dregme; //humidity
bool moreTemp;
float KarscioIndeksas; //heatindex

[Code] .....

View 7 Replies


ADVERTISEMENT

C Sharp :: Maintain Temperature Of Grill And Measure Temperature Using Probe At 12 Points

Jan 16, 2013

I have to write a program for a restaurant and their food has to be cooked on a hot sheet of metal and too cook their burgers properly I must keep a maintain temp of 400 F, for the grill and to measure the temperature using a probe at 12 points, there are 3 elements with 3 points on them

View 2 Replies View Related

C/C++ :: Applying Heat Flux On A Surface

Apr 21, 2014

I am trying to write udf for heat flux on X-Y plane in Fluent having the formula

Q(Y) = (0.304)/(deltaY + deltaY/2)^-3
Where deltaY = 50cm and
Y = 10m

but I am unable to do it. Can write udf for heat flux? Y is the length on Y-axis and X whixh is equal to 5m is length on X-axis. Q is heat flux goes through X-Y plane in Z direction. Geometry is a cube with dimension 10*5*0.005 all are in meters.

View 1 Replies View Related

C++ :: Find Area Of Room In A Given Square Maze

Apr 1, 2013

Area of the room. Your task is to write a program that will find the area of room in a given square maze.

Note. Use recursion for solving this problem.

Input:
First line contains only one number N (3 <= N <= 10).The number that describes the size of the square maze.
On the next N lines maze itself is inputed ('.' - empty cell,'*' - wall).
And the last line contains two numbers - the row and column of the cell in the room those area you need to find.It is guaranteed that given cell is empty and that the maze is surrounded by walls on all sides.

Output:
Output only one number - total amount of empty cells in the selected room.

View 8 Replies View Related

C/C++ :: Make A Room File Writer For Text Adventuring?

Mar 1, 2015

I'm attempting to make a room file writer for text adventuring. I compartmentalized each variable for the stream, and dealth with the buffer over runs and all that. Now what I would like to do is make the "get_shdesc" function cut it's lines off at the last white space before it hits the 80th character and continue on the next line. I have no errors, and it functions properly so far.

1. Am I attacking this program in the proper manner so far?

2. If not, what should I be doing?

3. If so, what specifically should I read and study on to get the word wrap effect I am looking for.

My code thus far is:

#include <iostream>
#include <fstream>
#include <string>
#include <windows.h>

[Code]....

View 3 Replies View Related

C++ :: Check CPU / RAM USAGE / Temperature

Nov 1, 2014

I want to make an application that will check CPU/RAM USAGE and CPU TEMPERATURE and if it meets some requirements it will restart your system or do something else..but my problem is:

1) How do i get that info? (i know that in VB.net there is an easy way) but in C/C++ or Java?

2) Is it possible though a C program to execute a command and parse that info to your program?

I am mainly interested for windows but i need also info for linux too..

View 4 Replies View Related

C++ :: Displaying Celsius Temperature?

Dec 1, 2014

I am using Microsoft Visual C++ 2010 Express.

This is my Algorithm. [URL] ....

#include <iostream>
#include <iomanip>
using namespace std;
//function prototypes
int getFahrenheit();
double calcCelsius(int tempF)

[Code] ....

for some reason it keeps giving me a
Error C2144: syntax error: 'int' should be preceded by ';' on line 16 column 1
Error C2143: syntax error: missing ';' before 'return' on line 34 column 1
IntelliSence: expected a ';' on Line 34 Column 2

I have tried to fix both of these problems and no matter what I do I either get more errors or they wont go away...

View 5 Replies View Related

C++ :: Temperature In Celsius And Fahrenheit - No Output

Mar 8, 2013

The program should create two integer variables for the temperature in Celsius and Fahrenheit. Initialize the temperature to 100 degrees Celsius. In a loop, decrement the Celsius value and compute the corresponding temperature in Fahrenheit until the values are the same. But for some reason i either get no output or an out put of -43.

#include <iostream>
using namespace std;
int main() {
int celsius;
int fahrenheit;

fahrenheit = 0;
celsius = 100;

[Code] ....

View 1 Replies View Related

C++ :: Calculate Wind Chill Temperature

Feb 4, 2014

Here is my problem:

Wind Chill = 35.74 + 0.6215T – 35.75(V^0.16) + 0.4275T(V^0.16)

Note: Windchill Temperature is only defined for temperatures at or below 50 degrees F and wind speeds above 3 mph. Bright sunshine may increase the wind chill temperature by 10 to 18 degrees F.

#include <iostream>
#include <string>
#include <iomanip>
#include <cmath>
using namespace std;
double windChillFactor (const double &v, const double &t)

[Code] ....

View 3 Replies View Related

C/C++ :: Take Temperature In Fahrenheit And Convert It Into Centigrade

Feb 10, 2015

I am trying to write a program where i take temperature in Fahrenheit and convert it into centigrade. I keep getting this error "The program '[5980] lab3.exe: Native' has exited with code 0 (0x0)."

My Code is :

#include <iostream>
using namespace std;
int main() {
double fahrenheit, centigrade;
cout << "Enter the temperature in Fahrenheit: ";
cin >> fahrenheit;
centigrade = (5/9)(fahrenheit-32);
cout << "The Temperature in Centigrade is " << centigrade << endl;
return 0;
}

View 4 Replies View Related

C++ :: Temperature Converter From Imperial To Metric - For Loop

Nov 26, 2013

I've been doing some practice programming challenges and I am currently making a temperature converter from Imperial to Metric.

My approach was to make it as simple as possible but it must display correctly and use decent I/O manipulations corresponding with how high the counter is.

This is what I have come up with, and everything seems to work fine for a base where I could possibly add more code to include user input, but before I go to that one step further I'd just like to know if the approaches I have taken to using iomanip is OK practice and I haven't done any serious no-nos, as I haven't seen any code from example videos that people make that includes this!

Here's the code:

#include <iostream>
#include <iomanip>
using namespace std;
int main()

[Code] ....

The reason I added the IO manipulators is because I couldn't stand seeing everything not lining up, it looked very sloppy and unprofessional..

View 2 Replies View Related

C++ :: Temperature Converter With A Menu - Printing Right Output

Nov 13, 2014

I'm trying to make a simple temperature converter with a menu that lets users pick which conversion to perform. But, it won't seem to print the right conversion. It just prints the same temperature that I inputted.

for example:

#include <iostream>
using namespace std;
//prints the menu
void userMenu(){
cout << "Temperature Calculator" << endl << endl;

[Code] .....

View 2 Replies View Related

C++ :: Displaying Maximum / Minimum And Average Temperature

Dec 31, 2014

I am given two month's data (Max, Min, Ave) for every day in that month.

The task is to display all 3 of that data for any selected day in that 2 months.

View 3 Replies View Related

Visual C++ :: Finding Temperature At The End Of Interval But Can't Seem To Get Answer?

Oct 30, 2013

I've been trying to get the numbers for hours now but i can seem to get it right. Here's the problem below:

During the initial period, when the heater is not yet functioning at peak efficiency the heating will increase the temperature inside the building at a rate given by the following equations. During the initial period when the air conditioner is not yet functioning at peak efficacy the air conditioner will decrease the temperature inside the building at a rate given by the same equations.

Interval = (Time since turning on / 2.0 ) - 3.0
Factor multiplying Temperature change per minute = exp( Interval) / ( 1 + exp(Interval) )

These equations can also be used after the heating or air conditioner reaches peak efficiency. These equations converge to 1, so after the heating or air conditioner reach peak efficiency these equations will always give a value of 1.

the value of these equations needs to be multiplied by the RATE TEMPERATURE CHANGES. The RATE TEMPERATURE CHANGES is EITHER the change in temperature inside the building in degrees Celsius per minute caused by heat being extracted by the air conditioning OR the change in temperature inside the building in degrees Celsius per minute caused by the heat being generated by the heating .Temperature change in degrees per minute = Factor multiplying Temperature change per minute * RATE TEMPERATURE CHANGES

Temperature at end of this interval = Temperature at the start of the interval + temperature change due to heat escaping during the this interval + temperature change due to heat generated by the heating system during this interval + temperature change due to heat removed by the cooling system during this interval

i have a:

...rate of -.05 for heat escape w/o cooling or heating
...rate of 0.10 for heat escape w/ cooling
...rate of 0.125 for heat increase w/ heating
...Starting temp=38.00
...Time interval 3.50

I can't seem to find the temp at the ending interval? What i tried doing:

Code:
#include<iostream>
#include<cmath>
using namespace std;
int main () {
double intervals=0.00;
double tempPerMin=0.00;

[Code] ....

The temperature at the end of the interval is suppose to be 37.81 but i can't get the answer. I'm pretty sure this is a logical error from the equations i used but i can't seem to find it.

View 3 Replies View Related

C++ :: Temperature Conversion Is Coming Up Wrong When Enter In Input

Feb 1, 2015

How would you be able to show both outputs celsius and Fahrenheit and my temperature conversion is coming up wrong when i enter in the input. here is my code...

#include<iostream>
using namespace std;
int main(){
double celsius;
double fahrenheit;

[code].....

View 1 Replies View Related

C++ :: Program That Create And Display Table Of Temperature Conversions

Feb 12, 2015

Write a program that creates and displays a table of temperature conversions. Get the starting temperature from the keyboard in degrees Celsius (do not allow input of a value below absolute zero). Also get an integer value to represent the number of degrees to increment for each of a 20 row table (do not allow the increment value to be less than one. The first column will be a row number starting with one, follow by the Celsius value and then the conversions into Fahrenheit, Kelvin, and Rankine. Be sure that all columns are neatly right aligned for a variety of inputs.

Thats what i wrote so far:

#include <iostream>
#include <iomanip>
using namespace std;
int main() {
double C,F,K,R,n,a;
cout <<"Enter starting temperature in Celsius: ";
cin >> C;
[Code] ....

Thats what the instructor looking for:

Enter starting temperature in Celsius: -500
ERROR: Temp must be >= -273.15: -273.15
Enter increments in degrees Celsius: 100

# Cels Fahr Kelv Rank
1 -273.15 -459.67 0.00 0.00
2 -173.15 -279.67 100.00 180.00
3 -73.15 -99.67 200.00 360.00
4 26.85 80.33 300.00 540.00
5 126.85 260.33 400.00 720.00
6 226.85 440.33 500.00 900.00
7 326.85 620.33 600.00 1080.00
8 426.85 800.33 700.00 1260.00
9 526.85 980.33 800.00 1440.00
10 626.85 1160.33 900.00 1620.00
11 726.85 1340.33 1000.00 1800.00
12 826.85 1520.33 1100.00 1980.00
13 926.85 1700.33 1200.00 2160.00
14 1026.85 1880.33 1300.00 2340.00
15 1126.85 2060.33 1400.00 2520.00
16 1226.85 2240.33 1500.00 2700.00
17 1326.85 2420.33 1600.00 2880.00
18 1426.85 2600.33 1700.00 3060.00
19 1526.85 2780.33 1800.00 3240.00
20 1626.85 2960.33 1900.00 3420.00
Press any key to continue . . .

My question is to know how to make the sequence from 1 to 20 and whats the best statement for increment...

View 2 Replies View Related

C :: Take Integer Input For Temperature And Display Message For Different Ranges For Each Day Of Week

Apr 20, 2014

I'm writing the program below to take an integer input for temperature and display a cheesy message for different ranges for each day of the week.

I tried using two if statements, the first to determine if the input is valid, and the else display that it was invalid and to try again.

The second set of if (if else) statements would evaluate a number input and display the cheesy message based on the value, or if it was out of range, to make you re input that days temperature.

I understand that the else statement is linked to the closest if statement, unless brackets are added to prevent this. I thought my brackets were correct, but I keep getting [Error]'else' without previous if'. The red lines are the if and else statement I'd like to be linked, and tried to do so by enclosing the 2nd if statement in brackets.

The assignment doesn't require the error checking, but if I don't use some form of it I believe it will just loop. Again I have to use the last 4 lines due to instructors rules, and have to use scanf and not strings or arrays.

This program will ask the user what the temperature will be for each day of the week. The integer input from the keyboard will be tested in a series of IF tests and a message will be printed depending on the temperature.

Code] ....

#include <stdio.h>
#define MAX 100
#define MIN 0

int main() {
int day = 1;
int temp;

[Code] ....

View 10 Replies View Related

C# :: How To Manually Control The Temperature Of High Power Leds Using PID Controller

Mar 20, 2015

how to manually control the temperature of High Power Leds using PID controller. I have two GUIs,one reads the temperature from the Led while the second is used to ON/OFF the Leds and at the same time controls the Led brightness using slider control.The GUI that reads the temperature has a PID controller application on it.The output from this controller is what i want to use to increase or decrease the Led brightness which invariable changes the Led temperature.How to go about using this PID controller to control the Led brightness is what i have not been able to grasp well.The slider on the GUI is scaled from 0% to 100%.My thinking is that the output from the controller should be in percentage which will make me to adjust the slider accordingly.My question is that will this type of arrangment produce an output that will efficiently control the Led brightness. how to accomplish that. Attached to this post is a modified code of a tutorial on PID controller which i found on the net. a tutorial on how to develop a graph. i wish to display the Setpoint,Process value and the output value on a graph.

View 2 Replies View Related

C :: Program To Show Highest Negative And Lowest Positive Temperature Of Year

Jan 19, 2014

I have an assigment and I don't know yet how to write this program :" I introduce the average monthly temperatures of a year(12 values for 12 months). When I compile the program it needs to show the highest negative temparature and the lowest positive temperature of that year.

Example: Entry data: -4 -6 0 5 10 20 24 25 17 8 -1 -7 exit data : max negative= -1 and min positive= 5 "

View 11 Replies View Related

C++ :: Bubble Sorting Vectors - Display Highest Temperature And Occurrence Time

Feb 12, 2013

I'm doing a project where I have to store information gathered (temperature and the time it was taken in seconds) in two separate vectors. After an unknown amount of data has been entered, and the end-of-file has been reached, I have to display the highest temperature and the time(s) it occured (bear in mind that the highest temperature may be recorded more than once). The output of that part should be as follows:

Highest temperature: 51
Recorded at time(s):
22:45
2:27

Something like that. The time should also be converted to hours and minutes. To the point: I've done some research on bubble sorting, but they only use it for arrays.

View 3 Replies View Related

C :: Array Out Of Index

Apr 17, 2014

I was trying to debug a code which was behaving in an abnormal way

Code:

#define NOOFELEMENTS 32
unsigned char array[NOOFELEMENTS];
unsigned char array1[23];
init() {
for(i=0;i<=32;i++)
{
array[NOOFELEMENTS] = 0
}
}

I could trace the above one of the mistakes where the array initialization is crossing the array limits and writing into array[32] which is not available. My question does it overwrite into array1 as it is declared below array or it can write into any other location.

View 4 Replies View Related

C++ :: Input Value Get Index

Sep 9, 2014

I am trying to get the index of a value by inputting the value:

For example if i have

int arr[5]={22, 85, 58, 78, 69};

indexOfItem(arr, 78);

and have the output be:

the index of the item is: 3

View 3 Replies View Related

C++ :: Row And Column Index?

Dec 16, 2013

If i have current index and row/columns count how do i get on which row and on which column index is individually?

This is what i have tried, but column index is incorrect:

#include <iostream>
int main()
{
int rows = 5;
int colm = 6;
int inx = 12;
int rowInx = inx % rows;
int colInx = inx % colm;
std::cout << "row: " << rowInx << std::endl;
std::cout << "col: " << colInx << std::endl;
return 0;
}

View 4 Replies View Related

C# :: Index Out Of Bounds Error

Jun 27, 2014

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Chapter7Problem13

[Code] .....

I keep getting an out of bounds error in my code

I'm suppose to enter number of orders then enter those orders then calculate a discount and net price display the orders, discount, net price then the totals at the bottom ....

View 5 Replies View Related

C :: How To Get Index Of Structure Elements

Apr 9, 2013

I want to get the starting index of structure elements, whoz id are 0,1,2,3 Like in below code col_data[0] (starting id=0) col_data[3] (starting id=1) col_data[5] (starting id=2) col_data[8] (starting id=3) Code:

Code:

typedef struct gg{
int id;
int value;
}

[code]....

How can i skip remaining loop iterations when it get that index and will go back to loop again for getting next element index?

View 7 Replies View Related

C++ :: Determining Index To Place New Value

Dec 9, 2013

I need function to determine where to place new element in sorted array. I want to use binary search to find index where element should be placed, when push all others.

Prototype should be something like

int WhereToPlaceElement(ElementType hash); // uses private atribute ElType** elements

I have tried my best to write, but all tries ended in inf loops and reading invalid locations of array.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved