hey, i'm new to java and i keep getting the return type required error on this line; - public dvds(int productNum, String name, int units, double price, String rating) {
The code for the whole class is as follows; -
// extended class
-
public class dvd extends dvds {
-
-
// rating of the DVD
-
private String rating;
-
-
// constructor
-
public dvds(int productNum, String name, int units, double price, String rating) {
-
super(productNum,name,units, price);
-
this.rating = rating;
-
}
-
-
// getter
-
public String getRating() {
-
return rating;
-
}
-
-
-
// setter
-
public void setRating(String rating) {
-
this.rating = rating;
-
}
-
-
// total value with the 5% fee
-
public double value() {
-
return super.value()*1.05;
-
}
-
-
public double fee() {
-
return super.value()*0.05;
-
}
-
-
public double valueNoFee() {
-
return super.value();
-
}
-
-
// string
-
public String toString() {
-
return String.format(" %03d %-10s %3d $%6.2f $%7.2f %8s",
-
super.getproductNum(), super.getName(), super.getUnits(), super.getPrice(), value(), getRating());
-
}
-
}
-
Any help would be greatly appreciated.
1 5413
Found my mistake...nevermind.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Tim Johansson |
last post by:
I'm new to C++, and tried to start making a script that will shuffle an
array. Can someone please tell me what's wrong?
#include <iostream.h>
#include <string.h>
int main () {...
|
by: Giulio Santorini |
last post by:
Hi,
I've got a little problem with my C# WinForms test
application.
I would like to have a ComboBox showing a a visual value
and some hidden values.
So I build a class able to store thoose...
|
by: melanieab |
last post by:
Hi,
I kind of got thrown into C# without any real programming experience, so I
know this is probably an easy question, but it's driving me crazy. In my
Tabs class, as I'm leaving a tabpage, I'm...
|
by: Raj |
last post by:
Hi,
I was getting an error in my program saying that return keyword must
not be followed by an object expression. I was confused first because I
was using return statement in a valid "if"...
|
by: Ryan McLean |
last post by:
Hi everyone! What is happening is the method: sub_btnSubmitClicked is
being executed every time any other object with a Handler is executed.
I am trying not to use the withevents and handles...
|
by: Erik H. |
last post by:
I have an ASPX page in which I am trying to bind a datagrid to a dataset
pulled from Microsoft Access DB using code inline method. For some reason,
the compiler is having a problem with 'using'....
|
by: MR |
last post by:
I get the following Exception "The data at the root level is invalid. Line
1, position 642" whenever I try to deserialize an incoming SOAP message. The
incoming message is formed well and its...
|
by: markryde |
last post by:
Hello,
Followed here is a simplified code example of something which I
try to implement; in essence , I want to assign a value to a return
value of a method is C. I know, of course, that in this...
|
by: mattehz |
last post by:
Hey there,
I am trying to upload old source files and came across these errors:
Warning: Invalid argument supplied for foreach() in /home/mattehz/public_html/acssr/trunk/inc_html.php on line 59...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |