[Solved] SOLVED:Program 1: Writing Your Own Class

30 $

File Name: SOLVED:Program_1:_Writing_Your_Own_Class.zip
File Size: 376.8 KB

SKU: [Solved] SOLVED:Program 1: Writing Your Own Class Category: Tag:

Or Upload Your Assignment Here:


PurposeThe purpose of this assignment is to learn how to write a simple class on your own.PartnersYou may (and are encouraged to) work with at most one other partner on this assignment. You and your partner must be in the same lab section. If you work with a partner, submit one solution with both of your names on it.AssignmentCreate a BlueJ project named Program1. Add a class named Driver and then copy this code into it. Add a second class named Course. You must write the Course class yourself. The three instance variables for Course arename, a String such as “CSCI 111”credits, an integer such as 4costPerCredit, a double such as 200.00The constructor for the class ispublic Course(String inName, int inCredits, double inCostPerCredit)The methods for the class arepublic String getName() – returns the name of the coursepublic int getCredits() – returns the course creditspublic double getCostPerCredit() – returns the cost per creditpublic double getCourseCost() – returns the cost of the course. This can be calculated by multiplying the number of credits for the course by the cost per credit.Desired OutputIf you have implemented the Course class correctly, this output will be produced when the main method of Driver is run.Grading – 100 points15 points – the three instance variables are correct (5 points each)15 points – the constructor is correct60 points – the four methods are correct (15 points each)10 points – Course.java is commented appropriately

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] SOLVED:Program 1: Writing Your Own Class
30 $