Question

ARENA is a multi-user, Web-based system for organizing and conducting tournaments. ARENA is game independent in...

ARENA is a multi-user, Web-based system for organizing and conducting tournaments. ARENA is game independent in the sense that organizers can adapt a new game to the ARENA game interface, upload it to the ARENA server, and immediately announce and conduct tournaments with players and spectators located anywhere on the Internet. Organizers can also define new tournament styles, describing how players are mapped to a set of matches and how to compute an overall ranking of players by adding up their victories and losses (hence, figuring out who won the tournament). To recoup their operational costs, organizers can also invite potential sponsors to display advertisement banners during games. ----------------------------------------------------------------------------------------------------

1. Use-Case Diagram (15 points) Part A: Identify Actors and Use Cases for the Arena Game System. Draw the Use Case Diagram that details the high-level functionality of the system. Make sure to have includes and extends relationships between use cases where relevant.

I have so far

Actors: Players, Organizer, Spectators, and Sponsors

Use cases: Create new game, upload game, announce tournament, conduct tournament, define new tournament style, win tournament, Lose tournament, Invite sponsor, display advertisement.

Do I have too many use cases? Am I overthinking this and should have less items?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include<iostream>
using namespace std;

class Bag{
public:
typedef int value_type;
typedef std::size_t size_type;
static const size_type CAPACITY=30;
  
Bag(){used=0;}
void erase();
size_type erase_copies(const value_type& target);
bool erase_one(const value_type& entry);
void insert(const value_type& entry);
void operator +=(const Bag& addend);
size_type size() const{return used;};
size_type count(const value_type& target) const;

void print()
{
for(int i=0;i<used;i++)
{
cout<<data[i]<<" ";
}
}
  
private:
value_type data[CAPACITY];
size_type used;
friend Bag operator +(const Bag& s1,const Bag& s2);
friend ostream& operator <<(std::ostream& output,const Bag& s);
};
void Bag::erase(){
   used=0;
}
Bag::size_type Bag::erase_copies(const value_type& target)
{
   int result=false;
   for(size_type i=0;i<used;i++)
   {
       if(data[i]==target)
       {
           for(size_type j=i;j<used-1;j++)
           {
               data[j]=data[j+1];
           }
           used--;
           i--;
       }
   }
   return used;
}
bool Bag::erase_one(const value_type& entry)
{
   int result=false;
   for(size_type i=0;i<used;i++)
   {
       if(data[i]==entry)
       {
           for(size_type j=i;j<used-1;j++)
           {
               data[j]=data[j+1];
           }
           used--;
           result=true;
           break;
       }
   }
   return result;
}

void Bag::insert(const value_type& entry)
{
if(used>=CAPACITY)
{
cout<<"can't entr new element bag is full"<<endl;
}
else
{
data[used++]=entry;
}
}
void Bag::operator +=(const Bag& addend)
{
if(this->size() + addend.size()>this->CAPACITY)
{
cout<<"cant do the operation capacity is less"<<endl;
}
else
{
for(int i=0;i<addend.size();i++)
{
insert(addend.data[i]);
}
}
}
Bag::size_type Bag::count(const value_type& target) const
{
size_type count=0;
for(int i=0;i<used;i++)
{
if(data[i]==target)
{
count++;
}
}
return count;
}
std::ostream& operator <<(std::ostream& output,const Bag& s)

{
string str="";
for(int i=0;i<s.size();i++)
{
output<<" "<<s.data[i];
}
output<<str+"hello";

return(output);

}
int main()
{
Bag b,c;
int s=3,d=4;
b.insert(s);
b.insert(d);
b.insert(d);
c.insert(s);
c.insert(d);
c.insert(d);

b+=c;
//b.print();
cout<<b.count(4);
cout<<b;
return 0;
}

Add a comment
Know the answer?
Add Answer to:
ARENA is a multi-user, Web-based system for organizing and conducting tournaments. ARENA is game independent in...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT