Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- // Get the cost of soil.
- std::string Soil;
- std::cout << "What does the soil cost? " <<std::endl;
- std::cin >> Soil;
- // Get the cost of flower seeds.
- std::string Flower;
- std::cout << "What do the flower seeds cost? " <<std::endl;
- std::cin >> Flower;
- // Get the cost of the fence.
- std::string Fence;
- std::cout << "What does the fence cost? " <<std::endl;
- std::cin >> Fence;
- // Calculate the total cost.
- std::string total;
- std::cout total = Soil + Flower + Fence;
- // Display the total cost
- std::cout << "The total cost is $" << total;
- std::cout << "." << std::endl;
- return 0;
- }
- int main()
- {
- // Get the cost of soil.
- double Soil;
- std::cout << "What does the soil cost? " <<std::endl;
- std::cin >> Soil;
- // Get the cost of flower seeds.
- double Flower;
- std::cout << "What do the flower seeds cost? " <<std::endl;
- std::cin >> Flower;
- // Get the cost of the fence.
- double Fence;
- std::cout << "What does the fence cost? " <<std::endl;
- std::cin >> Fence;
- // Calculate the total cost.
- double total =Soil + Flower + Fence;
- // Display the total cost
- std::cout << "The total cost is $" << total;
- std::cout << "." << std::endl;
- return 0;
- }
- #include <iostream>
- using namespace std;
- int main()
- {
- int soil, flower, fence, total;
- // Get the cost of soil.
- std::cout << "What does the soil cost? " <<std::endl;
- std::cin >> soil;
- // Get the cost of flower seeds.
- std::cout << "What do the flower seeds cost? " <<std::endl;
- std::cin >> flower;
- // Get the cost of the fence.
- std::cout << "What does the fence cost? " <<std::endl;
- std::cin >> fence;
- // Calculate the total cost.
- total = Soil + Flower + Fence;
- // Display the total cost
- std::cout << "The total cost is $" << total;
- std::cout << "." << std::endl;
- return 0;
- std::string Soil;
- [...]
- std::string Flower;
- [...]
- std::string Fence;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement