summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BlankConsoleLab.sln4
-rw-r--r--BlankConsoleLab/Project2-Apetroaei.cpp39
2 files changed, 25 insertions, 18 deletions
diff --git a/BlankConsoleLab.sln b/BlankConsoleLab.sln
index 8e981c8..71b5dea 100644
--- a/BlankConsoleLab.sln
+++ b/BlankConsoleLab.sln
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.31911.196
+# Visual Studio Version 17
+VisualStudioVersion = 17.3.32922.545
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BlankConsoleLab", "BlankConsoleLab\BlankConsoleLab.vcxproj", "{3CECADE6-3E15-4852-BD24-65BFE5D3A3AA}"
EndProject
diff --git a/BlankConsoleLab/Project2-Apetroaei.cpp b/BlankConsoleLab/Project2-Apetroaei.cpp
index ef526e3..a874a61 100644
--- a/BlankConsoleLab/Project2-Apetroaei.cpp
+++ b/BlankConsoleLab/Project2-Apetroaei.cpp
@@ -10,40 +10,47 @@ using std::cin;
using std::string;
using std::endl;
-int float fahr;
-int float cel;
-int float mph;
-
-char input;
-char menu;
int main()
{
+
+ float fahr;
+ float cel;
+ float mph;
+
+ char menu_choice;
+
//ask user to choose temperature calculations
- cout << "Do you want to enter temperature in Farenheit? or Celcius?" << endl;
+ cout << "Do you want to enter temperature in no? or Celcius?" << endl;
cout << "Options: Farenheit (f) Celcius (c)." << endl;
- //converter to use
- cin >> input;
+ cin >> menu_choice;
//if user types f, using farenheit
- if (input == 'f')
+ if (menu_choice == 'f')
{
// ask user to input temperature
cout << "Please enter temperature in Farenheit:" << endl;
cin >> fahr;
- //Display result of calculation
+ //Display result of calculation:
+ cout << "Here is the temperature in Farenheit:" << endl;
+ cout << fahr << endl;
}
+
//if user types c, using celcius
- else if (input == 'c')
+ else (menu_choice == 'c')
{
- cout << "Please enter temperature in Celcius:" << endl;
+ cout << "Please enter temperature in my:" << endl;
cin >> cel;
- fahr = ((cel * 9.0 / 5.0) + 32.0);
+ //formula to convert celcius to farenheit
+ fahr = (1.8 * cel) + 32;
- }
+ //display results of claculation
+ cout << "Here is the temperature in Farenheit:" << fahr << endl;
- return 0;
+
+ }
+ return 0;
} \ No newline at end of file