Show StudentsADT interface

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

interface StudentsADT
{
void admissions();
void discharge();
void transfers();
  
}
public class Course
{
String cname;
int cno;
int credits;
public Course()
{
System.out.println("\nDEFAULT constructor called");
}
public Course(String c)
{
System.out.println("\noverloaded constructor called");
cname=c;
}
public Course(Course ch)
{
System.out.println("\nCopy constructor called");
cname=ch;
}
void setCourseName(String ch)
{
cname=ch;
System.out.println("\n"+cname);
}
void setSelectionNumber(int cno1)
{
cno=cno1;
System.out.println("\n"+cno);
}
void setNumberOfCredits(int cdit)
{
credits=cdit;
System.out.println("\n"+credits);
}
void setLink()
{
System.out.println("\nset link");
}
String getCourseName()
{
System.out.println("\n"+cname);
}
int getSelectionNumber()
{
System.out.println("\n"+cno);
}
int getNumberOfCredits()
{
System.out.println("\n"+credits);   
}
void getLink()
{
System.out.println("\ninside get link");
}
}


public class Students
{
String sname;
int cno;
int credits;
int maxno;
public Students()
{
System.out.println("\nDEFAULT constructor called");
}
public Students(String c)
{
System.out.println("\noverloaded constructor called");
cname=c;
}
public Students(Students ch)
{
System.out.println("\nCopy constructor called");
cname=ch;
}
void setMaxNumberOfStudents(int n)
{
maxno=n;
}
void addStudent(String snam)
{
sname=snam;
}
void addCourse(int cno1,String cname1)
{
cno=cno1;
cname=cname1;
}
void dropCourse(int cno1,String cname1)
{
cno=0;
cname="null";
}
public class Student
{
String sname;
int cno;
int credits;
int id;
String course;
public Student()
{
System.out.println("\nDEFAULT constructor called");
}
public Student(String c)
{
System.out.println("\noverloaded constructor called");
cname=c;
}
void setId(int id1)
{
id=id1;
}
void setCourses(String course1)
{
course=course1;
}
void addCourse(int cno1,String cname1)
{
cno=cno1;
cname=cname1;
}
void dropCourse(int cno,String cname)
{
cno=0;
cname="null";
}

public static void main(String args[])

{

}
}
}

 

 

1. Show StudentsADT interface
2. Create a Course class with the following methods: default constructor,
overloaded constructor, copy constructor, setCourseName, setSectionNumber,
setNumberOfCredits, setLink, getCourseName, getSectionNumber,
getNumberOfCredits, getLink, toString
3. Create a Students class with the following methods: default constructor,
overloaded constructor, copy constructor, setMaxNumberOfStudents,
addStudent, addCourse (pass 2 args), dropCourse (2 args), toString
4. Create an Inner class called Student inside Students class with the following
methods: default constructor, overloaded constructor, setID, setCourses,
getID, getCourses, addCourse (pass 1 arg), dropCourse (1 arg), toString
5. Create a StudentsDemo class by adding the students with IDs: 1111, 1234, 2357
- Display the following menu:
“What action would you like to implement?”
1: Show all Students
2: Add a Course
3: Drop a Course
9: Quit

please do number 5 relying on the code above

dont use others answers please

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education