Search:

Type: Posts; User: javaBoi

Search: Search took 0.09 seconds.

  1. Replies
    18
    Views
    1,351

    Re: Help with Java Program!

    Yeah, the program works perfectly fine now.
  2. Replies
    18
    Views
    1,351

    Re: Help with Java Program!

    Oh no, I needed the question in program (but not in the place I initially had it). Sorry for not being clear from the start.
  3. Replies
    18
    Views
    1,351

    Re: Help with Java Program!

    It is, right? The program does ask for the service package first, then the number of hours used..Or is the program written in the wrong order in terms of execution of the statements?



    public...
  4. Replies
    18
    Views
    1,351

    Re: Help with Java Program!

    import java.util.Scanner;

    public class internetPackage
    {
    public static void main(String[] args)
    {
    String input;
    char servicePackage;
    int hoursUsed, regularHours, extraHours;...
  5. Replies
    18
    Views
    1,351

    Re: Help with Java Program!

    Nope, still gives me the same output, actually..
  6. Replies
    18
    Views
    1,351

    Re: Help with Java Program!

    I wanted to do that, but how would I write it?

    Would this work?

    If (servicePackage != 'A' && servicePackage != 'a' && servicePackage != 'B' && servicePackage != 'b' && servicePackage != 'C' &&...
  7. Replies
    18
    Views
    1,351

    Re: Help with Java Program!

    Oh, sorry. In my previous post, I actually mentioned that I took that "Invalid input. Hours cannot be negative." statement from it's original position and placed it as an ELSE statement for each...
  8. Replies
    18
    Views
    1,351

    Re: Help with Java Program!

    Whoops, my bad. It's under "Default." Towards the end of the program.

    For Switch Statements, "Default" acts like an "Else" incase the conditions being tested are all false, right?



    ...
  9. Replies
    18
    Views
    1,351

    Re: Help with Java Program!

    Okay, I was able to resolve the "Invalid input. Hours cannot be negative" by placing if (hoursUsed < 0) System.out.println("Invalid input. Hours cannot be negative."); into each switch.

    I'm still...
  10. Replies
    18
    Views
    1,351

    Help with Java Program!

    Hi everyone, first time entry. I have a problem with my java program output. It looks like the program logic is correct, but there are still some line of statements that are executed that I do not...
Results 1 to 10 of 11