Take Note These questions requires diagrams Scenario Sweetbr
Take Note: These questions requires diagrams.
Scenario: Sweetbriar College is redesigning their course registration system [CRS]. They plan for this system to be web-based, but first you need to model the main system behind the web interface. Here is a description of the interactions with the proposed CRS.
Faculty enter courses into the system, assign section numbers, instructors, dates, times, and classrooms for individual instances of a course. Students can browse available course-sections. Students or faculty advisors can register students for course-sections. Faculty can view a class list and enter grades for a course-section they are teaching. Students can view their course schedule and their grades for individual courses. The Registrar\'s office can view a student\'s history of courses and grades.
1. Using our Sweetbriar College scenario, evolve your Object Class Diagram for the CRS into design packages. Include packages for the Human Computer Interface [HCI] layer, the application layer, and the data management [DM] layer.
2. Expand the application layer package for the CRS. Include packages for Faculty and Staff, Students, and Courses.
3.Expand the HCI layer package for the CRS. Include packages for Faculty and Staff interface, and Student interface.
Create a Sequence Diagram for \'Student Registers for Course-Section\' for questions 4 and 5
4.Expand the Sequence Diagram you developed for \'Student Registers for Course-Section\' so that it includes the objects from the HCI layer and the DM layer.
5.Expand the Sequence Diagram you developed for \'Faculty Creates New Course-Section\' so that it includes the objects from the HCI layer and the DM layer.
Solution
program
package Givepreference;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import Register.Staff;
import Register.Database;
import java.util.Set;
public class PreferenceUI extends JFrame implements ActionListener
{
private Staff staff;
String a1,a2,a3;
JButton b=new JButton(\"Submit preference\");
JPanel p;
JLabel l1,l2,l3;
JTextField t1,t2,t3;
public PreferenceUI()
{
p=new JPanel(new GridLayout(4,4));
l1=new JLabel(\"Course1:\");
l2=new JLabel(\"course2:\");
l3=new JLabel(\"course3:\");
t1=new JTextField(40);
t2=new JTextField(40);
t3=new JTextField(40);
p.add(l1);
p.add(t1);
p.add(l2);
p.add(t2);
p.add(l3);
p.add(t3);
add(p);
add(b,BorderLayout.SOUTH);
b.addActionListener(this);
}
public Staff getStaff()
{
return staff;
}
public void actionPerformed(ActionEvent ae)
{
String a1=t1.getText();
String a2=t2.getText();
String a3=t3.getText();
if(a1.equalsIgnoreCase(\"Computer Science\") || a2.equalsIgnoreCase(\"Maths\")|| a3.equalsIgnoreCase(\"OOAD\"))
{
JOptionPane.showMessageDialog(null,\"Allocated successfully\");
}
else
{
JOptionPane.showMessageDialog(this,\"Not successfull\");
}
}
public void setStaff(Staff theStaff)
{
staff = theStaff;
}
private Database database;
public Database getDatabase()
{
return database;
}
public void setDatabase(Database theDatabase)
{
database = theDatabase;
}
private Set system;
public Set getSystem()
{
return system;
}
public void setSystem(Set theSystem)
{
system = theSystem;
}
public void Providepreferencedetails() {
}
public static void main(String[] args)throws Exception
{
PreferenceUI p=new PreferenceUI();
p.setVisible(true);
p.setSize(100,100);
}
}
ReserveUI.java:
package Reserve;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import Register.Student;
import Register.Database;
public class ReserveUI extends JFrame implements ActionListener
{
private Administrator administrator;
int count1=3;
int count2=3;
int count3=3;
JLabel c=new JLabel(\"SELECT A COURSE FROM \'COMBOBOX\' TO RESERVE:\");
JLabel fees=new JLabel(\"Fees to be paid:\");
JTextField fees1=new JTextField(20);
JButton b=new JButton(\"Confirm selection\");
JButton b1=new JButton(\"Pay fees\");
JLabel a=new JLabel(\"1.Enter your Account number:\");
JTextField ano=new JTextField(20);
JLabel or=new JLabel(\"---------------(OR)---------------\");
JLabel ddno=new JLabel(\"1.Enter your DD No.:\");
JTextField DDno=new JTextField(20);
JLabel ddto=new JLabel(\"2.Pay DD to:\");
JTextField DDto=new JTextField(20);
JLabel ddpayat=new JLabel(\"3.Payable at:\");
JTextField DDpay=new JTextField(20);
JPanel p=new JPanel();
JFrame f=new JFrame();
JPanel p1=new JPanel();
JPanel p2=new JPanel();
CheckboxGroup grp=new CheckboxGroup();
JComboBox combo=new JComboBox();
public ReserveUI()
{
fees1.setText(\"Rs.7500\");
fees1.setEditable(false);
combo.addItem(\"Computer Science\");
combo.addItem(\"Maths\");
combo.addItem(\"OOAD\");
p.add(c);
p.add(combo);
add(p);
add(BorderLayout.SOUTH,b);
b.addActionListener(this);
b1.addActionListener(this);
p1.setLayout(new GridLayout(3,2,5,5));
p1.add(fees);
p1.add(fees1);
p1.add(a);
p1.add(ano);
p1.add(or);
p2.setLayout(new GridLayout(3,3,5,5));
p2.add(ddno);
p2.add(DDno);
p2.add(ddto);
p2.add(DDto);
p2.add(ddpayat);
p2.add(DDpay);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==b)
{
if(combo.getSelectedItem().equals(\"Computer Science\"))
{
if(count1!=0)
{
JOptionPane.showMessageDialog(this, \"Enter Account number (OR) DD details for payment:\");
JFrame f1=new JFrame();
f1.add(BorderLayout.WEST,p1);
f1.add(BorderLayout.EAST,p2);
f1.add(BorderLayout.SOUTH,b1);
f1.setVisible(true);
count1--;
}
else
JOptionPane.showMessageDialog(this, \"Oops!! All seats for Computer Science course had been already reserved.\ Try some other course\");
}
else if(combo.getSelectedItem().equals(\"Maths\"))
{
if(count1!=0)
{
JOptionPane.showMessageDialog(this, \"Enter Account number (OR) DD details for payment:\");
JFrame f1=new JFrame();
f1.add(BorderLayout.WEST,p1);
f1.add(BorderLayout.EAST,p2);
f1.add(BorderLayout.SOUTH,b1);
f1.setVisible(true);
count1--;
}
else
JOptionPane.showMessageDialog(this, \"Oops!! All seats for Maths course had been already reserved.\ Try some other course\");
}
if(combo.getSelectedItem().equals(\"OOAD\"))
{
if(count1!=0)
{
JOptionPane.showMessageDialog(this, \"NOTE: Enter either Account number (OR) details of DD for payment:\ Don\'t fill both\");
JFrame f1=new JFrame();
f1.add(BorderLayout.WEST,p1);
f1.add(BorderLayout.EAST,p2);
f1.add(BorderLayout.SOUTH,b1);
f1.setVisible(true);
count1--;
}
else
JOptionPane.showMessageDialog(this, \"Oops!! All seats for OOAD course had been already reserved.\ Try some other course\");
}
}
else if(e.getSource()==b1)
{
if(!ano.getText().equals(\"\"))
JOptionPane.showMessageDialog(this,\"Amount paid successfully via account number:\"+ano.getText());
else
JOptionPane.showMessageDialog(this,\"Amount paid successfully via Demand Draft number:\"+DDno.getText());
}
}
public Administrator getAdministrator()
{
return administrator;
}
public void setAdministrator(Administrator theAdministrator)
{
administrator = theAdministrator;
}
private Student student;
public Student getStudent()
{
return student;
}
public void setStudent(Student theStudent)
{
student = theStudent;
}
private Database database;
public static void main(String[] args)throws Exception
{
ReserveUI r=new ReserveUI();
r.setVisible(true);
}
}
package Register;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class RegisterUI extends JFrame implements ActionListener
{
private Student student;
String[] studname =new String[10];int ucount=0;
String[] studpass =new String[10];
String[] studqualifi=new String[10];
String[] staffname=new String[10];int u1count=0;
String[] staffpass=new String[10];
String[] staffqualifi=new String[10];
JPanel button = new JPanel(new GridLayout(4,0,3,3));
JPanel staffpan=new JPanel(new GridLayout(2,0,3,3));
JLabel l=new JLabel(\"CLICK HERE FOR REGISTRATION OR LOGIN\");
JLabel l2=new JLabel(\"Login successful\");
JButton b1= new JButton(\"Students enter here!!!\");
JButton b2=new JButton(\"Staffs enter here!!!\");
JButton srb=new JButton(\"Students\' register page\");
JButton strb=new JButton(\"Staffs\' register page\");
JButton slb=new JButton(\"Students\' login page\");
JButton stlb=new JButton(\"Staffs\' login page\");
JPanel studreg=new JPanel(new GridLayout(2,0,5,5));
JFrame f=new JFrame();
JFrame f1=new JFrame();
JPanel regpan=new JPanel();
JPanel loginpan=new JPanel();
JFrame f2=new JFrame();
JFrame f3=new JFrame();
JFrame f4=new JFrame();
JFrame f5=new JFrame();
JLabel u=new JLabel(\"Username:\");
JTextField u1=new JTextField(20);
JLabel p=new JLabel(\"Password:\");
JPasswordField p1=new JPasswordField(20);
JLabel q=new JLabel(\"Qualification:\");
JTextField q1=new JTextField(20);
JPanel staffregpan=new JPanel();
JButton submit=new JButton(\"Submit details\");
JButton submit1=new JButton(\"Submit details\");
JButton login=new JButton(\"Login\");
JButton login1=new JButton(\"Login\");
JLabel u2=new JLabel(\"Username:\");
JTextField u3=new JTextField(20);
JLabel p2=new JLabel(\"Password:\");
JPasswordField p3=new JPasswordField(20);
JPanel staffreg=new JPanel();
JButton getdetails=new JButton(\"Get details\");
String Totallist=new String();
public RegisterUI()
{
button.add(l);
button.add(b1);
b1.addActionListener(this);
button.add(b2);
b2.addActionListener(this);
add(BorderLayout.CENTER,button);
srb.addActionListener(this);
strb.addActionListener(this);
slb.addActionListener(this);
stlb.addActionListener(this);
regpan.setLayout(new GridLayout(3,2));
regpan.add(u);
regpan.add(u1);
regpan.add(p);
regpan.add(p1);
regpan.add(q);
regpan.add(q1);
loginpan.add(u2);
loginpan.add(u3);
loginpan.add(p2);
loginpan.add(p3);
login.addActionListener(this);
submit.addActionListener(this);
studreg.add(srb);
studreg.add(slb);
staffreg.setLayout(new GridLayout(2,0));
staffreg.add(strb);
staffreg.add(stlb);
staffpan.add(l2);
staffpan.add(getdetails);
getdetails.addActionListener(this);
login1.addActionListener(this);
submit1.addActionListener(this);
}
public Student getStudent()
{
return student;
}
public void setStudent(Student theStudent)
{
student = theStudent;
}
private Database database;
public Database getDatabase()
{
return database;
}
public void setDatabase(Database theDatabase)
{
database = theDatabase;
}
private Staff staff;
public Staff getStaff()
{
return staff;
}
public void setStaff(Staff theStaff)
{
staff = theStaff;
}
public void Givedetails(String checkuser)//student\'s registration page
{
if(checkuser.equalsIgnoreCase(\"Student\"))
{
int flag=0;
if(q1.getText().equalsIgnoreCase(\"12th\") || q1.getText().equalsIgnoreCase(\"B.E.\") || q1.getText().equalsIgnoreCase(\"B.Tech.\"))
{
if(!(u1.getText().equals(\"\")|| p1.getText().equals(\"\")))
{
for(int i=0;i<studname.length;i++)
{
if(studname.equals(u1.getText()))
{
flag=1;
JOptionPane.showMessageDialog(this, \"username already exists.Try another User name\");
}
}
if(flag==0)
{
studname[ucount]=u1.getText();
studpass[ucount]=p1.getText();
studqualifi[ucount]=q1.getText();
JOptionPane.showMessageDialog(this, \"Username created sccessfully.\ Login ID:\"+studname[ucount]+\"\ Password:\"+studpass[ucount]);
ucount++;
f1.setVisible(false);
setVisible(true);
}
}
else
{
JOptionPane.showMessageDialog(this, \"Error: Either Username or password is blank\");
}
}
else
{
JOptionPane.showMessageDialog(this,\"Sorry!!! You should have completed atleast 12th/B.E./B.Tech. to register\");
}
}
}
public void Givedetails()
{
int flag=0;
if(q1.getText().equalsIgnoreCase(\"B.E.\") || q1.getText().equalsIgnoreCase(\"M.E.\") || q1.getText().equalsIgnoreCase(\"B.Tech.\") || q1.getText().equalsIgnoreCase(\"Ph.D.\"))
{
if(!(u1.getText().equals(\"\")|| p1.getText().equals(\"\")))
{
for(int i=0;i<studname.length;i++)
{
if(staffname.equals(u1.getText()))
{
flag=1;
JOptionPane.showMessageDialog(this, \"username already exists.Try another User name\");
}
}
if(flag==0)
{
staffname[u1count]=u1.getText();
staffpass[u1count]=p1.getText();
staffqualifi[u1count]=q1.getText();
JOptionPane.showMessageDialog(this, \"Username created sccessfully.\ Login ID:\"+studname[ucount]+\"\ Password:\"+studpass[ucount]);
u1count++;
//pcount++;
//qcount++;
f1.setVisible(false);
setVisible(true);
}
}
else
{
JOptionPane.showMessageDialog(this, \"Error: Either Username or password is blank\");
}
}
else
{
JOptionPane.showMessageDialog(this,\"Sorry!!! You should have completed atleast B.E./B.Tech./M.E./Ph.D. to register\");
}
}
public void Logindetails()
{
int flag=0;
for(int i=0;i<studname.length;i++)
{
if(staffname[i].equals(u3.getText()) && staffpass[i].equals(p3.getText()))
{
JOptionPane.showMessageDialog(this, \"Login successful\");
JFrame f5=new JFrame();
f5.add(staffpan);
f5.setVisible(true);
flag=1;
}
}
if(flag==0)
JOptionPane.showMessageDialog(this,\"OOPS.. Wrong username or password\");
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==b1)
{
setVisible(false);
f.add(studreg);
f.setVisible(true);
}
else if(e.getSource()==b2)
{
setVisible(false);
f3.add(BorderLayout.CENTER,staffreg);
f3.setVisible(true);
}
else if(e.getSource()==srb)
{
f.setVisible(false);
f1.add(regpan);
f1.add(BorderLayout.SOUTH,submit);
f1.setVisible(true);
}
else if(e.getSource()==strb)
{
f3.setVisible(false);
f4.add(regpan);
f4.add(BorderLayout.SOUTH,submit1);
f4.setVisible(true);
}
else if(e.getSource()==slb)
{
f1.setVisible(false);
f.setVisible(false);
f2.add(loginpan);
f2.add(BorderLayout.SOUTH,login);
f2.setVisible(true);
}
else if(e.getSource()==submit)
{
Givedetails(\"student\");
f1.setVisible(false);
f.setVisible(true);
}
else if(e.getSource()==submit1)
{
Givedetails();
f4.setVisible(false);
setVisible(true);
}
else if(e.getSource()==login)
{
int flag=0;
for(int i=0;i<studname.length;i++)
{
if(studname[i].equals(u3.getText()) && studpass[i].equals(p3.getText()))
{
JOptionPane.showMessageDialog(this, \"Login successful\");
flag=1;
}
}
if(flag==0)
{
JOptionPane.showMessageDialog(this, \"Oops!! the user is not registered\");
}
}
else if(e.getSource()==login1)
{
JOptionPane.showMessageDialog(this, \"Login successful\");
}
else if(e.getSource()==getdetails)
{
Totallist+=\"List of students are:\";
for(int i=0;i<studname.length;i++)
{
Totallist+=studname[i]+\"\\t\"+studqualifi[i]+\"\ \";
}
JOptionPane.showMessageDialog(this,Totallist);
}
}
public static void main(String[] args) throws Exception
{
RegisterUI r=new RegisterUI();
r.setVisible(true);
}
}
![Take Note: These questions requires diagrams. Scenario: Sweetbriar College is redesigning their course registration system [CRS]. They plan for this system to b Take Note: These questions requires diagrams. Scenario: Sweetbriar College is redesigning their course registration system [CRS]. They plan for this system to b](/WebImages/35/take-note-these-questions-requires-diagrams-scenario-sweetbr-1105236-1761584820-0.webp)
![Take Note: These questions requires diagrams. Scenario: Sweetbriar College is redesigning their course registration system [CRS]. They plan for this system to b Take Note: These questions requires diagrams. Scenario: Sweetbriar College is redesigning their course registration system [CRS]. They plan for this system to b](/WebImages/35/take-note-these-questions-requires-diagrams-scenario-sweetbr-1105236-1761584820-1.webp)
![Take Note: These questions requires diagrams. Scenario: Sweetbriar College is redesigning their course registration system [CRS]. They plan for this system to b Take Note: These questions requires diagrams. Scenario: Sweetbriar College is redesigning their course registration system [CRS]. They plan for this system to b](/WebImages/35/take-note-these-questions-requires-diagrams-scenario-sweetbr-1105236-1761584820-2.webp)
![Take Note: These questions requires diagrams. Scenario: Sweetbriar College is redesigning their course registration system [CRS]. They plan for this system to b Take Note: These questions requires diagrams. Scenario: Sweetbriar College is redesigning their course registration system [CRS]. They plan for this system to b](/WebImages/35/take-note-these-questions-requires-diagrams-scenario-sweetbr-1105236-1761584820-3.webp)
![Take Note: These questions requires diagrams. Scenario: Sweetbriar College is redesigning their course registration system [CRS]. They plan for this system to b Take Note: These questions requires diagrams. Scenario: Sweetbriar College is redesigning their course registration system [CRS]. They plan for this system to b](/WebImages/35/take-note-these-questions-requires-diagrams-scenario-sweetbr-1105236-1761584820-4.webp)
![Take Note: These questions requires diagrams. Scenario: Sweetbriar College is redesigning their course registration system [CRS]. They plan for this system to b Take Note: These questions requires diagrams. Scenario: Sweetbriar College is redesigning their course registration system [CRS]. They plan for this system to b](/WebImages/35/take-note-these-questions-requires-diagrams-scenario-sweetbr-1105236-1761584820-5.webp)
![Take Note: These questions requires diagrams. Scenario: Sweetbriar College is redesigning their course registration system [CRS]. They plan for this system to b Take Note: These questions requires diagrams. Scenario: Sweetbriar College is redesigning their course registration system [CRS]. They plan for this system to b](/WebImages/35/take-note-these-questions-requires-diagrams-scenario-sweetbr-1105236-1761584820-6.webp)
![Take Note: These questions requires diagrams. Scenario: Sweetbriar College is redesigning their course registration system [CRS]. They plan for this system to b Take Note: These questions requires diagrams. Scenario: Sweetbriar College is redesigning their course registration system [CRS]. They plan for this system to b](/WebImages/35/take-note-these-questions-requires-diagrams-scenario-sweetbr-1105236-1761584820-7.webp)
![Take Note: These questions requires diagrams. Scenario: Sweetbriar College is redesigning their course registration system [CRS]. They plan for this system to b Take Note: These questions requires diagrams. Scenario: Sweetbriar College is redesigning their course registration system [CRS]. They plan for this system to b](/WebImages/35/take-note-these-questions-requires-diagrams-scenario-sweetbr-1105236-1761584820-8.webp)
![Take Note: These questions requires diagrams. Scenario: Sweetbriar College is redesigning their course registration system [CRS]. They plan for this system to b Take Note: These questions requires diagrams. Scenario: Sweetbriar College is redesigning their course registration system [CRS]. They plan for this system to b](/WebImages/35/take-note-these-questions-requires-diagrams-scenario-sweetbr-1105236-1761584820-9.webp)