Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming

Reply
 
LinkBack Thread Tools
Old 2 Weeks Ago   #11 (permalink)
Oͪͭ͏͝͏̘̳v̙͖ͥ̑̃ͨ̅ê̅ͥ͒̚ ̊ͬ͟
 
Sgtbash's Avatar
 
intel nvidia

Join Date: Feb 2008
Posts: 1,581

Trader Rating: 5
Default

I could do it. But cba :/
__________________

System: Gateway P-6860 FX Laptop
CPU
Core 2 Duo T5550 @ 1.8ghz
Motherboard
Intel PM965 Chipset
Memory
4GB DDR2 @ 667
Graphics Card
Nvidia 8800m GTS 512 GDDR3 G92
Hard Drive
320GB Western Digital 2.5" @ 5400RPM
Power Supply
125W Gateway
OS
Windows 7 Ultimate Retail x64
Monitor
17" Gateway @ 1440x900
Sgtbash is offline Overclocked Account Sgtbash's Gallery   Reply With Quote
Old 2 Weeks Ago   #12 (permalink)
4.0 GHz
 
31337's Avatar
 
intel nvidia

Join Date: Aug 2007
Location: The darkness of your mind
Posts: 785

Rep: 49 31337 is acknowledged by some
Unique Rep: 46
Trader Rating: 4
Default

Here's the code if you, or someone else can compile it.

Code:
#include <iostream>
using namespace std;

int main()
{
	char type=' ';
	double tempC=0.0;
	double tempF=0.0;
	double tempK=0.0;
	double totTemp=0.0;
	double gir=0.0;

sel:
	cout << "Please select input temp type (F, C, K): ";
	cin >> type;

	switch (type)
	{
	case 'F':
			goto fah;
			break;
	case 'f':
			goto fah;
			break;
	case 'C':
			goto cel;
			break;
	case 'c':
			goto cel;
			break;
	case 'K':
			goto kel;
			break;
			
	case 'k':
			goto kel;
			break;
	default:
			cout << "Invalid input type." <<endl;
			goto sel;
			break;
	}

fah:
	cout << "Please enter temp: ";
	cin >> tempF;

	tempC=((5/9)*(tempF-32));
	tempK=(tempC+273.15);
	totTemp=(tempC+tempF+tempK);
	gir=((totTemp/3)*(89875517900000000));
	goto end;

cel:
	cout << "Please enter temp: ";
	cin >> tempC;

	tempF=(((9/5)*tempC)+32);
	tempK=(tempC+273.15);
	totTemp=(tempC+tempF+tempK);
	gir=((totTemp/3)*(89875517900000000));

	goto end;

kel:
	cout << "Please enter temp: ";
	cin >> tempK;
	
	tempC=(tempK-273.15);
	tempF=(((9/5)*tempC)+32);
	totTemp=(tempC+tempF+tempK);
	gir=((totTemp/3)*(89875517900000000));

	goto end;

end:
	cout <<endl;
	cout << "Girs= " << gir <<endl<<endl;

return(0);
}
@other peeps, I don't wanna hear any comments about using goto statements, it works fine

