Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

THIS IS MY Student.java CLASS THAT HAS MY METHODS package student.schedule; import java.util.Scanner; /** * * @author Malek Badwan */ public class Student { //Instance

image text in transcribedimage text in transcribedimage text in transcribed THIS IS MY Student.java CLASS THAT HAS MY METHODS

package student.schedule;

import java.util.Scanner;

/** * * @author Malek Badwan */ public class Student { //Instance Data private final int MAX_COURSES = 6;

private String studentName; private String studentID; private String streetAddress; private String city; private String state; private String zipCode; private String major; private int totalCredits; private int numberCourses; private String schedule[];

public Student (String name, String id, String address, String c, String s, String zip, String m) { studentName = name; studentID = id; streetAddress = address; city = c; state = s; zipCode = zip; major = m; totalCredits = 0; numberCourses = 0; schedule = new String [MAX_COURSES]; } public String toString() { String msg = ""; msg+= "Student Name: "+studentName + " "; msg+= "Student ID: "+studentID+ " "; msg+= "Student adress: "+streetAddress+ " "; msg+= "Student city: "+city+ " "; msg+= "Student Major: "+major + " "; return msg; } private boolean CheckCredits(int numCredits) { boolean result = false; if((totalCredits + numCredits)

THIS IS MY MAIN CLASS StidentSchedule.java

package student.schedule;

/** * * @author Malek Badwan */ public class StudentSchedule {

/** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here Student rich; rich = new Student( "Richard", "123", "" + "123 someplace", "syracuse", "NY", "13031", "computer science"); System.out.print(rich); System.out.println("the total credits is " + rich.TotalCredit()); rich.AddCourse("CSC111", 4); rich.AddCourse("CSC101", 1); rich.AddCourse("his111", 3); rich.AddCourse("psy231", 3); rich.AddCourse("wad321", 3); System.out.print( rich.DisplaySchedule()); }

i'm stuck and cant find the right syntax for the last two methods ill deffinatly give a big thumbs up if you can help me out with this... thanks

Program Assignment: Add two more methods to the Class Student. One that will search the student's schedule for a course and one that will allow the User to drop a course. The name of the first method will be dropCourse and the name of the second method will be searchCourse. Be sure to test both methods thoroughly, The Search Course Method his method will allow a student to search for a course name from their existing schedule Use a WHILE loop that will stop when one of two conditions is true: either the course is found OR you have reached the last course in the schedule and did not have a match. . If the course is found then print out the course name and number of credits. If the course is not found then print out a message stating the course is not listed on the student's schedule. Only search through existing courses. If the array is not full and you search the entire array your program will have a run-time error. Here are the specifications for this method Parameters and Data Type Public/Private Method Name escr?ptioin eturn Value and Data Type Public searchCourse Searches through the Course oid xisting courses in name: String the array for a articular course ame. Displays one f two messages: Name of course and number f credits if found R message stating ot found that the course was

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions

Question

=+free to pirate employees from competitors?

Answered: 1 week ago