Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!

Sean Mcintosh

Ranch Hand
+ Follow
since Mar 09, 2018
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sean Mcintosh

Hi everyone. I'm attempting to make a pretty simple registration form in Java using GridPane. I'm using Rectangle to simluate the text boxes and the Register and Cancel buttons don't do anything (for now)

The issue I'm running into is when I attempt to run my code. I get an error that I'll attach to this post. I don't understand what the issue is. Any help is greatly appreciated

Here is my code




Thank you for any help
1 day ago

Campbell Ritchie wrote:Maybe try running your code at the terminal/command line rather than your IDE. (Is that NetBeans?) Copy and paste the entire code into suitable XXX.java file(s) and try running it.



I use IntelliJ but yeah. I ran it in Command Line and it works just fine. Weird but I'll take it. Thank you and Paul Clapham for all your help on this!
4 days ago
Odd. That's exactly what it's suppose to display. Wonder why it's not doing that for me
5 days ago
You'll have to forgive me. The only thing I know about debugging would be to add a println to see if it prints out. Is that what you're talking about?
5 days ago
Here is my current code

Car Class



CertifiedPreOwnedCar Class



and the testCar Class

5 days ago
One last question... I hope. I've got no flagrant errors in my code but when I run my code, it's not showing the results of my 3 test cars. It's just blank. Did i miss something?
6 days ago

Dave Tolls wrote:Your class is called CertifiedPreOwnedCar .
You are, however, declaring accord as of type CertifiedPreOwnCar .



lol I feel foolish now. Spelling errors will get you everytime
6 days ago
I see that I used it in my CertifiedPreOwned Class but my Car class doesn't check for it. Is that where I went wrong? I'm sorry for all the questions
1 week ago

Campbell Ritchie wrote:Which methods can it not find?

Please use proper names for your constructor parameters; if you use the idiom this.xyz&xa0;=... there is no need to us abbreviated names like ma.
Do you need any setWarrantyXXX() methods? Do you have some means of running up mileage/age of car to make it come out of warranty?



It can't seem to find the methods in the testCar class on Lines 14 through 18

I'll change the constructor names to be proper instead of abbreviated

I was using the warrantyYears methods to check if the car was still in the time limit and mileage limit for a warranty. For example, the M6 in the testCar class is 6 years old but has no miles on it. It is still under warranty. Basically, I'm using it to set how long the warranty for the car is so that when it does the check in the CertifiedPreOwned class on Lines 26 and 27, it will check if all my conditions are met

1 week ago
Hello all,

Been a while since I needed help on my Java homework from school but I need help now.

So I have this assignment

1. Create a Car class and a subclass CertifiedPreOwnCar class that inherits from Car. Both Car and CertifiedPreOwnCar have a isCoveredUnderWarranty() method, which returns a boolean.  This method will determine whether the car is covered under warranty based on coverage years and miles, whichever comes first.  checkWarrantyStatus() method will print warranty information to inform the user whether the car is under warranty or not.

2. Create a test program called TestCar.  Create different Car objects and CertifiedPreOwnCar objects and invoke the checkWarranty() method on them.

So I worked on it and here is what I came up with. The issue I'm running into is in the testCar class. When I attempt to run it, I get multiple errors saying it can't resolve the methods in the testCar for the Honda Accord I put in. What am I doing wrong? Thanks for the help


Car Class



CertifiedPreOwnedCar class



testCar class

1 week ago
Hello all,

Looking for some help with a mad lib tutorial I found online for Javascript. I've made modifications to it to allow for more user input but now I'm having issues with the error message. I've made it so it should display my usererror when the user does not fill out all the fields but it doesn't seem to be working. Anyone have any ideas. here's my code



and here's my CSS



Any help is appreciated
Also my it wants me to enter percentages for each game. I only want it to use the one percentage and use it across all 5 games. How do I fix that?
2 years ago
Fixed it



Now my output looks like

Please Enter a Free Throw Percentage:
55
Game 1
In
Out
Out
In
Out
Out
Out
Out
Out
Out
0


How do I get rid of the 0 at the end
2 years ago
Excellent! That helped me quite a bit. I think I'm almost there



Although now it keeps asking me to enter the free throw percentage every single return and then the output looks like this

Game 1
Please Enter a Free Throw Percentage:
44
In
Please Enter a Free Throw Percentage:
55
In
Please Enter a Free Throw Percentage:

There's something not looping correctly here and I don't know what. I thought I had fixed my code so that it would print the results of each game on one line
2 years ago
That did a bit. Thank you. So here's where I'm at now




As you can see, I added line 13 in an attempt to get the "Game" to start at "Game 1" and not "Game 0" not working so far but I hope to get that figured out. Also if I am correct I need to take Lines 21-26 and put them somewhere else. Inside my main method? I'm not sure

I'm a bit confused about this bit of code you posted though



I take it the "..." needs to be something but I have no idea what. Thank you so much for continuing to help me.
2 years ago