Computer Science | Artificial Intelligence | Computational Biology | Chess | Blender
#include <iostream> int main() { std::string car = "Toyota"; std::string model = "Corolla"; int year = 2020; double price = 20000.00; bool buyer = false; std::string carChoice = " "; while (buyer == false) { std::cout << "Which car do you like? "; std::getline(std::cin, carChoice); if (carChoice == car) { std::cout << "You bought a " << car << " " << model; std::cout << " for $" << price << std::endl; buyer = true; } else { std::cout << "Sorry, we don't have << carChoice << "." << std::endl; } buyer = true; } return 0; }