Unknown model· unknown
from ShareGPT 90K (shared ChatGPT conversations)
Write me a c++ script implementing the Tortellini's recipe
- User
Write me a c++ script implementing the Tortellini's recipe
- Assistant
Sure, here's a C++ script that implements the Tortellini's recipe:
c#include <iostream> #include <string> using namespace std; int main() { // Prompt user for number of servings int servings; cout << "Enter the number of servings you want to make: "; cin >> servings; // Calculate the amount of ingredients needed based on the number of servings const float flour_per_serving = 100.0 / 4; // 100g of flour per 4 servings const float eggs_per_serving = 1.0 / 4; // 1 egg per 4 servings const float salt_per_serving = 2.5 / 4; // 2.5g of salt per 4 servings const float ham_per_serving = 50.0 / 4; // 50g of ham per 4 servings const float cheese_per_serving = 50.0 / 4; // 50g of cheese per 4 servings const float flour = servings * flour_per_serving; const float eggs = servings * eggs_per_serving; const float salt = servings * salt_per_serving; const float ham = servings * ham_per_serving; const float cheese = servings * cheese_per_serving; // Display the ingredients and their amounts needed cout << endl << "Tortellini Recipe for " << servings << " servings:" << endl; cout << "- " << flour << "g of flour" << endl; cout << "- " << eggs << " eggs" << endl; cout << "- " << salt << "g of salt" << endl; cout << "- " << ham << "g of ham" << endl; cout << "- " << cheese << "g of cheese" << endl; // Prompt user to continue with the recipe string response; cout << endl << "Press enter to continue with the recipe..." << endl; getline(cin, response); // Start making the dough cout << endl << "To make the dough:" << endl; cout << "1. In a large mixing bowl, combine " << flour << "g of flour and " << eggs << " eggs." << endl; cout << "2. Mix the ingredients together until a dough forms." << endl; cout << "3. Knead the dough for 10-15 minutes until it becomes smooth and elastic." << endl; // Prompt user to continue with the recipe cout << endl << "Press enter to continue with the recipe..." << endl; getline(cin, response); // Prepare the filling cout << endl << "To prepare the filling:" << endl; cout << "1. Finely chop " << ham << "g of ham and " << cheese << "g of cheese." << endl; cout << "2. Mix the ham and cheese together in a bowl." << endl; // Prompt user to continue with the recipe cout << endl << "Press enter to continue with the recipe..." << endl; getline(cin, response); // Shape the tortellini cout << endl << "To shape the tortellini:" << endl; cout << "1. Roll out the dough until it is thin and smooth." << endl; cout << "2. Cut the dough into small squares." << endl; cout << "3. Place a small amount of the filling in the center of each square." << endl; cout << "4. Fold the square into a triangle and press the edges together to seal the filling - User
Please rewrite it using a struct for storing quantities for a single person
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.