System: Obelisk
CPU
E8600
Motherboard
ASUS Rampage Formula X48
Memory
2x2GB G.Skill DDR2-1000
Graphics Card
EVGA 9800GTX+
Hard Drive
PERC5: 2x160GBVelociRaptors(RAID0) 2xWD500GB(RAID0
Sound Card
X-Fi Xtreme Music
Power Supply
Corsair 750TX
Case
Thermaltake Armor
CPU cooling
TRUE Black 120 (2x Ultra Kaze 3000)
GPU cooling
Stock
OS
Windows 7 Ultimate RTM x64
Monitor
Samsung 2253BW
31337 is offline   Reply With Quote
Old 2 Weeks Ago   #13 (permalink)
Mobo Master
 
Starbuck5000's Avatar
 
intel nvidia

Join Date: May 2008
Location: England
Posts: 1,034

Rep: 71 Starbuck5000 is acknowledged by some
Unique Rep: 64
Trader Rating: 4
Default

Quote:
Originally Posted by 31337 View Post
Here's the code if you, or someone else can compile it.

Code:
#include <iostream>
using namespace std;

int main()
{
	char type=' ';
	double tempC=0.0;
	double tempF=0.0;
	double tempK=0.0;
	double totTemp=0.0;
	double gir=0.0;

sel:
	cout << "Please select input temp type (F, C, K): ";
	cin >> type;

	switch (type)
	{
	case 'F':
			goto fah;
			break;
	case 'f':
			goto fah;
			break;
	case 'C':
			goto cel;
			break;
	case 'c':
			goto cel;
			break;
	case 'K':
			goto kel;
			break;
			
	case 'k':
			goto kel;
			break;
	default:
			cout << "Invalid input type." <<endl;
			goto sel;
			break;
	}

fah:
	cout << "Please enter temp: ";
	cin >> tempF;

	tempC=((5/9)*(tempF-32));
	tempK=(tempC+273.15);
	totTemp=(tempC+tempF+tempK);
	gir=((totTemp/3)*(89875517900000000));
	goto end;

cel:
	cout << "Please enter temp: ";
	cin >> tempC;

	tempF=(((9/5)*tempC)+32);
	tempK=(tempC+273.15);
	totTemp=(tempC+tempF+tempK);
	gir=((totTemp/3)*(89875517900000000));

	goto end;

kel:
	cout << "Please enter temp: ";
	cin >> tempK;
	
	tempC=(tempK-273.15);
	tempF=(((9/5)*tempC)+32);
	totTemp=(tempC+tempF+tempK);
	gir=((totTemp/3)*(89875517900000000));

	goto end;

end:
	cout <<endl;
	cout << "Girs= " << gir <<endl<<endl;

return(0);
}
@other peeps, I don't wanna hear any comments about using goto statements, it works fine


Not gonna complain you finished before i did.
__________________
Electrical Engineering and Computer Science Student (Joint Bsc Hons)
STUDENT FINANCE HURRY UP!!!

Has far to many components for a 20 year old, and while you're at it forgive my spelling, the keyboard is dyslexic

Quote:
Originally Posted by Tator Tot View Post
Ah the dickery.

Sadly enough, I don't like being a dick in game. It's much more fun flaunting your junk IRL.

System: 24/7 rig, now with less powah than the bench
CPU
W3540
Motherboard
Evga X58 LE
Memory
3x2GB OCZ Golds
Graphics Card
Evga GTX295
Hard Drive
Perc 5i; 4 WDC3200AAKS's Raid 5, 1TB Caviar Green
Sound Card
Asus Xonar D2X
Power Supply
1000W Thermaltake modular
Case
Lian Li PC-A71
CPU cooling
EK-Supreme/BIX420
GPU cooling
EK full cover
OS
Windows 7 Pro - Retail MSDN-AA
Monitor
20.1" LG
Starbuck5000 is offline   Reply With Quote
Old 2 Weeks Ago   #14 (permalink)
4.0 GHz
 
meticadpa's Avatar
 
intel nvidia

Join Date: Dec 2008
Location: Ghettoshiels in Scotland
Posts: 4,986

Rep: 703 meticadpa is becoming famousmeticadpa is becoming famousmeticadpa is becoming famousmeticadpa is becoming famousmeticadpa is becoming famousmeticadpa is becoming famousmeticadpa is becoming famous
Unique Rep: 503
Trader Rating: 11
Default

Ah, so much win.

Thanks for you sir. +

I'm not even sure how to use it, but thanks. >.<

meticadpa is a programming noob.
__________________
Quote:
Originally Posted by TnB= Gir View Post
You and I are lesbian lovers that met up on OCN, determined not to be foiled by the grandiose breadth of the Atlantic Ocean.

Let's go with that.
The more you love music, the more music you love. ~aaronman
Quote:
Originally Posted by Syrillian View Post
Uber-high sperm-count that delivers like a lawn-sprinkler?

System: Technical Difficulties
CPU
E8500 E0 4.5GHz 1.31V
Motherboard
Asus Maximus Formula X38 (w/ RF 0803 BIOS)
Memory
4GB OCZ Blades
Graphics Card
EVGA 8800GT Akimbo
Hard Drive
WD 500GB AAKS
Sound Card
X-FI Xtreme Music (Youp Pax Drivers)
Power Supply
CoolerMaster Xtreme 650W 36A/432W on the 12V rail
Case
None.
CPU cooling
Thermalright Ultra 120a | Lapped & Washer mod |
GPU cooling
EVGA Akimbo cooler
OS
Windows Seven x64
Monitor
32" TV 1360 x 768
meticadpa is offline   Reply With Quote
Old 2 Weeks Ago   #15 (permalink)
4.0 GHz
 
31337's Avatar
 
intel nvidia

Join Date: Aug 2007
Location: The darkness of your mind
Posts: 785

Rep: 49 31337 is acknowledged by some
Unique Rep: 46
Trader Rating: 4
Default

Quote:
Originally Posted by Starbuck5000 View Post


Not gonna complain you finished before i did.
LOL, all that matters is that it works!

System: Obelisk
CPU
E8600
Motherboard
ASUS Rampage Formula X48
Memory
2x2GB G.Skill DDR2-1000
Graphics Card
EVGA 9800GTX+
Hard Drive
PERC5: 2x160GBVelociRaptors(RAID0) 2xWD500GB(RAID0
Sound Card
X-Fi Xtreme Music
Power Supply
Corsair 750TX
Case
Thermaltake Armor
CPU cooling
TRUE Black 120 (2x Ultra Kaze 3000)
GPU cooling
Stock
OS
Windows 7 Ultimate RTM x64
Monitor
Samsung 2253BW
31337 is offline   Reply With Quote
Old 2 Weeks Ago   #16 (permalink)
Mobo Master
 
Starbuck5000's Avatar
 
intel nvidia

Join Date: May 2008
Location: England
Posts: 1,034

Rep: 71 Starbuck5000 is acknowledged by some
Unique Rep: 64
Trader Rating: 4
Default

Quote:
Originally Posted by 31337 View Post
LOL, all that matters is that it works!
Well this is mine(in C#). Takes any value in Degrees C and give it in Girs

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

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            string DegreesCString;
            double DegreesC, failedInput, DegreesF, DegreesK, DegreesGir, tottemp;

            failedInput = 0;

            do
            {
            Console.WriteLine("Please enter tempurature in Degrees C");
            DegreesCString = Console.ReadLine();


                try
                {
                    DegreesC = Convert.ToDouble(DegreesCString);
                    failedInput = 0;
                }
                catch
                {
                    Console.WriteLine("Not a valid input. Try again");
                    failedInput = 1;
                    DegreesC = 0;
                }
            } while (failedInput == 1);
          
            DegreesF = (((DegreesC * 9)/5) + 32);
            DegreesK = (DegreesC + 273.15);

            tottemp = ((DegreesC + DegreesF + DegreesK) / 3);
            DegreesGir = (tottemp * 89875517900000000);

            Console.WriteLine(" {0} Degrees C equals {1}Girs", DegreesC, DegreesGir);
            Console.WriteLine("Press any key when Finished");
            Console.ReadLine();
        }
    }
}
EDIT: Code updated, it always gave 5 as the output
__________________
Electrical Engineering and Computer Science Student (Joint Bsc Hons)
STUDENT FINANCE HURRY UP!!!

Has far to many components for a 20 year old, and while you're at it forgive my spelling, the keyboard is dyslexic

Quote:
Originally Posted by Tator Tot View Post
Ah the dickery.

Sadly enough, I don't like being a dick in game. It's much more fun flaunting your junk IRL.

System: 24/7 rig, now with less powah than the bench
CPU
W3540
Motherboard
Evga X58 LE
Memory
3x2GB OCZ Golds
Graphics Card
Evga GTX295
Hard Drive
Perc 5i; 4 WDC3200AAKS's Raid 5, 1TB Caviar Green
Sound Card
Asus Xonar D2X
Power Supply
1000W Thermaltake modular
Case
Lian Li PC-A71
CPU cooling
EK-Supreme/BIX420
GPU cooling
EK full cover
OS
Windows 7 Pro - Retail MSDN-AA
Monitor
20.1" LG

Last edited by Starbuck5000 : 2 Weeks Ago at 11:45 AM
Starbuck5000 is offline   Reply With Quote
Old 2 Weeks Ago   #17 (permalink)
4.0 GHz
 
31337's Avatar
 
intel nvidia

Join Date: Aug 2007
Location: The darkness of your mind
Posts: 785

Rep: 49 31337 is acknowledged by some
Unique Rep: 46
Trader Rating: 4
Default

Yeah, yours definitely looks more elegant (even though I don't know any C# lol)

Cleaned mine up a bit:

Code:
#include <iostream>
#include <cctype>
using namespace std;

int main()
{
	char type=' ';
	double tempC=0.0;
	double tempF=0.0;
	double tempK=0.0;
	double totTemp=0.0;
	double gir=0.0;

	cout << "Please select input temp type (F, C, K): ";
	cin >> type;

	type=static_cast<char>(toupper(type));

	if(type=='F')
	{
		cout << "Please enter temp: ";
		cin >> tempF;

		tempC=((5/9)*(tempF-32));
		tempK=(tempC+273.15);
		totTemp=(tempC+tempF+tempK);
		gir=((totTemp/3)*(89875517900000000));
	}
	else if(type=='C')
	{
		cout << "Please enter temp: ";
		cin >> tempC;

		tempF=(((9/5)*tempC)+32);
		tempK=(tempC+273.15);
		totTemp=(tempC+tempF+tempK);
		gir=((totTemp/3)*(89875517900000000));
	}
	else if(type=='K')
	{
		cout << "Please enter temp: ";
		cin >> tempK;
		
		tempC=(tempK-273.15);
		tempF=(((9/5)*tempC)+32);
		totTemp=(tempC+tempF+tempK);
		gir=((totTemp/3)*(89875517900000000));
	}
	else
		cout << "Invalid Input type." <<endl;

	cout <<endl;
	cout << "Girs= " << gir <<endl<<endl;

return(0);
}

System: Obelisk
CPU
E8600
Motherboard
ASUS Rampage Formula X48
Memory
2x2GB G.Skill DDR2-1000
Graphics Card
EVGA 9800GTX+
Hard Drive
PERC5: 2x160GBVelociRaptors(RAID0) 2xWD500GB(RAID0
Sound Card
X-Fi Xtreme Music
Power Supply
Corsair 750TX
Case
Thermaltake Armor
CPU cooling
TRUE Black 120 (2x Ultra Kaze 3000)
GPU cooling
Stock
OS
Windows 7 Ultimate RTM x64
Monitor
Samsung 2253BW

Last edited by 31337 : 2 Weeks Ago at 11:55 AM
31337 is offline   Reply With Quote
Old 2 Weeks Ago   #18 (permalink)
AMD Overclocker
 
MadCatMk2's Avatar
 
intel nvidia

Join Date: May 2006
Location: Greece
Posts: 1,968

Rep: 201 MadCatMk2 is acknowledged by manyMadCatMk2 is acknowledged by manyMadCatMk2 is acknowledged by many
Unique Rep: 158
Folding Team Rank: 202
Trader Rating: 0
Default

cLISP.
Code:
(defun cg (X)
  "Convert Celcius to Girs."
  (* (/ (+ (* (/ 9 5) (+ X 32)) X (+ X 273.15)) 3) 89875517900000000))
Converts Celsius to Girs.

Get it here.
Run and type
Code:
(load "cg")
(cg value)
*Replace value with any number.

System: Turtle.
CPU
E8500 @ 3.58 - 1.12v
Motherboard
Penryn1600SLI (650i)
Memory
4 GB
Graphics Card
8800GT
Hard Drive
Loud, slow, noisy.
Power Supply
PCP&C Silencer 750W
Case
Coolermaster HAF932
CPU cooling
Xigmatek HDT-S963
GPU cooling
Stock
OS
Binblows 7 (SUCKS)
Monitor
4612 FA (IPS Panel)
Overclock.net - 2009 Chimp Challenge Champions 1 Million+ Folding at Home points

Last edited by MadCatMk2 : 2 Weeks Ago at 12:39 PM
MadCatMk2 is offline I fold for Overclock.net   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -5. The time now is 04:02 AM.


Overclock.net is a Carbon Neutral Site Creative Commons License

Terms of Service / Forum Rules | Privacy Policy | DMCA Info | Advertising | Become an Official Vendor
Copyright © 2009 Shogun Interactive Development. Most rights reserved.
Page generated in 0.11816 seconds with 8 queries