Question

In: Computer Science

Consider a Coffee-shop located at the School University Center, which is managed by student association, and...

Consider a Coffee-shop located at the School University Center, which is managed by student association, and some students work there as a manager, in the kitchen, in customer service etc. You can consider all students workers as a general term “student_employee”.

As a system designer your task is to design a UML class for a “student-employee”, try to code in C# or any OOP language, create two sample objects and show inheritances from student to the student_employee.

Solutions

Expert Solution

Here is the answer for your question in C# Programming Language,

Kindly upvote if you find the answer helpful.

###################################################################3

CODE :

using System;

class Student{

//Class private member variables

private string firstName;

private string lastName;

private int id;

//Default constructor

public Student(){}

//Parameterised constructor

public Student(string fname,string lname,int student_id){

FirstName = fname;

LastName = lname;

Id = student_id;

}

//Properties

public string FirstName { get{return firstName;} set{firstName = value;}}

public string LastName { get{return lastName;} set{lastName = value;}}

public int Id { get{return id;} set{id = value;}}

//ToString method

public override string ToString(){

return "Student Name : " + FirstName + " " + LastName + "\nStudent ID : " + Id;

}

}

//Stude that inherits Student class

class StudentEmployee : Student{

//Class private variables

private string typeOfWork;

private const string STUDENTIS = "A Student-Employee";

//Default constructor

public StudentEmployee() : base() {}

//Parameterised constructor

public StudentEmployee(string type,string fname,string lname,int student_id) : base(fname,lname,student_id) {

TypeOfWork = type;

}

//Properties

public string TypeOfWork { get{return typeOfWork;} set{typeOfWork = value;}}

//ToString() method

public override string ToString(){

return base.ToString() + "\nIs : " + STUDENTIS + "\nType of Work : " + typeOfWork;

}

}

public class MainClass {

public static void Main (string[] args) {

//Creating one student and two student employee objects

Student student = new Student("James","Willis",2098);

Student stdEmp1 = new StudentEmployee("Manager","John","Doe",1908);

Student stdEmp2 = new StudentEmployee("Chef","Albert","Thomas",1816);

//Printing them

Console.WriteLine("============================");

Console.WriteLine(student);

Console.WriteLine("============================");

Console.WriteLine(stdEmp1);

Console.WriteLine("============================");

Console.WriteLine(stdEmp2);

Console.WriteLine("============================");

}

}

##############################################################

SCREENSHOTS :

Please see the screenshots of the code below for the indentations of the code.

##################################################################

OUTPUT :

###################################################################

SAMPLE UML CLASS DIAGRAM :

Any doubts regarding this can be explained with pleasure :)


Related Solutions

Consider a cofee shop located at XYZ University, which is managed by a student association. Some...
Consider a cofee shop located at XYZ University, which is managed by a student association. Some students work as a manager, in the kitchen, customer service etc. You can consider all students workers as a general term "student_employee." Design a UML class for "student-employee," code in C#, create two sample objects ans ahow ingeritances from student to the student_employee.
A businesswoman is considering whether to open a coffee shop in a local shopping center. Before...
A businesswoman is considering whether to open a coffee shop in a local shopping center. Before making this decision, she wants to know how much money people spend per week at coffee shops in that area. She took a random sample of 26 customers from the area who visit coffee shops and asked them to record the amount of money (in dollars) they would spend during the next week at coffee shops. At the end of the week, she obtained...
A survey at Evashevski University showed that 75% of the student body believes that the school...
A survey at Evashevski University showed that 75% of the student body believes that the school offers classes at appropriate times during the school day. To investigate with this feeling is shared by students specifically within the business department, the department polled a sample of 100 business students; 64 said they thought that classes were offered at appropriate times during the school day. Use an α = .10. A. Provide the appropriate hypothesis test criteria: HO: p ≥ ≤ =...
A student with an eight​ o'clock class at a university commutes to school by car. She...
A student with an eight​ o'clock class at a university commutes to school by car. She has discovered that along each of two possible routes her traveling time to school​ (including the time to get to​ class) is approximately a normal random variable. If she uses the highway for most of her​ trip,μ=22 minutes and σ=5 minutes. If she drives a longer route over city​ streets, μ=26 minutes and σ=33 minutes. Which route should the student take if she leaves...
The Student Government Association at SLAY University wanted to demonstrate the relation ship between the number...
The Student Government Association at SLAY University wanted to demonstrate the relation ship between the number of beers a student drink and their blood alcohol content (BAC). A random sample of 18 students participated in a study in which each student was randomly assigned a number of cans of beers to drink. 30 minutes later their BAC was measured. Answer the following questions. Use alpha .05 for the test statistic. Beers BAC 6 .10 3 .12 4 .10 7 .09...
The Student Government Association at Middle Carolina University wanted to demonstrate the relationship between the number...
The Student Government Association at Middle Carolina University wanted to demonstrate the relationship between the number of beers a student drinks and his or her blood alcohol content (BAC). A random sample of 18 students participated in a study in which each participating student was randomly assigned a number of 12-ounce cans of beer to drink. Thirty minutes after they consumed their assigned number of beers, a member of the local sheriff’s office measured their blood alcohol content. The sample...
As the Corner Coffee Shop becomes more popular and sells more coffee, which of the following...
As the Corner Coffee Shop becomes more popular and sells more coffee, which of the following is more likely to increase? Group of answer choices fixed cost average fixed cost Internet subscription variable cost Consider ADs and More, an advertising agency. Which of the following would be more likely to be a fixed cost? Group of answer choices hourly workers. office rent video producing expenses. Actors Suppose that a firm produces 10 units of output. Its average variable cost (AVC)...
The management of Mecca Copy, a photocopying center located on University Avenue, has compiled the following...
The management of Mecca Copy, a photocopying center located on University Avenue, has compiled the following data to use in preparing its budgeted balance sheet for next year: Ending Balances Cash ? Accounts receivable $ 8,500 Supplies inventory $ 4,700 Equipment $ 36,000 Accumulated depreciation $ 14,600 Accounts payable $ 2,200 Common stock $ 5,000 Retained earnings ? The beginning balance of retained earnings was $32,000, net income is budgeted to be $16,300, and dividends are budgeted to be $2,700....
The management of Mecca Copy, a photocopying center located on University Avenue, has compiled the following...
The management of Mecca Copy, a photocopying center located on University Avenue, has compiled the following data to use in preparing its budgeted balance sheet for next year: Ending Balances Cash ? Accounts receivable $ 8,100 Supplies inventory $ 3,200 Equipment $ 34,000 Accumulated depreciation $ 16,000 Accounts payable $ 1,800 Common stock $ 5,000 Retained earnings ? The beginning balance of retained earnings was $28,000, net income is budgeted to be $11,500, and dividends are budgeted to be $4,800....
The management of Mecca Copy, a photocopying center located on University Avenue, has compiled the following...
The management of Mecca Copy, a photocopying center located on University Avenue, has compiled the following data to use in preparing its budgeted balance sheet for next year: Ending Balances Cash ? Accounts receivable $ 8,100 Supplies inventory $ 3,200 Equipment $ 34,000 Accumulated depreciation $ 16,000 Accounts payable $ 1,800 Common stock $ 5,000 Retained earnings ? The beginning balance of retained earnings was $28,000, net income is budgeted to be $11,500, and dividends are budgeted to be $4,800....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT