StudentShare
Contact Us
Sign In / Sign Up for FREE
Search
Go to advanced search...
Free

MSC Computer Science - Coursework Example

Cite this document
Summary
This paper 'MSC Computer Science' tells us that since the prime requirement is that every attraction ought to be dealt with in the manner, we must supply the price for admittance for even the free attractions as “0”. This would defeat the purpose of having the flexibility of entering only those input parameters as associated…
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER96.7% of users find it useful
MSC Computer Science
Read Text Preview

Extract of sample "MSC Computer Science"

The answer to this is fairly simple: Use the same method of retrieval for these and if the output is NULL or zero, it is free!

For the basic construct, usage of inheritance can be done taking a base class Attraction and its derived classes theatre and museum. The prominent members of attraction will be the Opening time, Closing Time, Name, and Attraction Type. The derived classes will have their respective admittance prices as their extra members. This is how generalization will be obtained. The common data members will have a common source, i.e., the parent class. ['is-a' relationship]

2:

3:

#include <iostream>

#include <vector>

#include <iomanip>

#include <string>

#include<conio.h>

 

using namespace std;

typedef enum Attraction_Type

{

   THEATRE,

    MUSEUM,

    PARK

};

void CallConstructors(Attraction_Type _Type, int Adm_Fee);

class attraction

{

public:

    CAttraction( Attraction_Type Atr_Type_ip, int Opening_T, int Closing_T, char Str_att[40]  );

    CAttraction( Attraction_Type Atr_Type_ip, int Opening_T, int Closing_T, int  Adm_Fee, char Str_att[40] );

 

    int Opening_Time;

    int Closing_Time;

    Attraction_Type attr_type;

    int Adm_Price;

    char *Att_Name;

};

class CTheatre: public Cattraction

{

public:

   CTheatre(int Adm_Price)  : CAttraction(THEATRE, 0, 0, Adm_Price,(char*) "XYZ")

   {

       Adm_Fee_Theatre = Adm_Price;

   }

private:

   int Adm_Fee_Theatre;

};

 

 

class CMuseum: public attraction

{

public:

    CMuseum(int Adm_Price) : CAttraction(MUSEUM, 0, 0, Adm_Price, (char*)"XYZ")

    {

       Adm_Fee_Museum = Adm_Price;

    }

private:

    int Adm_Fee_Museum;  

};

class CPark: public attraction

{

  

};

 

Attraction :: Attraction( Attraction_Type Atr_Type_ip, int Opening_T, int Closing_T, int  Adm_Fee, char Str_att[40] )

{

  

  

     Opening_Time = Opening_T;

     Closing_Time =  Closing_T;

     attr_type = Atr_Type_ip;

    // Call Constructors (Atr_Type_ip, Adm_Fee);

  }

void Call Constructors (Attraction_Type _Type, int Adm_Fee)

{

    CTheatre *Theatre;

    Museum *Museum.

    if( _Type== THEATRE)

        Theatre = new CTheatre(Adm_Fee);

    else

        Museum = new CMuseum(Adm_Fee);

}

CAttraction :: CAttraction( Attraction_Type Atr_Type_ip, int Opening_T, int Closing_T, char Str_att[40] )

{

  

     Opening_Time =  Opening_T;

     Closing_Time =  Closing_T;

     attr_type =  Atr_Type_ip;  

}

 

//CAttraction :: ~Attraction(

int main ()

{

   int Ind_No;

   unsigned int j;

    CAttraction *Entry[2];

    vector<CAttraction*> List;

 

    Entry[0] = new CAttraction (PARK, 1000 ,1730, (char*)"British Museum ");   

    CallConstructors (THEATRE, 15);

    Entry[1] = new CAttraction (THEATRE, 1000,1800,15, (char*)"BFI IMAX");   

CallConstructors (MUSEUM, 0);

 Entry[2] = new CAttraction (MUSEUM, 930,1730,0, (char*)"Madame Tussauds"); 

          for(int x = 0; x < 3; x++)

            {

                        List.push_back(Entry[x]);

    //List.push_back(Entry[1]);

            }

 

   

    //vector<CAttraction*>::const_iterator it = List.size();

    for (int n=0; n<(int)List.size(); n++)

      {

        cout << "\n";

        for(j = 0; j< strlen(List[n]->Att_Name); j++)

        {

            cout << j;

            cout <<"\t";

            cout << setw(6) << List[n]->Att_Name[j] ;

        }

       

      }

 

    cout << "\nEnter the index of the attraction you want to know the price of:  \n";

    cin >> Ind_No;

  cout<<"Entry Price:";

    cout<<List[Ind_No]->Adm_Price;

 for (n=0; n<(int)List.size(); ++n)

    {

        if(List[n]->Closing_Time > 1900 && List[n]->Adm_Price <  5)

        {

            cout << "\n";

   for(x = 0; x< strlen(List[n]->Att_Name); x++)

 

   cout << "%s"<< List[n]->Att_Name[x];

        }

    }

 

    cout << "\n are    the attractions open after 1900 hrs and costing lesser than 5";

  getch();

return 0;

}

 

Output: Segmentation Error

Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(“Software design coursework (MSc Computer Science)”, n.d.)
Software design coursework (MSc Computer Science). Retrieved from https://studentshare.org/information-technology/1590145-software-design-coursework-msc-computer-science
(Software Design Coursework (MSc Computer Science)
Software Design Coursework (MSc Computer Science). https://studentshare.org/information-technology/1590145-software-design-coursework-msc-computer-science.
“Software Design Coursework (MSc Computer Science)”, n.d. https://studentshare.org/information-technology/1590145-software-design-coursework-msc-computer-science.
  • Cited: 0 times

CHECK THESE SAMPLES OF MSC Computer Science

Computer Sciences and Information Technology

Name of author: computer sciences and Information technology 1.... Application Software comparisons Web applications can be easily accessible free of cost to anybody who has a computer and internet connection.... It is not necessary to install web applications in computer hard disks to use it.... On the other hand, application software needs to be purchased and installed in the computer hard disks before some body can use it....
5 Pages (1250 words) Essay

Comparison between Windows 7 and Mac OS X

computer sciences and Information technology Comparison between Windows 7 and Mac OS X (10.... Lion) This is a comparison of two major operating systems, namely Microsoft's Windows and Apple's Mac OS in their current iterations, i.... .... Windows 7 and Mac OS 10.... .... ... ... ...
5 Pages (1250 words) Essay

Procrastination by Regina Arnold

This book reviews "Procrastination By Regina Arnold" the book where the author philosophically attempts to explain how iPods have changed peoples' way of life globally.... The idea that people have uploaded so much music on the iPod is becoming a challenge to society.... ... ... ... It emerges that listening to music from the iPods have an addictive behavior that philosophers describe as learned....
8 Pages (2000 words) Book Report/Review

Computer crime

Digital evidence and computer crime: forensic science, computers and the Internet (2nd ed.... In this context, the computer might have been used to commit a crime or else be the target in the crime committed.... These crimes are committed using communication networks, which mostly are threats circulated in the computer crime computer crime A computer crime is any criminal act that is committed through the use of a computer of a network system....
1 Pages (250 words) Research Paper

Collaborative Learning in E-learning

lusion of collaboration, computer mediation, and distance education has problematized the very notion of learning and called into question existing assumptions about how to study or learn it.... It intensively focuses on how productive peer collaboration can be stimulated and sustained in computer-mediated environments and how these collaborative activities facilitate learning.... This increase explicitness due to persistence of textual messages on computer screen, more defined in expressing arguments due to lack of nonverbal communication...
5 Pages (1250 words) Essay

Designing Human Interfaces for Operating Systems

owever, the science behind computers is quite enthralling and it makes a person wonder how exactly a machine is able to perform such complex tasks within mere seconds.... User interfaces and operating systems are important parts of a computer system that basically define their usage for different types of users.... Thus, it becomes clear that between the computer and the person or user, there needs to be a translator that can translate the languages in order for both parties to understand the other....
9 Pages (2250 words) Essay

Understanding Cryptography

However, modern cryptography borrows from disciplines of computer science, mathematics and electrical engineering among others.... Cryptography is predominantly used in computer passwords, e-commerce, and ATM cards.... Internet communication, wireless networking, mobile computing, and cloud computing are some of the trends shaping the computing and communication industry....
8 Pages (2000 words) Essay

Devices of USB Communications

T32UC3A3, in this appliance mainly transmit information to devices that are external to the storage medium and the computer that hosts.... USB of High Speed is employed in the transmission of information between the UC3 and the computer that hosts while in the medium of storage, a card of SD/MMC.... he computer that hosts the whole process initiates all the transactions that involve reading and writing.... The response of the cards of SD/MMC, any data read inclusively, will as a matter of time be relayed back to UC3 and then sent to the computer that hosts over the USB....
9 Pages (2250 words) Report
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.
Contact Us