Question: 1. Course constructor saved Reset to Starter Code 5 points possible Write a constructor for the Course class that takes a String to represent the


1. Course constructor saved Reset to Starter Code 5 points possible Write a constructor for the Course class that takes a String to represent the course subject and an int to represent the course number. It should ensure that the subject is at most 4 characters long and is all capitalized, and that the number is between 400 and 799 (defaulting to 401 if an invalid number was enetered.) You may find the method Character.toUpperCase helpful in this task. I Full Screen v Grading 6 Save Run Tests (6) new Coursel "CS", 300 ) 0/0 pts - Click for details FAILED Course.java + New 1 - public class Course{ 2 3 private String subject; 4 private int number; 5 6 // YOUR CODE HERE 7 8 public String toString(){ 9 return subject number; 10 } 11 12 } new Course "CS", 416 ) 0/0 pts - Click for details FAILED new Course "CS", 999) 0/0 pts - Click for details FAILED new Course "math", 425) 0 / 0 pts - Click for details FAILED new Coursel "MATH", 425 ) 0 / 0 pts - Click for details FAILED new Coursel "MATHEMATICS", 425 ) 0/0 pts - Click for details FAILED city acids with BOVEN Opto Dharwanita kawal the suns) there 12'! Whexacer nadat datbudida Turacarp kalipas Kelias 11: ztus toplu Mas You will have a diet hin' and as a red ultiple laws Crading Pulso ri . prtveld in nu; prinse int unter: : Neque Food HOTRON public Multiltsrint num) { ht. nue this.counter = 1: } Meretas MORIN Nuple Maris2 MER pullic int nextVelo [ int nul - nu courur: Cinter return rul Mb LINKS HOTEN 13 19 ze 21 public void { counter - 1; HOT RUN Wody the tipa casata in the premiscelisquerto BRONCO heves concretes anyone there is no merod hodisanih unicorum 2 rulex The de terme Forecard . 2.X-11: Xatua 3 Hote: You will be dick inward framed Keltspleje Falso Grading Wuns Wence chlit rface See public in next al): phir wis reas) . NOTHLN BMW 2 NOTELS Ik NATHLH 5. Mpumalla NUTELN 5. Muito LITEN Smule NETBLIN M3 NETHLH 1. Course constructor saved Reset to Starter Code 5 points possible Write a constructor for the Course class that takes a String to represent the course subject and an int to represent the course number. It should ensure that the subject is at most 4 characters long and is all capitalized, and that the number is between 400 and 799 (defaulting to 401 if an invalid number was enetered.) You may find the method Character.toUpperCase helpful in this task. I Full Screen v Grading 6 Save Run Tests (6) new Coursel "CS", 300 ) 0/0 pts - Click for details FAILED Course.java + New 1 - public class Course{ 2 3 private String subject; 4 private int number; 5 6 // YOUR CODE HERE 7 8 public String toString(){ 9 return subject number; 10 } 11 12 } new Course "CS", 416 ) 0/0 pts - Click for details FAILED new Course "CS", 999) 0/0 pts - Click for details FAILED new Course "math", 425) 0 / 0 pts - Click for details FAILED new Coursel "MATH", 425 ) 0 / 0 pts - Click for details FAILED new Coursel "MATHEMATICS", 425 ) 0/0 pts - Click for details FAILED city acids with BOVEN Opto Dharwanita kawal the suns) there 12'! Whexacer nadat datbudida Turacarp kalipas Kelias 11: ztus toplu Mas You will have a diet hin' and as a red ultiple laws Crading Pulso ri . prtveld in nu; prinse int unter: : Neque Food HOTRON public Multiltsrint num) { ht. nue this.counter = 1: } Meretas MORIN Nuple Maris2 MER pullic int nextVelo [ int nul - nu courur: Cinter return rul Mb LINKS HOTEN 13 19 ze 21 public void { counter - 1; HOT RUN Wody the tipa casata in the premiscelisquerto BRONCO heves concretes anyone there is no merod hodisanih unicorum 2 rulex The de terme Forecard . 2.X-11: Xatua 3 Hote: You will be dick inward framed Keltspleje Falso Grading Wuns Wence chlit rface See public in next al): phir wis reas) . NOTHLN BMW 2 NOTELS Ik NATHLH 5. Mpumalla NUTELN 5. Muito LITEN Smule NETBLIN M3 NETHLH
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
