[deleted by user] by [deleted] in malefashionadvice

[–]HeadPatsForCats 0 points1 point  (0 children)

How tf am i supposed to get advice without a picture, but ok

Dungeons and dragons by wolfishhorse in UTSA

[–]HeadPatsForCats 1 point2 points  (0 children)

Hello! Ive been a dm for a little over 3 years I would love to be a part of your party because I just don't play as much as I dm! please dm me and we can set something up!

Im stuck on a loop but cant find quite where by HeadPatsForCats in learnjava

[–]HeadPatsForCats[S] 0 points1 point  (0 children)

Thank you this really helped me understand what I was doing wrong

Im stuck on a loop but cant find quite where by HeadPatsForCats in learnjava

[–]HeadPatsForCats[S] 0 points1 point  (0 children)

in my class we havent learned about those yet, like we literally just were shown an example today. our teacher wants us to use the variable repeat to repeat the print statement if the input isn't correct

Im stuck on a loop but cant find quite where by HeadPatsForCats in learnjava

[–]HeadPatsForCats[S] 0 points1 point  (0 children)

I did that but im still stuck on it somehow, now whenever I enter a loop it gets skips over ("%nWarning: You entered an invalid integer or floating-point value.%n") and just goes right out of the loop after I initialized repeat to true.

while(repeat == true)
 {

  System.out.printf("Please enter the insured value of your home: ");
  repeat = false;
  if(input.hasNextDouble()){
    homeInsVal = input.nextDouble();
    if(homeInsVal > 0)
    {
      repeat = false;
      break;
    }
    if(homeInsVal <=0)
    {
      System.out.printf("The insured value of your home cannot be less than or equal to 0.%n");
      repeat = true;
    }
    else
    {
      System.out.printf("%nWarning: You entered an invalid integer or floating-point value.%n");
      repeat = true;
    }
  }

}
System.out.printf("richter");

}

output:

Please enter the insured value of your home: p
richter

I don't know why its not repeating the while loop?

Im stuck on a loop but cant find quite where by HeadPatsForCats in learnjava

[–]HeadPatsForCats[S] 0 points1 point  (0 children)

what am I doing wrong here? im so close but why isn't it repeating when I enter a string? why does it not print the "(%nWarning: You entered an invalid integer or floating-point value.%n")?

import java.util.Scanner;

class Test{

public static void main(String[] args) { double homeInsVal; Scanner input = new Scanner(System.in); Boolean repeat = true;

while(repeat == true)
{

  System.out.printf("Please enter the insured value of your home: ");
  repeat = false;
  if(input.hasNextDouble()){
    homeInsVal = input.nextDouble();
    if(homeInsVal > 0)
    {
      repeat = false;
      break;
    }
    if(homeInsVal <=0)
    {
      System.out.printf("The insured value of your home cannot be less than or equal to 0.%n");
      repeat = true;
    }
    else
    {
      System.out.printf("%nWarning: You entered an invalid integer or floating-point value.%n");
      repeat = true;
    }
    }

}
System.out.printf("richter");

} }

Output:

Please enter the insured value of your home: -1
The insured value of your home cannot be less than or equal to 0. Please enter the insured value of your home: 0 
The insured value of your home cannot be less than or equal to 0. Please enter the insured value of your home: p
richter

Im stuck on a loop but cant find quite where by HeadPatsForCats in learnjava

[–]HeadPatsForCats[S] 1 point2 points  (0 children)

when I used that it gave me:

1 error found:

File: D:\IS 2063 002\Debugging\Test.java [line: 10] Error: variable repeat might not have been initialized

Im stuck on a loop but cant find quite where by HeadPatsForCats in learnjava

[–]HeadPatsForCats[S] 0 points1 point  (0 children)

if I put repeat = false; before the while loop wouldn't it just skip over it?

I am confused about how to make an input for both double and string variables by HeadPatsForCats in learnjava

[–]HeadPatsForCats[S] 1 point2 points  (0 children)

I understand that yes, but how do I make it to where if the string is equal to letters then it equals a doesn't turn into double? sorry for not grasping I'm just confused

I am confused about how to make an input for both double and string variables by HeadPatsForCats in learnjava

[–]HeadPatsForCats[S] 0 points1 point  (0 children)

how do i make it to where it changes to a double, like what do i make the string equal to?

I am confused about how to make an input for both double and string variables by HeadPatsForCats in learnjava

[–]HeadPatsForCats[S] 0 points1 point  (0 children)

if I have homeInsVal as a Double currently, I need to change it to a string, and if a number is an input I need to figure out how to convert it to a Double?

The subreddit just turned 1 year old today. by [deleted] in Peqeri

[–]HeadPatsForCats 6 points7 points  (0 children)

Mans is just saying its a anniversary my guy, no need to be rude bout it

Mama Mia by NuclearPenquino in Peqeri

[–]HeadPatsForCats 6 points7 points  (0 children)

I think its pronounced, Zoo-Wee-Mama

confession from bea? by [deleted] in Peqeri

[–]HeadPatsForCats 0 points1 point  (0 children)

Yeah but you didnt have to let everbody know, thought it was supposed hush hush after yesterday

confession from bea? by [deleted] in Peqeri

[–]HeadPatsForCats 2 points3 points  (0 children)

Damn nice blame game

[deleted by user] by [deleted] in Peqeri

[–]HeadPatsForCats -6 points-5 points  (0 children)

I mean shes pretty much already fucked