4 Replies - 21248 Views - Last Post: 09 May 2008 - 05:08 PM Rate Topic: -----

#1 AZZHHOLES   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 09-July 05

help with making a grade book

Posted 09 July 2005 - 03:31 PM

ok i am trying to complete this work here..if anyone can help me, *hugs*

Modify class GradeBook. Include a second string instance variable that represents the name of the course's instructor. provide a set method and a get method to retrieve it. modify the constructor to speciy two perameters - one for the course and one for the instructors name. modify method displaymessage such that it first outputs the welcome message and course name, then outputs "this course is presented by: "followed by the instructors name. modify the test application to demonstrate the class's new capabilities.


SAMPLE OUTPUT:
Welcome to the gradebook for
CS101 Introduction to Java Programming!
This course is presented by: Sam Smith

Changing instructor name to Judy Jones

Welcome to the gradebook for
CS101 Introduction to Java Programming!
This course is presented by: Judy Jones


HERE IS THE FIRST PAGE

public class GradeBook
{
private String courseName; // course name for this GradeBook
/* WRITE CODE TO DECLARE A SECOND STRING INSTANCE VARIABLE*/
// constructor initializes courseName with String supplied as argument
public GradeBook( String name )
{
courseName = name; // initializes courseName
} // end constructor

// method to set the course name
public void setCourseName( String name )
{
courseName = name; // store the course name
} // end method setCourseName

// method to retrieve the course name
public String getCourseName()
{
return courseName;
} // end method getCourseName

/*WRITE CODE TO DECLARE A GET AND A SET METHOD FOR THE INSTRUCTOR'S NAME*/
// display a welcome message to the GradeBook user
public void displayMessage()
{
// this statement calls getCourseName to get the
// name of the course this GradeBook represents
System.out.printf( "Welcome to the grade book for\n%s!\n",
getCourseName() );
/*WRITE CODE TO OUTPUT THE INSTRUCTOR'S NAME*/
} // end method displayMessage
} // end class GradeBook


HERE IS THE SECOND PAGE

public class GradeBookTest
{
// main method begins program execution
public static void main( String args[] )
{
// create GradeBook object
GradeBook gradeBook1 = new GradeBook(
"CS101 Introduction to Java Programming" );

// display initial value of courseName for each GradeBook
System.out.printf( "gradeBook1 course name is: %s\n",
gradeBook1.getCourseName() );
/*WRITE CODE TO CHANGE INSTRUCTOR'S NAME AND OUTPUT CHANGES */
} // end main

} // end class GradeBookTest

This post has been edited by AZZHHOLES: 09 July 2005 - 03:33 PM


Is This A Good Question/Topic? 0
  • +

Replies To: help with making a grade book

#2 Hopecomputers   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 09-May 08

Re: help with making a grade book

Posted 09 May 2008 - 03:15 PM

View PostAZZHHOLES, on 9 Jul, 2005 - 03:31 PM, said:

ok i am trying to complete this work here..if anyone can help me, *hugs*

Modify class GradeBook. Include a second string instance variable that represents the name of the course's instructor. provide a set method and a get method to retrieve it. modify the constructor to speciy two perameters - one for the course and one for the instructors name. modify method displaymessage such that it first outputs the welcome message and course name, then outputs "this course is presented by: "followed by the instructors name. modify the test application to demonstrate the class's new capabilities.


SAMPLE OUTPUT:
Welcome to the gradebook for
CS101 Introduction to Java Programming!
This course is presented by: Sam Smith

Changing instructor name to Judy Jones

Welcome to the gradebook for
CS101 Introduction to Java Programming!
This course is presented by: Judy Jones


HERE IS THE FIRST PAGE

public class GradeBook
{
private String courseName; // course name for this GradeBook
/* WRITE CODE TO DECLARE A SECOND STRING INSTANCE VARIABLE*/
// constructor initializes courseName with String supplied as argument
public GradeBook( String name )
{
courseName = name; // initializes courseName
} // end constructor

// method to set the course name
public void setCourseName( String name )
{
courseName = name; // store the course name
} // end method setCourseName

// method to retrieve the course name
public String getCourseName()
{
return courseName;
} // end method getCourseName

/*WRITE CODE TO DECLARE A GET AND A SET METHOD FOR THE INSTRUCTOR'S NAME*/
// display a welcome message to the GradeBook user
public void displayMessage()
{
// this statement calls getCourseName to get the
// name of the course this GradeBook represents
System.out.printf( "Welcome to the grade book for\n%s!\n",
getCourseName() );
/*WRITE CODE TO OUTPUT THE INSTRUCTOR'S NAME*/
} // end method displayMessage
} // end class GradeBook


