
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Solve C, please.
Solve C, please.
Solve C, please.

Transcribed Image Text:(A) Write a class called Course having data members:
courseNum (String such as ITCS214), courseName (String such as Data Structures),
credits (int), section (int).
Include the following public methods in the class:
Default constructor (without any parameters), constructor with 4 parameters, set and get
methods for all attributes, equals and toString methods.
(B) Write a class called Student having following data fields:
idNum (long), firstName (String), lastName (String), gender (char), email (String),
coursesRegistered (ArrayList of type Course).
Note that coursesRegistered is a list of type ArrayList (Java class) in which each element
is of class type Course. The coursesRegistered is the list of courses in which the
student is currently registered.
It has following methods:
Default constructor (without any parameters), constructor with 5 parameters (except for
coursesRegistered), set and get methods for all attributes, equals, and
printCoursesRegistered.
The list coursesRegistered is created as an empty list in the constructors. The equals
method compares two objects of type Student based on their idNums.

Transcribed Image Text:(C) Write a class called Roster having following data members:
studentsList: list of students – LinkedList (JCF Class), each element is of type
Student, size: actual number of objects of type Student in the studentsList.
Include following methods in this class:
(i) Constructor without any parameter. Create studentsList as empty list and initialize
size to 0.
(ii) addstudent:
Object of type Student is passed as parameter. If the object already exists in the list,
then do not add the object and return false, else return true after successfully adding the
object.
inserts a new Student object at the end of the studentsList.
(iii) deletestudent: deletes a Student object from the studentsList. The idNum
of the Student is passed as parameter. If the object is not found in the
studentsList, then the object cannot be deleted and the method returns false, else
the method returns true, after successfully deleting the object.
(iv) searchStudent: searches the studentsList by idNum, passed as parameter. If
the object is found, it returns its location in the studentsList, else returns -1.
(v) isEmpty: returns true, if the studentsList is empty, else returns false.
(vi) listSize: returns instance variable size.
(vii) getStudent: accepts a parameter index of type int and returns the object of type
Student in studentList at location index.
(viii) addCourse: accepts an object of type Course as the first parameter and the idNum
of the Student as the second parameter. The Course can be added only if the
(a) Student object with the specified idNum exists in the studentsList,
(b) Course does not exist in the coursesRegistered list for the Student,
(c) After adding the course, the number of credits, do not exceed 18.
If the course is added successfully, return true, else return false.
(ix) deleteCourse: accepts an object of type Course as the first parameter and the
idNum of the Student as the second parameter. The Course can be deleted only if the
Student exists in the studentList and the Course exists in the list of courses
registered for that student.
(x) printStudentDetails: accepts idNum of Student as a parameter and prints all
the details of the Student and also all the details of the courses in which the Student is
registered.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 6 steps with 5 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Let the universe of discourse be the set of negative integers. By selecting True or False, give the truth value of the following: ForEvery x (| 2x + 1 | > 1). True Falsearrow_forwardLet f (n) and g(n) be positive functions (for any n they give positive values) and f (n) = O(g(n)).Prove or disprove the following statement:arrow_forwardUse Python to solve:arrow_forward
- A set SS of strings of characters is defined recursively by aa and bb belong to SS . If xx belongs to SS , so does xbxb . Which one of the following strings belong to SS ? this is the Group of answer choices 1. aba 2. bbbbb 3. ab 4. aaab 5. aarrow_forwardDO NOT COPY FROM OTHER WEBSITES Upvote guarenteed for a correct and detailed answer. Thank you!!!arrow_forwarda)Write a recursive definition for the set of odd positive integers. b)Use master theorem to find the solution to the recurrence relation f(n) = 4f(n/2) + 2? ! ,when n = 2" , where k is a positive integer and f(1) = 1.arrow_forward
- Do not copy from other websites. Correct and detailed answer will be Upvotedarrow_forwardWhich of the following is correct to Greedy Algorithm? a. It solves a problem by breaking down a problem into "non-overlapping" sub-problems. O b. It solves a problem by trying all possible options. O c. It solves a problem by getting the best option of each step during operations. O d. It solves a problem by breaking down a problem into "overlapping" sub-problems.arrow_forwardLet the universe of discourse be the set of positive integers. By selecting True or False, give the truth value of the following: ThereExistsUnique x (x = 2x + 1). True ○ Falsearrow_forward
- I’m meeting help with part C of this problem which is finding a recursive solution. The first picture shows you the problem and the second picture is the recursive solution that I have developed which is not working. Any help would be appreciated.arrow_forwardNo handwritten solution ...write the answer in textarrow_forwardYour solution is completely incorrect as where did oyu get 5E could oyu please correct your asnwer? both part a and part barrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education