Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.32 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4.  
  5. int Yardcon(int sts) {
  6.     return 220 * sts;
  7. }
  8.  
  9.  
  10. int agegate(int sts) {
  11.     return 365 * sts;
  12. }
  13.  
  14.  
  15. double to_lightyears(double sts) {
  16.     return 63240 * sts;
  17. }
  18.  
  19.  
  20. int main() {
  21.     int furlongs = 0;
  22.     int years = 0;
  23.     int yards = 0;
  24.     int days = 0;
  25.     double lightyears = 0.0;
  26.  
  27.     std::cout << "User Data:" << std::endl;
  28.     std::cout << " John Smith" << std::endl;
  29.     std::cout << " JJSMYT@hotmai.com" << std::endl;
  30.     std::cout << " " << std::endl;
  31.  
  32.     std::cout << "Please enter distance in furlongs: ";
  33.     std::cin >> furlongs;
  34.  
  35.     yards = Yardcon(furlongs);
  36.     std::cout << furlongs << " furlongs = ";
  37.     std::cout << yards << " yards." << std::endl;
  38.  
  39.     std::cout << "How old are you?: ";
  40.     std::cin >> years;
  41.  
  42.     days = agegate(years);
  43.     std::cout << years << " years means you have been alive for! = ";
  44.     std::cout << days << " Days!" << std::endl;
  45.  
  46.     std::cout << "Enter the distance between our Milky Way galaxy and the Andromeda galaxy in light years: ";
  47.     std::cin >> lightyears;
  48.     std::cout << " " << std::endl;
  49.     lightyears = to_lightyears(lightyears);
  50.  
  51.     std::cout << "thats the equivalent of " << lightyears <<" astronomical units!" << std::endl;
  52.     std::cout << "How fascinating!" << std::endl;
  53.  
  54.     return 0;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement