1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Pachacha [2.7K]
3 years ago
9

The Boolean Foundation hosted a raffle to raise money for charity and used a computer program to notify the participants about t

he results. Unfortunately, the program they used was not very robust and all 250 participants received an email telling them that they won... and that their name is Shauna.
Improve this program by writing a function called sendEmail to print a personalized email to stdout. The function should take three parameters:
The name of the recipient
The prize for the raffle
Whether or not the recipient won
Use the email template from the existing program.
#include
using namespace std;
int main() {
cout << "Dear Shauna," << endl;
cout << "You are the winner of our raffle for charity." << endl;
cout << "The prize was: a stuffed giraffe toy" << endl;
cout << "Thank you for giving to charity!" << endl;
cout << "Sincerely," << endl;
cout << "The Boolean Foundation" << endl;
return 0;
}
Computers and Technology
1 answer:
irinina [24]3 years ago
6 0

Answer:

The function is as follows:

void sendEmail(string name, string prize, string win_lose){

cout << "Dear "<<name<<", " << endl;

cout << "You are the "<<win_lose<<" of our raffle for charity." << endl;

cout << "The prize was: "<<prize<< endl;

cout << "Thank you for giving to charity!" << endl;

cout << "Sincerely," << endl;

cout << "The Boolean Foundation" << endl;

}

Explanation:

This defines the function along the three parameters

void sendEmail(string name, string prize, string win_lose){

This prints the salutation with the person's name

cout << "Dear "<<name<<", " << endl;

This prints if the person won or lost

cout << "You are the "<<win_lose<<" of our raffle for charity." << endl;

This prints the prize, if any

cout << "The prize was: "<<prize<< endl;

The following is the closing remark

<em>cout << "Thank you for giving to charity!" << endl;</em>

<em>cout << "Sincerely," << endl;</em>

<em>cout << "The Boolean Foundation" << endl;</em>

<em>}</em>

You might be interested in
What was the first portable computer called and who made it?
jekas [21]
It was the Osborne 1 made by Adam Osborne in 1981.
6 0
3 years ago
What will you better be prepared for by learning about the animals you photograph
krek1111 [17]

D. All of the above.

Makes the most sense! :3

6 0
3 years ago
Who can help me on my school we will to google meet and i share my screen
Deffense [45]
Me ......................
7 0
3 years ago
Which statement is false? Select one: a. A class is to an object as a blueprint is to a house. b. Classes are reusable software
kow [346]

Answer:

A class is an instance of its object

Explanation:

6 0
3 years ago
Sorting Records in a Form
Naya [18.7K]

Answer:

1. Open the form in the standard form view.

2. Put the cursor in the field to use for sorting.

3. Open the Home tab

4. In the Sort & Filter group, click ascending or descending

Explanation:

Took the test :)

7 0
3 years ago
Other questions:
  • Each organization that provides host services on the public Internet is responsible for providing and maintaining DNS authoritat
    7·1 answer
  • If you want the date in your document to update each time the document is opened, _____.
    9·2 answers
  • Does anyone have any social media message me
    14·1 answer
  • Study and compare the tables and draw conclusions.
    13·1 answer
  • What is the fastest way to locate a record for updating?
    6·1 answer
  • Write a program with total change amount as an integer input, and output the change using the fewest coins, one coin type per li
    11·1 answer
  • What dd command would you use to copy the contents of a partition named /dev/drive1 to another partition, called /dev/backup?
    6·1 answer
  • What is the long tube on a microscope called​
    15·1 answer
  • I came here for a answer so why did i get a pep talk
    7·2 answers
  • Why are pirated software considered a threat?​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!