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
Finish the statement below to correctly describe the Defense Enrollment Eligibility Reporting System (DEERS). DEERS is a central
WITCHER [35]

Answer:  A- the antlers and horns are structural adaptations. The fighting is a behavioral adaptation.

Antlers and horns are physical adaptations that some mammals have acquired over time. However, fighting is not a physical feature but a behavioral adaptation used to beat other males during mating season.

Explanation:

5 0
3 years ago
Heelo how do u do python syntax lesson 11 on code academy
pochemuha

have you tried www.khanacademy.org 


3 0
4 years ago
Answer this crossword for brainliest and 15 points
nordsb [41]

Answer:

I like ur cut G

Explanation:

6 0
3 years ago
Which statement best describes multimedia
d1i1m1o1n [39]

Answer:

I couldn't find options to this question online but I will give you an explanation so you can choose the correct answer.

Explanation:

The term multimedia refers to something that uses multiple media simultaneously when transmitting information.

Examples of this can be:

  • photographs
  • sounds
  • text
  • video

Multimedia frames the objects and systems that use multiple physical or digital media to transmit content. It also refers to the media that store and disseminate these types of content.

6 0
4 years ago
Get user input as a boolean and store it in the variable tallEnough. Also, get user input as a boolean and store it in the varia
frozen [14]

Answer:

I will code in JAVA.

import java.util.Scanner;

public class Main {

public static void main(String[] args) {

 

boolean tallEnough;

boolean oldEnough;

Scanner input = new Scanner(System.in);

tallEnough = input.nextBoolean();<em> //wait the input for tallEnough</em>

oldEnough = input.nextBoolean(); <em>//wait the input for OldEnough</em>

   if(tallEnough && oldEnough){

   System.out.print(true);

   } else {

   System.out.print(false);

   }

}

}

Explanation:

First, to accept user inputs you have to import the class Scanner. Then declare both variables before allowing the user to set input values for both boolean variables.

In the if-else statement checks if both variables are true, then prints true. Another case prints always false.

8 0
3 years ago
Other questions:
  • Vpns create a _____________ to transport information through public communications media.
    8·1 answer
  • Describe the general process of creating a DataFlow Diagram (DFD)
    7·1 answer
  • Elizabeth works for a local restaurant at the end of her shift she read she’s required to write in the time that she arrived in
    9·1 answer
  • How can netiquette help you communicate when texting or instant messaging?
    6·1 answer
  • A) Suppose a computer has an instruction pipeline with 4 phases. How many cycles (if there are no delays) would it take to compl
    13·1 answer
  • What is the easiest way to deploy a C++ program to a user’s computer? a. Copy the source code to the user’s computer and then co
    13·1 answer
  • Creating a Venn diagram takes specialized computer software.
    15·2 answers
  • According to programming best practices, how should you handle code that needs to be repeated several times in a program?
    6·1 answer
  • You looked at the methods used to determine database requirements. Now, research and find a database requirements template. Choo
    9·1 answer
  • If you double the force of and object what happens to the acceleration
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!