Advertisement
Guest User

Untitled

a guest
Jul 10th, 2019
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class CourseInformation {
  4. public static void main(String[] args) {
  5. Scanner scnr = new Scanner(System.in);
  6.  
  7. Course myCourse = new Course();
  8. OfferedCourse myOfferedCourse = new OfferedCourse();
  9.  
  10. String courseNumber, courseTitle;
  11. String oCourseNumber, oCourseTitle, instructorName, term, classTime;
  12.  
  13. courseNumber = scnr.nextLine();
  14. courseTitle = scnr.nextLine();
  15.  
  16. oCourseNumber = scnr.nextLine();
  17. oCourseTitle = scnr.nextLine();
  18. instructorName = scnr.nextLine();
  19. term = scnr.nextLine();
  20. classTime = scnr.nextLine();
  21.  
  22. myCourse.setCourseNumber(courseNumber);
  23. myCourse.setCourseTitle(courseTitle);
  24. myCourse.printInfo();
  25.  
  26. myOfferedCourse.setCourseNumber(oCourseNumber);
  27. myOfferedCourse.setCourseTitle(oCourseTitle);
  28. myOfferedCourse.setInstructorName(instructorName);
  29. myOfferedCourse.setTerm(term);
  30. myOfferedCourse.setClassTime(classTime);
  31. myOfferedCourse.printInfo();
  32.  
  33. System.out.println(" Instructor Name: " + myOfferedCourse.getInstructorName());
  34. System.out.println(" Term: " + myOfferedCourse.getTerm());
  35. System.out.println(" Class Time: " + myOfferedCourse.getClassTime());
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement