Craft Multilingual Greeting Messages

C++C++Beginner
Practice Now

Introduction

In this challenge, as a junior developer at a global tech startup, you'll create a multilingual greeting program to demonstrate basic C++ programming skills and internationalization concepts. The goal is to develop a C++ program that prints greetings in at least three different languages, using std::cout to output each greeting on a separate line, and adding comments to explain each greeting. The program must compile and run successfully using the g++ compiler.


Skills Graph

%%%%{init: {'theme':'neutral'}}%%%% flowchart RL cpp(("C++")) -.-> cpp/BasicsGroup(["Basics"]) cpp(("C++")) -.-> cpp/IOandFileHandlingGroup(["I/O and File Handling"]) cpp(("C++")) -.-> cpp/SyntaxandStyleGroup(["Syntax and Style"]) cpp/BasicsGroup -.-> cpp/strings("Strings") cpp/IOandFileHandlingGroup -.-> cpp/output("Output") cpp/SyntaxandStyleGroup -.-> cpp/comments("Comments") subgraph Lab Skills cpp/strings -.-> lab-446094{{"Craft Multilingual Greeting Messages"}} cpp/output -.-> lab-446094{{"Craft Multilingual Greeting Messages"}} cpp/comments -.-> lab-446094{{"Craft Multilingual Greeting Messages"}} end

Craft Multilingual Greeting Messages

As a junior developer at a global tech startup, you'll create a multilingual greeting program to demonstrate basic C++ programming skills and internationalization concepts.

Tasks

  • Create a C++ program that prints greetings in at least three different languages
  • Use std::cout to output each greeting on a separate line
  • Add a single-line or multi-line comment explaining each greeting
  • Ensure the program compiles and runs successfully

Requirements

  • Use the file ~/project/greetings.cpp for your solution
  • Include the <iostream> header
  • Use std::cout for printing
  • Add at least one comment for each greeting
  • Use the g++ compiler to compile the program
  • Ensure the program runs without errors

Examples

$ g++ greetings.cpp -o greetings
$ ./greetings

Example output:

Hello, World! (English)
Bonjour, le monde! (French)
Hola, Mundo! (Spanish)

Hints

  • Remember to include the <iostream> header
  • Use std::cout with << to print messages
  • Add comments using // for single-line or /* */ for multi-line
  • Don't forget the semicolons at the end of each statement
  • Use std::endl or \n to create new lines
โœจ Check Solution and Practice

Summary

In summary, this challenge requires you to create a C++ program that prints greetings in at least three different languages, using std::cout to output each greeting on a separate line and adding comments to explain each greeting. The program must compile and run successfully using the g++ compiler, demonstrating your basic C++ programming skills and understanding of internationalization concepts.