HERE IS THE SECOND PAGE

public class GradeBookTest
{
// main method begins program execution
public static void main( String args[] )
{
// create GradeBook object
GradeBook gradeBook1 = new GradeBook(
"CS101 Introduction to Java Programming" );

// display initial value of courseName for each GradeBook
System.out.printf( "gradeBook1 course name is: %s\n",
gradeBook1.getCourseName() );
/*WRITE CODE TO CHANGE INSTRUCTOR'S NAME AND OUTPUT CHANGES */
} // end main

} // end class GradeBookTest

Was This Post Helpful? 0
  • +
  • -

#3 rgfirefly24   User is offline

  • D.I.C Lover
  • member icon


Reputation: 473
  • View blog
  • Posts: 2,218
  • Joined: 07-April 08

Re: help with making a grade book

Posted 09 May 2008 - 03:24 PM

View PostHopecomputers, on 9 May, 2008 - 03:15 PM, said:

View PostAZZHHOLES, on 9 Jul, 2005 - 03:31 PM, said:

ok i am trying to complete this work here..if anyone can help me, *hugs*

Modify class GradeBook. Include a second string instance variable that represents the name of the course's instructor. provide a set method and a get method to retrieve it. modify the constructor to speciy two perameters - one for the course and one for the instructors name. modify method displaymessage such that it first outputs the welcome message and course name, then outputs "this course is presented by: "followed by the instructors name. modify the test application to demonstrate the class's new capabilities.


SAMPLE OUTPUT:
Welcome to the gradebook for
CS101 Introduction to Java Programming!
This course is presented by: Sam Smith

Changing instructor name to Judy Jones

Welcome to the gradebook for
CS101 Introduction to Java Programming!
This course is presented by: Judy Jones


HERE IS THE FIRST PAGE

public class GradeBook
{
private String courseName; // course name for this GradeBook
/* WRITE CODE TO DECLARE A SECOND STRING INSTANCE VARIABLE*/
// constructor initializes courseName with String supplied as argument
public GradeBook( String name )
{
courseName = name; // initializes courseName
} // end constructor

// method to set the course name
public void setCourseName( String name )
{
courseName = name; // store the course name
} // end method setCourseName

// method to retrieve the course name
public String getCourseName()
{
return courseName;
} // end method getCourseName

/*WRITE CODE TO DECLARE A GET AND A SET METHOD FOR THE INSTRUCTOR'S NAME*/
// display a welcome message to the GradeBook user
public void displayMessage()
{
// this statement calls getCourseName to get the
// name of the course this GradeBook represents
System.out.printf( "Welcome to the grade book for\n%s!\n",
getCourseName() );
/*WRITE CODE TO OUTPUT THE INSTRUCTOR'S NAME*/
} // end method displayMessage
} // end class GradeBook


HERE IS THE SECOND PAGE

public class GradeBookTest
{
// main method begins program execution
public static void main( String args[] )
{
// create GradeBook object
GradeBook gradeBook1 = new GradeBook(
"CS101 Introduction to Java Programming" );

// display initial value of courseName for each GradeBook
System.out.printf( "gradeBook1 course name is: %s\n",
gradeBook1.getCourseName() );
/*WRITE CODE TO CHANGE INSTRUCTOR'S NAME AND OUTPUT CHANGES */
} // end main

} // end class GradeBookTest



to both: please remember to in case your code in the code brackets (pound symbol on the toolbar) [*code] your code here [*/code] with out the asterisk
Was This Post Helpful? 0
  • +
  • -

#4 Martyr2   User is offline

  • Programming Theoretician
  • member icon

Reputation: 5496
  • View blog
  • Posts: 14,470
  • Joined: 18-April 07

Re: help with making a grade book

Posted 09 May 2008 - 03:38 PM

And please do not bump old threads. This thread was from 2005 for gods sake!
Was This Post Helpful? 0
  • +
  • -

#5 rgfirefly24   User is offline

  • D.I.C Lover
  • member icon


Reputation: 473
  • View blog
  • Posts: 2,218
  • Joined: 07-April 08

Re: help with making a grade book

Posted 09 May 2008 - 05:08 PM

View PostMartyr2, on 9 May, 2008 - 03:38 PM, said:

And please do not bump old threads. This thread was from 2005 for gods sake!


wow I so shouldn't assume that posts are new lol.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1