Welcome to Dream.In.Code
Getting Java Help is Easy!

Join 86,269 Java Programmers. There are 1,878 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Java Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

help with making a grade book

 
Reply to this topicStart new topic

help with making a grade book, please help me

AZZHHOLES
post 9 Jul, 2005 - 03:31 PM
Post #1


New D.I.C Head

*
Joined: 9 Jul, 2005
Posts: 2



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: 9 Jul, 2005 - 03:33 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


Hopecomputers
post 9 May, 2008 - 03:15 PM
Post #2


New D.I.C Head

*
Joined: 9 May, 2008
Posts: 6

QUOTE(AZZHHOLES @ 9 Jul, 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

User is offlineProfile CardPM
Go to the top of the page
+Quote Post

rgfirefly24
post 9 May, 2008 - 03:24 PM
Post #3


D.I.C Head

Group Icon
Joined: 7 Apr, 2008
Posts: 135

QUOTE(Hopecomputers @ 9 May, 2008 - 03:15 PM) *

QUOTE(AZZHHOLES @ 9 Jul, 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




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
User is online!Profile CardPM
Go to the top of the page
+Quote Post

Martyr2
post 9 May, 2008 - 03:38 PM
Post #4


Programming Theoretician

Group Icon
Joined: 18 Apr, 2007
Posts: 3,561

And please do not bump old threads. This thread was from 2005 for gods sake!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

rgfirefly24
post 9 May, 2008 - 05:08 PM
Post #5


D.I.C Head

Group Icon
Joined: 7 Apr, 2008
Posts: 135

QUOTE(Martyr2 @ 9 May, 2008 - 03:38 PM) *

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.
User is online!Profile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/16/08 10:31AM

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month