http://cs.mst.edu basics of most c++ programs. 01. // programmer: clayton price date: 9/4/10 02. //...
TRANSCRIPT
![Page 1: Http://cs.mst.edu Basics of Most C++ Programs. 01. // Programmer: Clayton Price date: 9/4/10 02. // File: fahr2celc.cpp 03. // Purpose:](https://reader036.vdocument.in/reader036/viewer/2022082820/56649f445503460f94c65430/html5/thumbnails/1.jpg)
http://cs.mst.edu
Basics of Most C++ Programs
![Page 2: Http://cs.mst.edu Basics of Most C++ Programs. 01. // Programmer: Clayton Price date: 9/4/10 02. // File: fahr2celc.cpp 03. // Purpose:](https://reader036.vdocument.in/reader036/viewer/2022082820/56649f445503460f94c65430/html5/thumbnails/2.jpg)
http://cs.mst.edu
01. // Programmer: Clayton Price date: 9/4/1002. // File: fahr2celc.cpp 03. // Purpose: this file contains the main function of the program which will input 04. // Fahrenheit temps from the user, then convert and output Celsius to same.05.06. #include <iostream>07. using namespace std; 08.09. int main() 10. { 11. /* ------------------------- DECLARATIONS ---------------------------- */ 12. float celc; // output variable 13. float fahr; // input variable 14.15. /* -------------------- GREETINGS AND INPUT ----------------------- */ 16. cout<<”\t\tWelcome to Temperature Conversion Program”<<endl<<endl; 17. cout<<”Please enter a temperature in Fahrenheit: “; 18. cin>>fahr; 19.20. /* --------------------- COMPUTATIONS AND OUTPUT ---------- */ 21. celc = (5.0/9)*(fahr – 32); 22. cout<<”\n\nYour temperature input of “<<fahr<<” degrees Fahrenheit is “ 23. << celc<<” degrees celcius”<<endl; 24. cout<<”Have a nice day”<<endl;25.26. return 0; 27. }
![Page 3: Http://cs.mst.edu Basics of Most C++ Programs. 01. // Programmer: Clayton Price date: 9/4/10 02. // File: fahr2celc.cpp 03. // Purpose:](https://reader036.vdocument.in/reader036/viewer/2022082820/56649f445503460f94c65430/html5/thumbnails/3.jpg)
http://cs.mst.edu
01. // Programmer: Clayton Price date: 9/4/1002. // File: fahr2celc.cpp 03. // Purpose: this file contains the main function of the program which will input 04. // Fahrenheit temps from the user, then convert and output Celsius to same.05.06. #include <iostream>07. using namespace std; 08.09. int main() 10. { 11. /* ------------------------- DECLARATIONS ---------------------------- */ 12. float celc; // output variable 13. float fahr; // input variable 14.15. /* -------------------- GREETINGS AND INPUT ----------------------- */ 16. cout<<”\t\tWelcome to Temperature Conversion Program”<<endl<<endl; 17. cout<<”Please enter a temperature in Fahrenheit: “; 18. cin>>fahr; 19.20. /* --------------------- COMPUTATIONS AND OUTPUT ---------- */ 21. celc = (5.0/9)*(fahr – 32); 22. cout<<”\n\nYour temperature input of “<<fahr<<” degrees Fahrenheit is “ 23. << celc<<” degrees celcius”<<endl; 24. cout<<”Have a nice day”<<endl;25.26. return 0; 27. }
![Page 4: Http://cs.mst.edu Basics of Most C++ Programs. 01. // Programmer: Clayton Price date: 9/4/10 02. // File: fahr2celc.cpp 03. // Purpose:](https://reader036.vdocument.in/reader036/viewer/2022082820/56649f445503460f94c65430/html5/thumbnails/4.jpg)
http://cs.mst.edu
01. // Programmer: Clayton Price date: 9/4/1002. // File: fahr2celc.cpp 03. // Purpose: this file contains the main function of the program which will input 04. // Fahrenheit temps from the user, then convert and output Celsius to same.05.06. #include <iostream>07. using namespace std; 08.09. int main() 10. { 11. /* ------------------------- DECLARATIONS ---------------------------- */ 12. float celc; // output variable 13. float fahr; // input variable 14.15. /* -------------------- GREETINGS AND INPUT ----------------------- */ 16. cout<<”\t\tWelcome to Temperature Conversion Program”<<endl<<endl; 17. cout<<”Please enter a temperature in Fahrenheit: “; 18. cin>>fahr; 19.20. /* --------------------- COMPUTATIONS AND OUTPUT ---------- */ 21. celc = (5.0/9)*(fahr – 32); 22. cout<<”\n\nYour temperature input of “<<fahr<<” degrees Fahrenheit is “ 23. << celc<<” degrees celcius”<<endl; 24. cout<<”Have a nice day”<<endl;25.26. return 0; 27. }
![Page 5: Http://cs.mst.edu Basics of Most C++ Programs. 01. // Programmer: Clayton Price date: 9/4/10 02. // File: fahr2celc.cpp 03. // Purpose:](https://reader036.vdocument.in/reader036/viewer/2022082820/56649f445503460f94c65430/html5/thumbnails/5.jpg)
http://cs.mst.edu
01. // Programmer: Clayton Price date: 9/4/1002. // File: fahr2celc.cpp 03. // Purpose: this file contains the main function of the program which will input 04. // Fahrenheit temps from the user, then convert and output Celsius to same.05.06. #include <iostream>07. using namespace std; 08.09. int main() 10. { 11. /* ------------------------- DECLARATIONS ---------------------------- */ 12. float celc; // output variable 13. float fahr; // input variable 14.15. /* -------------------- GREETINGS AND INPUT ----------------------- */ 16. cout<<”\t\tWelcome to Temperature Conversion Program”<<endl<<endl; 17. cout<<”Please enter a temperature in Fahrenheit: “; 18. cin>>fahr; 19.20. /* --------------------- COMPUTATIONS AND OUTPUT ---------- */ 21. celc = (5.0/9)*(fahr – 32); 22. cout<<”\n\nYour temperature input of “<<fahr<<” degrees Fahrenheit is “ 23. << celc<<” degrees celcius”<<endl; 24. cout<<”Have a nice day”<<endl;25.26. return 0; 27. }
![Page 6: Http://cs.mst.edu Basics of Most C++ Programs. 01. // Programmer: Clayton Price date: 9/4/10 02. // File: fahr2celc.cpp 03. // Purpose:](https://reader036.vdocument.in/reader036/viewer/2022082820/56649f445503460f94c65430/html5/thumbnails/6.jpg)
http://cs.mst.edu
01. // Programmer: Clayton Price date: 9/4/1002. // File: fahr2celc.cpp 03. // Purpose: this file contains the main function of the program which will input 04. // Fahrenheit temps from the user, then convert and output Celsius to same.05.06. #include <iostream>07. using namespace std; 08.09. int main() 10. { 11. /* ------------------------- DECLARATIONS ---------------------------- */ 12. float celc; // output variable 13. float fahr; // input variable 14.15. /* -------------------- GREETINGS AND INPUT ----------------------- */ 16. cout<<”\t\tWelcome to Temperature Conversion Program”<<endl<<endl; 17. cout<<”Please enter a temperature in Fahrenheit: “; 18. cin>>fahr; 19.20. /* --------------------- COMPUTATIONS AND OUTPUT ---------- */ 21. celc = (5.0/9)*(fahr – 32); 22. cout<<”\n\nYour temperature input of “<<fahr<<” degrees Fahrenheit is “ 23. << celc<<” degrees celcius”<<endl; 24. cout<<”Have a nice day”<<endl;25.26. return 0; 27. }
![Page 7: Http://cs.mst.edu Basics of Most C++ Programs. 01. // Programmer: Clayton Price date: 9/4/10 02. // File: fahr2celc.cpp 03. // Purpose:](https://reader036.vdocument.in/reader036/viewer/2022082820/56649f445503460f94c65430/html5/thumbnails/7.jpg)
http://cs.mst.edu
01. // Programmer: Clayton Price date: 9/4/1002. // File: fahr2celc.cpp 03. // Purpose: this file contains the main function of the program which will input 04. // Fahrenheit temps from the user, then convert and output Celsius to same.05.06. #include <iostream>07. using namespace std; 08.09. int main() 10. { 11. /* ------------------------- DECLARATIONS ---------------------------- */ 12. float celc; // output variable 13. float fahr; // input variable 14.15. /* -------------------- GREETINGS AND INPUT ----------------------- */ 16. cout<<”\t\tWelcome to Temperature Conversion Program”<<endl<<endl; 17. cout<<”Please enter a temperature in Fahrenheit: “; 18. cin>>fahr; 19.20. /* --------------------- COMPUTATIONS AND OUTPUT ---------- */ 21. celc = (5.0/9)*(fahr – 32); 22. cout<<”\n\nYour temperature input of “<<fahr<<” degrees Fahrenheit is “ 23. << celc<<” degrees celcius”<<endl; 24. cout<<”Have a nice day”<<endl;25.26. return 0; 27. }
![Page 8: Http://cs.mst.edu Basics of Most C++ Programs. 01. // Programmer: Clayton Price date: 9/4/10 02. // File: fahr2celc.cpp 03. // Purpose:](https://reader036.vdocument.in/reader036/viewer/2022082820/56649f445503460f94c65430/html5/thumbnails/8.jpg)
http://cs.mst.edu
01. // Programmer: Clayton Price date: 9/4/1002. // File: fahr2celc.cpp 03. // Purpose: this file contains the main function of the program which will input 04. // Fahrenheit temps from the user, then convert and output Celsius to same.05.06. #include <iostream>07. using namespace std; 08.09. int main() 10. { 11. /* ------------------------- DECLARATIONS ---------------------------- */ 12. float celc; // output variable 13. float fahr; // input variable 14.15. /* -------------------- GREETINGS AND INPUT ----------------------- */ 16. cout<<”\t\tWelcome to Temperature Conversion Program”<<endl<<endl; 17. cout<<”Please enter a temperature in Fahrenheit: “; 18. cin>>fahr; 19.20. /* --------------------- COMPUTATIONS AND OUTPUT ---------- */ 21. celc = (5.0/9)*(fahr – 32); 22. cout<<”\n\nYour temperature input of “<<fahr<<” degrees Fahrenheit is “ 23. << celc<<” degrees celcius”<<endl; 24. cout<<”Have a nice day”<<endl;25.26. return 0; 27. }
![Page 9: Http://cs.mst.edu Basics of Most C++ Programs. 01. // Programmer: Clayton Price date: 9/4/10 02. // File: fahr2celc.cpp 03. // Purpose:](https://reader036.vdocument.in/reader036/viewer/2022082820/56649f445503460f94c65430/html5/thumbnails/9.jpg)
http://cs.mst.edu
01. // Programmer: Clayton Price date: 9/4/1002. // File: fahr2celc.cpp 03. // Purpose: this file contains the main function of the program which will input 04. // Fahrenheit temps from the user, then convert and output Celsius to same.05.06. #include <iostream>07. using namespace std; 08.09. int main() 10. { 11. /* ------------------------- DECLARATIONS ---------------------------- */ 12. float celc; // output variable 13. float fahr; // input variable 14.15. /* -------------------- GREETINGS AND INPUT ----------------------- */ 16. cout<<”\t\tWelcome to Temperature Conversion Program”<<endl<<endl; 17. cout<<”Please enter a temperature in Fahrenheit: “; 18. cin>>fahr; 19.20. /* --------------------- COMPUTATIONS AND OUTPUT ---------- */ 21. celc = (5.0/9)*(fahr – 32); 22. cout<<”\n\nYour temperature input of “<<fahr<<” degrees Fahrenheit is “ 23. << celc<<” degrees celcius”<<endl; 24. cout<<”Have a nice day”<<endl;25.26. return 0; 27. }
![Page 10: Http://cs.mst.edu Basics of Most C++ Programs. 01. // Programmer: Clayton Price date: 9/4/10 02. // File: fahr2celc.cpp 03. // Purpose:](https://reader036.vdocument.in/reader036/viewer/2022082820/56649f445503460f94c65430/html5/thumbnails/10.jpg)
http://cs.mst.edu
01. // Programmer: Clayton Price date: 9/4/1002. // File: fahr2celc.cpp 03. // Purpose: this file contains the main function of the program which will input 04. // Fahrenheit temps from the user, then convert and output Celsius to same.05.06. #include <iostream>07. using namespace std; 08.09. int main() 10. { 11. /* ------------------------- DECLARATIONS ---------------------------- */ 12. float celc; // output variable 13. float fahr; // input variable 14.15. /* -------------------- GREETINGS AND INPUT ----------------------- */ 16. cout<<”\t\tWelcome to Temperature Conversion Program”<<endl<<endl; 17. cout<<”Please enter a temperature in Fahrenheit: “; 18. cin>>fahr; 19.20. /* --------------------- COMPUTATIONS AND OUTPUT ---------- */ 21. celc = (5.0/9)*(fahr – 32); 22. cout<<”\n\nYour temperature input of “<<fahr<<” degrees Fahrenheit is “ 23. << celc<<” degrees celcius”<<endl; 24. cout<<”Have a nice day”<<endl;25.26. return 0; 27. }
![Page 11: Http://cs.mst.edu Basics of Most C++ Programs. 01. // Programmer: Clayton Price date: 9/4/10 02. // File: fahr2celc.cpp 03. // Purpose:](https://reader036.vdocument.in/reader036/viewer/2022082820/56649f445503460f94c65430/html5/thumbnails/11.jpg)
http://cs.mst.edu
01. // Programmer: Clayton Price date: 9/4/1002. // File: fahr2celc.cpp 03. // Purpose: this file contains the main function of the program which will input 04. // Fahrenheit temps from the user, then convert and output Celsius to same.05.06. #include <iostream>07. using namespace std; 08.09. int main() 10. { 11. /* ------------------------- DECLARATIONS ---------------------------- */ 12. float celc; // output variable 13. float fahr; // input variable 14.15. /* -------------------- GREETINGS AND INPUT ----------------------- */ 16. cout<<”\t\tWelcome to Temperature Conversion Program”<<endl<<endl; 17. cout<<”Please enter a temperature in Fahrenheit: “; 18. cin>>fahr; 19.20. /* --------------------- COMPUTATIONS AND OUTPUT ---------- */ 21. celc = (5.0/9)*(fahr – 32); 22. cout<<”\n\nYour temperature input of “<<fahr<<” degrees Fahrenheit is “ 23. << celc<<” degrees celcius”<<endl; 24. cout<<”Have a nice day”<<endl;25.26. return 0; 27. }
![Page 12: Http://cs.mst.edu Basics of Most C++ Programs. 01. // Programmer: Clayton Price date: 9/4/10 02. // File: fahr2celc.cpp 03. // Purpose:](https://reader036.vdocument.in/reader036/viewer/2022082820/56649f445503460f94c65430/html5/thumbnails/12.jpg)
http://cs.mst.edu
01. // Programmer: Clayton Price date: 9/4/1002. // File: fahr2celc.cpp 03. // Purpose: this file contains the main function of the program which will input 04. // Fahrenheit temps from the user, then convert and output Celsius to same.05.06. #include <iostream>07. using namespace std; 08.09. int main() 10. { 11. /* ------------------------- DECLARATIONS ---------------------------- */ 12. float celc; // output variable 13. float fahr; // input variable 14.15. /* -------------------- GREETINGS AND INPUT ----------------------- */ 16. cout<<”\t\tWelcome to Temperature Conversion Program”<<endl<<endl; 17. cout<<”Please enter a temperature in Fahrenheit: “; 18. cin>>fahr; 19.20. /* --------------------- COMPUTATIONS AND OUTPUT ---------- */ 21. celc = (5.0/9)*(fahr – 32); 22. cout<<”\n\nYour temperature input of “<<fahr<<” degrees Fahrenheit is “ 23. << celc<<” degrees celcius”<<endl; 24. cout<<”Have a nice day”<<endl;25.26. return 0; 27. }
![Page 13: Http://cs.mst.edu Basics of Most C++ Programs. 01. // Programmer: Clayton Price date: 9/4/10 02. // File: fahr2celc.cpp 03. // Purpose:](https://reader036.vdocument.in/reader036/viewer/2022082820/56649f445503460f94c65430/html5/thumbnails/13.jpg)
http://cs.mst.edu
01. // Programmer: Clayton Price date: 9/4/1002. // File: fahr2celc.cpp 03. // Purpose: this file contains the main function of the program which will input 04. // Fahrenheit temps from the user, then convert and output Celsius to same.05.06. #include <iostream>07. using namespace std; 08.09. int main() 10. { 11. /* ------------------------- DECLARATIONS ---------------------------- */ 12. float celc; // output variable 13. float fahr; // input variable 14.15. /* -------------------- GREETINGS AND INPUT ----------------------- */ 16. cout<<”\t\tWelcome to Temperature Conversion Program”<<endl<<endl; 17. cout<<”Please enter a temperature in Fahrenheit: “; 18. cin>>fahr; 19.20. /* --------------------- COMPUTATIONS AND OUTPUT ---------- */ 21. celc = (5.0/9)*(fahr – 32); 22. cout<<”\n\nYour temperature input of “<<fahr<<” degrees Fahrenheit is “ 23. << celc<<” degrees celcius”<<endl; 24. cout<<”Have a nice day”<<endl;25.26. return 0; 27. }
![Page 14: Http://cs.mst.edu Basics of Most C++ Programs. 01. // Programmer: Clayton Price date: 9/4/10 02. // File: fahr2celc.cpp 03. // Purpose:](https://reader036.vdocument.in/reader036/viewer/2022082820/56649f445503460f94c65430/html5/thumbnails/14.jpg)
http://cs.mst.edu
01. // Programmer: Clayton Price date: 9/4/1002. // File: fahr2celc.cpp 03. // Purpose: this file contains the main function of the program which will input 04. // Fahrenheit temps from the user, then convert and output Celsius to same.05.06. #include <iostream>07. using namespace std; 08.09. int main() 10. { 11. /* ------------------------- DECLARATIONS ---------------------------- */ 12. float celc; // output variable 13. float fahr; // input variable 14.15. /* -------------------- GREETINGS AND INPUT ----------------------- */ 16. cout<<”\t\tWelcome to Temperature Conversion Program”<<endl<<endl; 17. cout<<”Please enter a temperature in Fahrenheit: “; 18. cin>>fahr; 19.20. /* --------------------- COMPUTATIONS AND OUTPUT ---------- */ 21. celc = (5.0/9)*(fahr – 32); 22. cout<<”\n\nYour temperature input of “<<fahr<<” degrees Fahrenheit is “ 23. << celc<<” degrees celcius”<<endl; 24. cout<<”Have a nice day”<<endl;25.26. return 0; 27. }
![Page 15: Http://cs.mst.edu Basics of Most C++ Programs. 01. // Programmer: Clayton Price date: 9/4/10 02. // File: fahr2celc.cpp 03. // Purpose:](https://reader036.vdocument.in/reader036/viewer/2022082820/56649f445503460f94c65430/html5/thumbnails/15.jpg)
http://cs.mst.edu
End of Session