Click here to Skip to main content
16,012,468 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRegarding Automation Server and client Pin
yaminisridaran6-Apr-07 21:11
yaminisridaran6-Apr-07 21:11 
Questionopening CRecordset problem.. Pin
CraZyToLearn6-Apr-07 20:54
CraZyToLearn6-Apr-07 20:54 
Questionhide dos window Pin
deeps_cute6-Apr-07 20:52
deeps_cute6-Apr-07 20:52 
AnswerRe: hide dos window Pin
cp98766-Apr-07 21:10
cp98766-Apr-07 21:10 
GeneralRe: hide dos window Pin
deeps_cute6-Apr-07 21:21
deeps_cute6-Apr-07 21:21 
GeneralRe: hide dos window Pin
cp98766-Apr-07 21:44
cp98766-Apr-07 21:44 
AnswerRe: hide dos window Pin
Hamid_RT6-Apr-07 21:38
Hamid_RT6-Apr-07 21:38 
QuestionOutput correct value Pin
planetx226-Apr-07 19:52
planetx226-Apr-07 19:52 
My program works fine if the temperature entered is above 30(say 100).. it will perform the calculations and output the result. I need it to also output the number if it is below 30 (if i enter 29, it outputs 29) but i can't get it to output anything. Thnx for the advice.

// Computer Lab test.cpp : Program that asks for temperature inputs, 
// ensures input is in centigrade, and outputs # of arrays + corrected temp

// Andrew Stewart CMPT 201

#include "stdafx.h"
#include <iostream>
using namespace std;

float CheckCent(float c) // Function to convert user values into centigrade(celsius) <- function named CheckCent
{
 if (c > 30.0)
 {
 c=(c-32.0)/(1.80); return c; // formula for fahrenheit to celsius(centigrade)
 }
 return c;
}
int _tmain(int argc, _TCHAR* argv[])  // Main function
{
float myarray[50];  // declare array from 0-49 values
int flag; // counter for loop
flag=1;
int i; // number of arrays
for(i = 0; i < 50 && flag == 1; i++) 
{   
    cout << "Enter Temperature Reading:";
	cin >>myarray[i];
	cout << "Enter 1 to input more values, 0 to stop";
	cin >>flag;
}// End for
cout << "\n\nNumber of elements in the array is: " << i <<endl;
cout <<"\n";
for(int j=0;j<=i;j++)
{
	if(myarray[j]>30.0)
	{
		myarray[j]=CheckCent(myarray[j]);
		cout <<"The corrected value is: ";
	    cout <<myarray[j] <<" Celsius";
		cout <<"\n\nProgram Complete!\n\n";
	}
	
}
return 0;
}

AnswerRe: Output correct value Pin
PS@Codeproj6-Apr-07 20:27
PS@Codeproj6-Apr-07 20:27 
GeneralRe: Output correct value Pin
planetx226-Apr-07 21:12
planetx226-Apr-07 21:12 
GeneralRe: Output correct value [modified] Pin
jeron18-Apr-07 7:53
jeron18-Apr-07 7:53 
QuestionHow can I change caption page of Property Sheet at runtime Pin
dungpapai6-Apr-07 18:13
dungpapai6-Apr-07 18:13 
AnswerRe: How can I change caption page of Property Sheet at runtime Pin
Ravi Bhavnani6-Apr-07 19:16
professionalRavi Bhavnani6-Apr-07 19:16 
GeneralRe: How can I change caption page of Property Sheet at runtime Pin
dungpapai8-Apr-07 15:48
dungpapai8-Apr-07 15:48 
QuestionRadio button event handle problem in win32 Pin
amitmistry_petlad 6-Apr-07 18:08
amitmistry_petlad 6-Apr-07 18:08 
QuestionFree/total RAM? Pin
dontknowitall6-Apr-07 16:19
dontknowitall6-Apr-07 16:19 
AnswerRe: Free/total RAM? Pin
Ravi Bhavnani6-Apr-07 16:27
professionalRavi Bhavnani6-Apr-07 16:27 
GeneralRe: Free/total RAM? Pin
dontknowitall6-Apr-07 16:48
dontknowitall6-Apr-07 16:48 
Questionchild dialog box? Pin
iayd6-Apr-07 11:11
iayd6-Apr-07 11:11 
AnswerRe: child dialog box? Pin
Ravi Bhavnani6-Apr-07 16:25
professionalRavi Bhavnani6-Apr-07 16:25 
QuestionRe: child dialog box? Pin
iayd6-Apr-07 21:07
iayd6-Apr-07 21:07 
QuestionRe: child dialog box? Pin
Hamid_RT6-Apr-07 21:58
Hamid_RT6-Apr-07 21:58 
AnswerRe: child dialog box? Pin
iayd6-Apr-07 22:24
iayd6-Apr-07 22:24 
GeneralRe: child dialog box? Pin
Hamid_RT7-Apr-07 0:13
Hamid_RT7-Apr-07 0:13 
AnswerRe: child dialog box? Pin
Ravi Bhavnani7-Apr-07 4:03
professionalRavi Bhavnani7-Apr-07 4:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.