Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. // Get the cost of soil.
  7. std::string Soil;
  8. std::cout << "What does the soil cost? " <<std::endl;
  9. std::cin >> Soil;
  10.  
  11. // Get the cost of flower seeds.
  12. std::string Flower;
  13. std::cout << "What do the flower seeds cost? " <<std::endl;
  14. std::cin >> Flower;
  15.  
  16. // Get the cost of the fence.
  17. std::string Fence;
  18. std::cout << "What does the fence cost? " <<std::endl;
  19. std::cin >> Fence;
  20.  
  21. // Calculate the total cost.
  22. std::string total;
  23. std::cout total = Soil + Flower + Fence;
  24.  
  25. // Display the total cost
  26. std::cout << "The total cost is $" << total;
  27. std::cout << "." << std::endl;
  28.  
  29. return 0;
  30. }
  31.  
  32. int main()
  33. {
  34. // Get the cost of soil.
  35. double Soil;
  36. std::cout << "What does the soil cost? " <<std::endl;
  37. std::cin >> Soil;
  38.  
  39. // Get the cost of flower seeds.
  40. double Flower;
  41. std::cout << "What do the flower seeds cost? " <<std::endl;
  42. std::cin >> Flower;
  43.  
  44. // Get the cost of the fence.
  45. double Fence;
  46. std::cout << "What does the fence cost? " <<std::endl;
  47. std::cin >> Fence;
  48.  
  49. // Calculate the total cost.
  50. double total =Soil + Flower + Fence;
  51.  
  52. // Display the total cost
  53. std::cout << "The total cost is $" << total;
  54. std::cout << "." << std::endl;
  55.  
  56. return 0;
  57. }
  58.  
  59. #include <iostream>
  60. using namespace std;
  61.  
  62. int main()
  63. {
  64. int soil, flower, fence, total;
  65.  
  66. // Get the cost of soil.
  67. std::cout << "What does the soil cost? " <<std::endl;
  68. std::cin >> soil;
  69.  
  70. // Get the cost of flower seeds.
  71. std::cout << "What do the flower seeds cost? " <<std::endl;
  72. std::cin >> flower;
  73.  
  74. // Get the cost of the fence.
  75. std::cout << "What does the fence cost? " <<std::endl;
  76. std::cin >> fence;
  77.  
  78. // Calculate the total cost.
  79. total = Soil + Flower + Fence;
  80.  
  81. // Display the total cost
  82. std::cout << "The total cost is $" << total;
  83. std::cout << "." << std::endl;
  84.  
  85. return 0;
  86.  
  87. std::string Soil;
  88. [...]
  89. std::string Flower;
  90. [...]
  91. std::string Fence;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement