Roselyn Bordette

Greenhorn
+ Follow
since Sep 08, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Roselyn Bordette

..I honestly wasn't sure whether or not to come back to this post after working out the code with an instructor and then seeing the new replies come in and with them had figured what was wrong. But, it seemed to be that the program wasn't coded right to the point that it wasn't even using setters and getters properly and couldn't even compile. The constructor was removed, and the final printer scan wasn't needed, but everything else was worked through already, it was just confusion on encapsulation being put together correctly.  Also, using one variable at a time to test if the variables and their values passed through and the object to send data is good for debugging and did help.

And about the 'crossposting', I was pressed for time when the topic was put up, and didn't want to wait on one source for an answer when someone else instead could give one on another website. It seemed better than repeatedly refreshing the page on one site while running out of time. I wasn't aware of it being considered bad practice to do..

Overall, the new code works, here's the end result.


6 days ago
The code only has one setter for each variable but the setter was coded to take in inputs from the user instead, which I suppose the readInputs method should be taking care of instead. The assignment did explain that each private method did have to validate user data and reject it if it wasn't within a certain range, so that's why the inputs where being scanned in each setter method.
1 week ago
Thank you, the scanner part of the code has been changed, and according to assignment, there should be 8 setters for each instance variable, and each one should validate user input. That's why I thought that the object should be there then check if its correct or not within each method. If that is wrong then that code should be in the readInputs method instead, but I wouldn't know how to send each variable from that method to each method since a method can only return one value.
1 week ago
Hi, again. I've reamped the code and have looked through many of the underlying issues, but still am confused on the next steps. Here is the code so far now:



The empty parts are the ones that I'm not sure how to start, but everything else so far is finished, even though the program compiled with errors in certain areas.
1 week ago
I changed the method name and the return type, and the two classes are  HealthRecordDemo, the main method, and HealthRecord, the implementation with all the class methods in it.
1 week ago
Hello, I really could use help on an assignment to code a health record program to collect info on a patient that inputs data about themselves (name, birthday, height, weight etc.) then calculates their BMI and displays all the values in the main method. The programming requires it be be in two classes with input data as private variables using constructors to pass the info around and a main method to display all the values. Anything can be put in for String variables like their name, but for a number variable like age must be within a set range, and if the answer isn't in that range, the user will be prompted on loop until it is. Two methods are public, one to read values and the other to display them, and the setter and getter methods and the BMI calculation methods are private.

I only have this so far:

import java.util.Scanner;


It's been hard to wok with constructors, and trying to work at it, could only code the beginning part of the program. Also the instructor requires students to only use Netbeans though I've only been working with BlueJay up until now. This isn't to rush for an answer from anyone, but any help with the program would very much be appreciated, since its due tonight.
1 week ago