Help with NetBeans

HELP!!!

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

41 Replies - 1831 Views - Last Post: 17 February 2009 - 04:05 AM Rate Topic: -----

#1 TankerIncident  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 32
  • Joined: 16-February 09

Help with NetBeans

Posted 16 February 2009 - 11:47 PM

I need help using NetBeans I have no clue how to use it and I need to learn ASAP, please help
Is This A Good Question/Topic? 0
  • +

Replies To: Help with NetBeans

#2 Locke  Icon User is offline

  • Sarcasm Extraordinaire!
  • member icon

Reputation: 521
  • View blog
  • Posts: 5,596
  • Joined: 20-March 08

Re: Help with NetBeans

Posted 16 February 2009 - 11:56 PM

My best advice is find a tutorial somewhere and just play around with it.

Search Link
Was This Post Helpful? 0
  • +
  • -

#3 ayman_mastermind  Icon User is offline

  • human.setType("geek");
  • member icon

Reputation: 126
  • View blog
  • Posts: 1,860
  • Joined: 12-December 08

Re: Help with NetBeans

Posted 17 February 2009 - 12:00 AM

This is the official netbeans tutorial, http://java.sun.com/...netbeans_part1/ it will help you get started in netbeans IDE, hope this helps, good luck ;)
Was This Post Helpful? 0
  • +
  • -

#4 TankerIncident  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 32
  • Joined: 16-February 09

Re: Help with NetBeans

Posted 17 February 2009 - 12:52 AM

I basically have to write a program that calculates a customer's monthly bill after picking out of 3 service packages. It should ask the user to enter the letter of the package chosen (A,B, or C) and the # of hours that were used, then it should should display the total charges.

Package A: 9.95 a month with 10 hrs of service, additional hrs 2.00 per hour
Package B: 13.95 a month with 20 hrs of service, additional hrs 1.00 per hour
Package C: 19.95 a month with unlimited access

I think I know how to make the questions appear but what I dont know how to do is to input these numeric values and input it so that when the person picks the package and the amount of hours used it does the calculations. I know this is annoying but if ANYONE can help I'd appreciate it so much.
Was This Post Helpful? 0
  • +
  • -

#5 TankerIncident  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 32
  • Joined: 16-February 09

Re: Help with NetBeans

Posted 17 February 2009 - 01:16 AM

I just need any help I'm completely lost and I need to finish ASAP, please anyone help
Was This Post Helpful? 0
  • +
  • -

#6 ayman_mastermind  Icon User is offline

  • human.setType("geek");
  • member icon

Reputation: 126
  • View blog
  • Posts: 1,860
  • Joined: 12-December 08

Re: Help with NetBeans

Posted 17 February 2009 - 01:21 AM

for the menu you can use a switch statement that takes the input from the user, letter of the package and based on this it does the claculation, here is an example:
//take the input from the user in a variable(for example variable Input)
switch(Input){
case: A
//package a was chosen, take input(number of hours) and  do the calculation
break; 
case: B
//package b was chosen... do as above
break;
case C:
//same as above
break;
default:
//wrong input... 
break;
}


hope this helps, if you could show us some code it would be much better thanks ;)

This post has been edited by ayman_mastermind: 17 February 2009 - 01:22 AM

Was This Post Helpful? 0
  • +
  • -

#7 TankerIncident  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 32
  • Joined: 16-February 09

Re: Help with NetBeans

Posted 17 February 2009 - 01:27 AM

You are definately helping me understand this program a lot better, id there any way we can talk through instant message? I'm having trouble with the coding
Was This Post Helpful? 0
  • +
  • -

#8 ayman_mastermind  Icon User is offline

  • human.setType("geek");
  • member icon

Reputation: 126
  • View blog
  • Posts: 1,860
  • Joined: 12-December 08

Re: Help with NetBeans

Posted 17 February 2009 - 01:30 AM

I think it would be better if we solve your problem here as it would benefit more the community and anyone looking for similar help, anyways if you have something very specific or private you can PM me :) btw, please tell us what more you would like to know and show us where you have reached so far with your code... thanks..

This post has been edited by ayman_mastermind: 17 February 2009 - 01:32 AM

Was This Post Helpful? 0
  • +
  • -

#9 TankerIncident  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 32
  • Joined: 16-February 09

Re: Help with NetBeans

Posted 17 February 2009 - 01:37 AM

Yeah you are right sorry about that, alright bear with me because i dont know how to use this program. this is what i think i should categorize the variables

public class InternetServiceProvider {

public static void main(String[] args)
{
double input; //package picked by user
double hours; //hours used by user
double addhrs; //additional hours used by user


the thing is that i pretty much have no clue on how to use this program so i'm winging it

Do i have to first categorize the different variables? and if i do how do i make the coding for combining the answers when it comes to picking a specific package?
Was This Post Helpful? 0
  • +
  • -

#10 ayman_mastermind  Icon User is offline

  • human.setType("geek");
  • member icon

Reputation: 126
  • View blog
  • Posts: 1,860
  • Joined: 12-December 08

Re: Help with NetBeans

Posted 17 February 2009 - 01:39 AM

the addhrs (additional hours) would be the difference between the hours spent and the total allowed hours for the package for exmaple:
addhrs = hours - 20 //this is in case the user chooses package B that has a 20 hours...
as for you input and hours variable it should get the input from the user.., which method does your professor told you to use? Scanner, Buffered Reader, JOptionPane...? btw, your input variable should be either of type string or char because the user will input letters and not decimal numbers, here is the initialization: String input; or you can do char input;

This post has been edited by ayman_mastermind: 17 February 2009 - 01:41 AM

Was This Post Helpful? 0
  • +
  • -

#11 mostyfriedman  Icon User is offline

  • The Algorithmi
  • member icon

Reputation: 727
  • View blog
  • Posts: 4,473
  • Joined: 24-October 08

Re: Help with NetBeans

Posted 17 February 2009 - 01:40 AM

i think you should change input from double to char
import java.util.Scanner;
public class InternetServiceProvider {

	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);//creates a new scanner object
		char input = sc.nextLine().charAt(0); //lets user input a character
		double hours = sc.nextDouble(); //inputs double
		double addhrs = sc.nextDouble();//inputs double
	   
		switch(input)//switch to do the calculations depending on the package
		{
			  case 'A':
			  case 'B':
			  case 'C': 
		}


hope this helps
Was This Post Helpful? 0
  • +
  • -

#12 TankerIncident  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 32
  • Joined: 16-February 09

Re: Help with NetBeans

Posted 17 February 2009 - 01:42 AM

my professor asked to do it in JOptionPane
Was This Post Helpful? 0
  • +
  • -

#13 mostyfriedman  Icon User is offline

  • The Algorithmi
  • member icon

Reputation: 727
  • View blog
  • Posts: 4,473
  • Joined: 24-October 08

Re: Help with NetBeans

Posted 17 February 2009 - 01:44 AM

no problem, then you will take input as string and parse it
Was This Post Helpful? 0
  • +
  • -

#14 ayman_mastermind  Icon User is offline

  • human.setType("geek");
  • member icon

Reputation: 126
  • View blog
  • Posts: 1,860
  • Joined: 12-December 08

Re: Help with NetBeans

Posted 17 February 2009 - 01:45 AM

okay then to get input you will have to do the following after initializing your input variable as string:
input = JOptionPane.showInputDialog(null,"Enter your input");


and the input is taken and stored in the variable input... :)
or if you wan to get your input variable as char, then asign another variable for input such as UserInput as string,
String UserInput;
UserInput = JoptionPane.showInputDialog(null,"Enter your input");


then convert(parse) the string to char to a variable that is input...

This post has been edited by ayman_mastermind: 17 February 2009 - 01:52 AM

Was This Post Helpful? 0
  • +
  • -

#15 TankerIncident  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 32
  • Joined: 16-February 09

Re: Help with NetBeans

Posted 17 February 2009 - 01:56 AM

public class InternetServiceProvider {

public static void main(String[] args) {
Scanner sc = new Scanner(System.in);//creates a new scanner object
char input = sc.nextLine().charAt(0); //lets user input a character
double hours = sc.nextDouble(); //inputs double
double addhrs = sc.nextDouble();//inputs double

switch (input)//switch to do the calculations depending on the package
{
case 'A':
case 'B':
case 'C':

input = JOptionPane.showInputDialog(null, "Enter your input");


Alright so where do i put the values of the packages and the additional hours if they are any? for example for package A it's 9.95 a month and 10 hours of service are provided, if it's over 10 hours it'll charge 2.00 per additional hour, how and where do i write this down?


:( i'm confused again
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3