Some students have organized an election to determine the new leaders of their school club. Each member of the club has a unique ID that they can use when they vote. However, the election managers suspect that some members have voted twice. Write a program to read in member IDs and check if there are any repeated values. If an ID has already been used, output a line in this format: REPEAT: The ID BE45N6 has already been counted! Stop reading input after reading the value "STOP". Then output a line showing how many unique members voted in this format After excluding repeats, 45 unique members voted. X Full Screen ¢ p5.pp O include O New using namespace std3; int main() { // TODO: Write your code here cout "REPEAT: The ID" "AABBAB" * has already been counted!" endl; 10 11 cout "After excluding repeats, " «e " unique members voted." endl; 12 }

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.5: A Closer Look: Loop Programming Techniques
Problem 14E
icon
Related questions
Question
Some students have organized an election to determine the new leaders of their school club. Each member of the club has a unique ID that they can use when they vote. However, the election managers suspect that some members have
voted twice.
Write a program to read in member IDs and check if there are any repeated values. If an ID has already been used, output a line in this format:
REPEAT: The ID BE45N6 has already been counted!
Stop reading input after reading the value "STOP". Then output a line showing how many unique members voted in this format:
After excluding repeats, 45 unique members voted.
p5.cpp O
O New
I Full Screen
#include <iostream>
using namespace std;
4
5
int main() {
7
// TODO: Write your code here
cout
"REPEAT: The ID " <« "AAOOAO" << " has already been counted!" <« endl;
10
cout « "After excluding repeats,
e « " unique members voted."
endl;
11
12
13
Transcribed Image Text:Some students have organized an election to determine the new leaders of their school club. Each member of the club has a unique ID that they can use when they vote. However, the election managers suspect that some members have voted twice. Write a program to read in member IDs and check if there are any repeated values. If an ID has already been used, output a line in this format: REPEAT: The ID BE45N6 has already been counted! Stop reading input after reading the value "STOP". Then output a line showing how many unique members voted in this format: After excluding repeats, 45 unique members voted. p5.cpp O O New I Full Screen #include <iostream> using namespace std; 4 5 int main() { 7 // TODO: Write your code here cout "REPEAT: The ID " <« "AAOOAO" << " has already been counted!" <« endl; 10 cout « "After excluding repeats, e « " unique members voted." endl; 11 12 13
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr