Only accepting a double or integer in a while loop

2021.12.02 22:38 Bud_wisser Only accepting a double or integer in a while loop

Hey guys so I'm still pretty new to java so any help would be immensely appreciated.
I'm trying to get an input that will only be accepted if it's an input or double. If anything else is put through it should continue to repeat. Right now I have it working as long as the number isn't below 0.

Are there any simple ways to make this loop also NOT accept a string?


Here's my block in the specified section so far:

import java.util.Scanner; public class Paint1 { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); double wallHeight; double wallWidth; double wallArea; double gallonsPaintNeeded; final double squareFeetPerGallons = 350.0; wallHeight = -1; while (wallHeight < 0){ System.out.println("Enter wall height (feet): "); wallHeight = scnr.nextDouble(); } try{ wallHeight = scnr.nextDouble(); } catch (NumberFormatException e){ wallHeight = -1; } 
Thanks for any help
submitted by Bud_wisser to javahelp [link] [comments]


2021.12.02 22:38 mnr_omar Looking for good team players!

Looking for the next positions: -striker -cdm -LB
Ps4 Psn: mnromar
Be quick! We are also streaming on twitch
submitted by mnr_omar to fifaclubs [link] [comments]


2021.12.02 22:38 Zabreneva The lumbering Perrin wolf zombie… wow.. worst episode so far.

submitted by Zabreneva to whitecloaks [link] [comments]


2021.12.02 22:38 ilovemesomesnl What is the era defining episode of each era? Meaning the episode with the most impact I’ll include ties for most Impactful.

Four eras I’m gonna write down First era- Season 1 episodes 1 and 2 it’s self explanatory for episode 1 but for episode 2 since it was a practical concert snl changed the format afterwards and that format for the most part hasn’t changed since. Dick ebersol years- Eddie’s hosting gig as a cast member this episode truly defined the era and prescribe Eddie as the best of that time and all time really. Wiigs era- Kerry Washington episode exposed the need for diversity Current era-trump episode this got the man elected 😂
submitted by ilovemesomesnl to LiveFromNewYork [link] [comments]


2021.12.02 22:38 TurtleShoe511 I Finally Get It!... True Meaning Behind Duviri Paradox

Ok so in the trailer for Duviri Paradox, we see the young operator and the older adult operator. This is clearly a nod to the release date of DP. The young operator represents us when the trailer originally dropped and the 40yr old adult operator is us when they finally release it!
submitted by TurtleShoe511 to Warframe [link] [comments]


2021.12.02 22:38 AutoNewspaperAdmin [Sports] - Steve Nash: Nets still in process of establishing identity | NY Post

[Sports] - Steve Nash: Nets still in process of establishing identity | NY Post submitted by AutoNewspaperAdmin to AutoNewspaper [link] [comments]


2021.12.02 22:38 PoetJustice Will I have sex tonight

View Poll
submitted by PoetJustice to AtlantaHawks [link] [comments]


2021.12.02 22:38 Portlandiaman2 How to test all workers in one big loop?

Hi!
I have an application with A LOT of different background workers. Some of them are quite complex and have quite long names, and typos are easy to slip in, causing a "We expected MODULE to be found file.rb, but it was not" errors. I'm sure there is a better way to organize this, which I'm curious to hear about, but to start -- is there any way I can write a test that will loop through all workers in /workers folder and test that it's actually a working constant and named correctly with no typos?

Let me know your thoughts!
submitted by Portlandiaman2 to rails [link] [comments]


2021.12.02 22:38 Holliday-East This games feels like my first ever girlfriend

We all have those high school loves which lasted months but can never forget.
I’m much older and even married now and have no intention on going back. But its comes back to my mind once ever year.
Its a good memory but not for reality. Thats what fo76 feels like for me 😂
submitted by Holliday-East to fo76 [link] [comments]


2021.12.02 22:38 be3012 I made this and kinda liked it

I made this and kinda liked it submitted by be3012 to drawing [link] [comments]


2021.12.02 22:38 grudthak First Hero Mini Painted up last night

submitted by grudthak to Heroquest [link] [comments]


2021.12.02 22:38 AutoNewspaperAdmin [Entertainment] - The biggest thing out of Miami Art Week is 10-year-old child prodigy Andres Valencia | NY Post

[Entertainment] - The biggest thing out of Miami Art Week is 10-year-old child prodigy Andres Valencia | NY Post submitted by AutoNewspaperAdmin to AutoNewspaper [link] [comments]


2021.12.02 22:38 Icy_Respect_9284 Let’s go!

Let’s go! submitted by Icy_Respect_9284 to LGVN [link] [comments]


2021.12.02 22:38 fuck-these_mods- Anyone remember this gem? Arcus Odyssey released by Renovation Products in 1991.

Anyone remember this gem? Arcus Odyssey released by Renovation Products in 1991. submitted by fuck-these_mods- to SEGA [link] [comments]


2021.12.02 22:38 lucky666123 fatloner

fatloner submitted by lucky666123 to YoutubeSelfPromotion [link] [comments]


2021.12.02 22:38 SaIdikas We all know

We all know submitted by SaIdikas to FUCKFACEPOD [link] [comments]


2021.12.02 22:38 The-Bobomb-Expert Songs that I want in JSAB2 (if that will ever exist). Sorry for the blurry images.

Songs that I want in JSAB2 (if that will ever exist). Sorry for the blurry images. submitted by The-Bobomb-Expert to JustShapesAndBeats [link] [comments]


2021.12.02 22:38 ExamplePlayful9609 BlitzFactions Realm

BlitzFactions Realm | Starter Kit | /Spawn Command | Join Today! | Code is: vup5iUpLYC4
submitted by ExamplePlayful9609 to MinecraftBuddies [link] [comments]


2021.12.02 22:38 doorknob101 Retarded and Fire

I'm 38 with $7.5m net worth. Married, no kids. Goal is $10m. My wife and I are both in tech, and she recently became retarded by a bus this year. As we get closer to the goal, I'm considering my own ability to FIRE. I'm growing concerned that I actually can't do it, and it's not about money.
I fully agree with the notion that you need something to FIRE to, and unfortunately this is what I lack due to my condition. I was recently diagnosed with high-functioning retardation (aka Democrat). My condition expresses itself in many forms, but the relevant part is that I misunderstand 99.9% of things. There are only a handful of activities that I can actually get into, for example, masturbation, and when I do they quickly become unhealthy obsessions rather than hobbies. I'm fortunate that I find my therapy interesting, and I credit my condition for allowing me to masturbate hard and long (which sometimes causes bleeding). My fear is that stopping masturbation would boith mean losing one of a few interests I have left, and leaving the stability of an enforced sex life.
I'm reaching out to this community to see if there's anyone else out there in a similar position. If you have a similar condition and you're on the FIRE track, or you've been FIRED, how are you dealing with this issue? And how did you become retarded. For me, I was retarded by a bus. At the trial, he said that I was making fun of him. I was.
submitted by doorknob101 to fijerk [link] [comments]


2021.12.02 22:38 brookeanne2233 Recommended gems/gear for frontline scholar?

So, I have my scholar MC in the frontline. What gems and gear are recommended for this? Also in front is Wa’ner, with Lord Yi, Xuanji, and Pan an in the back.
submitted by brookeanne2233 to RoyalChaos [link] [comments]


2021.12.02 22:38 Express_Payment2429 Sketchy Dorms?

Are there any specific buildings or dorms I should avoid when choosing housing? Is there anywhere that I should definitely consider when choosing?
submitted by Express_Payment2429 to utc [link] [comments]


2021.12.02 22:38 Lonely-dude Made a ballsona for Fatima ! The oc I posted earlier now with some stablished xeno’s!!

Made a ballsona for Fatima ! The oc I posted earlier now with some stablished xeno’s!! submitted by Lonely-dude to XenogendersAndMore [link] [comments]


2021.12.02 22:38 OkEve93 Visible first month $5

Enter code at checkout: 37769S7
https://www.visible.com/get/37769S7
.
submitted by OkEve93 to visiblereferralcodes [link] [comments]


2021.12.02 22:38 estebandelapooface Beth Phoenix Announces NXT Departure

Beth Phoenix Announces NXT Departure submitted by estebandelapooface to Wrasslin [link] [comments]


2021.12.02 22:38 c345rt 👽💫

submitted by c345rt to 420 [link] [comments]


http://sch156.ru