Class

[CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE]
Last edited on
*Phone number and zip code shows a dot at the end of course because setprecision 0 but if i dont have it will show .00 at the end of each on.


Use a string.
You should of course use a string since a phone number isn't a number (you don't do arithmetic with it) but just a string of digits.

However, I find it strange that showpoint (showing the decimal point even if there's no digits after it) would be set by default.
Last edited on
Thank you both of you. Yeah i mean i tried first without the showpoint but the phone numbers was print like 8888888888.00 and zipcode 77777.00 even when it did not have the showpoint.

Then i was trying to leave it in number data format so i can validate the input. it should not allow the user enter letter on those two, and im trying to that in class function but im not sure how.

Do you know why NewPatient.getStreet() is not showing anything when im running the program?

thank you again.
Then i was trying to leave it in number data format so i can validate the input.


Look at each element in the string. If that element (a char) is not a number, reject the input.
Is there a way to do here void Patient::setPhoneNumber(string pn)
{ phoneNumber = pn; }

or does it has to be in function where im entering the input?
Doing it where you gather the input seems sensible. If you wait until setPhoneNumber and then decide you don't like the input, how will you get fresh input?
as I got it, use string then you will not face such issues.
Topic archived. No new replies allowed.