+ 2

Check my code's and improve it

coding for you to show talent

11th Nov 2016, 9:26 AM
shripad kulkarni
shripad kulkarni - avatar
11 Respostas
+ 4
Can you maybe send the url of your codes? On PC it's very difficult (almost impossible) to find codes from a specific person...
11th Nov 2016, 9:32 AM
Fronz-Tec
Fronz-Tec - avatar
+ 3
On PC you can't see the codes on the profile of the others....... Just the XP, Badges, Courses and Certificates.
11th Nov 2016, 10:39 AM
Fronz-Tec
Fronz-Tec - avatar
+ 3
/*Temperature conversion */ #include <iostream> using namespace std; int main() { int from , to; float value; string input_unit, output_unit= ""; string UnitString(int value); cout<<"Temperature Conversion\n"; cout<<"\nEnter no of Unit to covert from : \n 1. Celsius\n 2. Farenheit\n 3. Kelvin\n"; cin>>from; input_unit = UnitString(from); cout<<"\nEnter no of Unit to covert to : \n 1. Celius\n 2. Farenheit\n 3. Kelvin\n"; cin>>to; output_unit = UnitString(to); cout<<"\nEnter The value to convert: "; cin>>value; cout << "You entered the value " << value << " in " << input_unit <<".\n"; /*converting given value from specified unit to Kelvin*/ switch(from) { case 1: value= value + 273.15; break; case 2: value= (value+459.67)*5/9; break; case 3: break; default: break; } /*converting value from Kelvin to specified unit*/ switch(to) { case 1: value= value-273.15; break; case 2: value= value*9/5-459.67; break; case 3: break; default: break; } cout<<"Converted Value is "<< value << " in " << output_unit << " .\n"; } string UnitString(int value){ string unit= ""; switch(value) { case 1: unit = "Celsius"; break; case 2: unit = "Farenheit"; break; case 3: unit= "Kelvin"; break; default: unit = "Unit not valid.\n"; break;} return unit; } As @Fronz-Tec said, it was really difficult to find your question via pc. I made some little changes to you code and added a function, just to get a better output from the program. The logic you create seems to work as it should be (I tested it with a few input values). Other changes that can be done may be some checks on input values. I hope it can be useful in some way :) (if there is a better way to share code make me know, since I can't find it..)
12th Nov 2016, 1:04 PM
Silvia
Silvia  - avatar
+ 2
go into my profile you can copy it directly just improve and paste in below the question
11th Nov 2016, 9:39 AM
shripad kulkarni
shripad kulkarni - avatar
+ 2
ok I will trying to send url
11th Nov 2016, 10:38 AM
shripad kulkarni
shripad kulkarni - avatar
+ 2
Glad you liked it :)
12th Nov 2016, 1:46 PM
Silvia
Silvia  - avatar
+ 2
if you have any other code for share..u can @silvia
12th Nov 2016, 1:50 PM
shripad kulkarni
shripad kulkarni - avatar
+ 1
@Fronz-Tec if u have on fb can u send me your username...or email
11th Nov 2016, 11:10 AM
shripad kulkarni
shripad kulkarni - avatar
+ 1
@silvia you done Great job
12th Nov 2016, 1:20 PM
shripad kulkarni
shripad kulkarni - avatar
0
good job @silvia
20th Nov 2016, 10:54 PM
____Yng___ ____MúsLîñ___
____Yng___ ____MúsLîñ___ - avatar
0
@Yash Hi! @___Yng___ Thank you :)
21st Nov 2016, 12:22 AM
Silvia
Silvia  - avatar