Inventory Program 2, but with the BOOK twist

Please avoid double posting

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »

49 Replies - 1635 Views - Last Post: 06 April 2009 - 06:32 PM Rate Topic: -----

#1 jjones884  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 22-March 09

Inventory Program 2, but with the BOOK twist

Post icon  Posted 01 April 2009 - 06:41 PM

I am so lost in this class... We had an assignment that was changed at the last minute and i cant even start to figure this part out. Here is what is required...

We will be implementing an array to store multiple values. I suggest using a for loop and doing five iterations maximum. You need to prompt for input, create a Book object, and store that object in the array. Then, you need to sort the array by book title and then get a value of all the books...

Then he goes on to say...

The best way to implement Part 2 is to create an array of Book objects of x length. Read your user input into a book object x number of times and store each in the array. You can then use the bubblesort example I posted to sort the array properly. Change the ISBN number to a straight Integer type and sort on that. Worry about sorting by name after you have everything else solved...

Here is what I have... What would be the simplest way to do this???

package inventoryprogram;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) 
		{
	 // main begin Java application

	   

	   BOOK book = new BOOK();


	   Scanner input = new Scanner(System.in);

		String name;
		String ISBN;
		double price;
		double quantity;


		while (true)
			
		

		{
			System.out.println("Inventory Program");
			System.out.println();
			System.out.println();
			System.out.println("\nPlease input the name of the Book (Enter Stop to Exit):");
			book.setName(input.next());
			System.out.println();
			if (!book.getName().equalsIgnoreCase("Stop"))
				
			{

			System.out.print ("Please Input the ISBN:"); //prompt
			book.setISBN(input.next());
			System.out.println();
				 
			System.out.print ("Enter the book price: ");
			book.setprice(input.nextDouble());
			System.out.println();

			System.out.println ("Please Enter the quantity of books");
			book.setquantity(input.nextDouble());
			System.out.println();
				

	System.out.printf("Book Title: %s", book.getName());
	System.out.println();
	System.out.printf("ISBN: %s", book.getISBN());
	System.out.println();
	System.out.printf("Unit Price: $%.2f\n",book.getprice());
	System.out.printf("Total Inventory: $%.2f\n",  book.getprice()*book.getquantity ());
	System.out.println();
	System.out.println();
			}
			 else
				break;
			}
System.out.println("Program Ended");
	

	}
	   
}


package inventoryprogram;


public class BOOK {

	private String name;
	private String ISBN;
	private double price;
	private double quantity;

	public BOOK()

	{
		// call to constructor
		name = "";
		ISBN = "";
		price = 0.0;
		quantity = 0.0;
	}
	//  initialize constructor
	public BOOK(String booknameIn, String ISBNIn, double priceIn, double quantityIn) {

		//call to constructor
		name = booknameIn;
		ISBN = ISBNIn;
		price = priceIn;
		quantity = quantityIn;
	} // end four argument intialization constructor

	public void setName (String name) {
		this.name = name;
	}

	public String getName () {
		return name;
	}

	public void setISBN (String ISBN) {
		this.ISBN = ISBN;
	}

	public String getISBN (){
		return ISBN;
	}
	public void setprice (double price) {
		this.price = price;
	}

	public double getprice () {
		return price;
	}

	public void setquantity (double quantity) {
		this.quantity = quantity;
	}

	public double getquantity () {
		return quantity;
	}

	public double getunitprice () {
		return price * quantity;
	}

}



Please Help...

This post has been edited by jjones884: 01 April 2009 - 07:05 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Inventory Program 2, but with the BOOK twist

#2 Fuzzyness  Icon User is offline

  • Comp Sci Student
  • member icon

Reputation: 669
  • View blog
  • Posts: 2,438
  • Joined: 06-March 09

Re: Inventory Program 2, but with the BOOK twist

Posted 01 April 2009 - 07:00 PM

When you sort it
Character.sort(arrayName);
Forthe beginning while loop, get rid of it and make it a for loop. First prmopt user fornumbers of books to enter. Then make that the length and put all the prompts inside of the for loop and not the while loop.
After you get all the important info that you need to make an object of book. Make on in the loop and add it to an array you need to make. After the loop is over, call the sort method I gave you to sort it. In the Book class, make a toString() method. and in the Main class (btw change that name its bad to name it that) just print the array.toString() and your done I believe :)
Was This Post Helpful? 0
  • +
  • -

#3 jjones884  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 22-March 09

Re: Inventory Program 2, but with the BOOK twist

Posted 01 April 2009 - 07:04 PM

View PostFuzzyness, on 1 Apr, 2009 - 06:00 PM, said:

When you sort it
Character.sort(arrayName);
Forthe beginning while loop, get rid of it and make it a for loop. First prmopt user fornumbers of books to enter. Then make that the length and put all the prompts inside of the for loop and not the while loop.
After you get all the important info that you need to make an object of book. Make on in the loop and add it to an array you need to make. After the loop is over, call the sort method I gave you to sort it. In the Book class, make a toString() method. and in the Main class (btw change that name its bad to name it that) just print the array.toString() and your done I believe :)

THank You for the input... I just dont understand what all that means... I am trying to follow the book but it doesnt really explain anything.
Was This Post Helpful? 0
  • +
  • -

#4 jjones884  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 22-March 09

Re: Inventory Program 2, but with the BOOK twist

Post icon  Posted 01 April 2009 - 07:06 PM

I am so lost in this class... We had an assignment that was changed at the last minute and i cant even start to figure this part out. Here is what is required...

We will be implementing an array to store multiple values. I suggest using a for loop and doing five iterations maximum. You need to prompt for input, create a Book object, and store that object in the array. Then, you need to sort the array by book title and then get a value of all the books...

Then he goes on to say...

The best way to implement Part 2 is to create an array of Book objects of x length. Read your user input into a book object x number of times and store each in the array. You can then use the bubblesort example I posted to sort the array properly. Change the ISBN number to a straight Integer type and sort on that. Worry about sorting by name after you have everything else solved...

Here is what I have... What would be the simplest way to do this???

package inventoryprogram;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) 
		{
	 // main begin Java application

	   

	   BOOK book = new BOOK();


	   Scanner input = new Scanner(System.in);

		String name;
		String ISBN;
		double price;
		double quantity;


		while (true)
			
		

		{
			System.out.println("Inventory Program");
			System.out.println();
			System.out.println();
			System.out.println("\nPlease input the name of the Book (Enter Stop to Exit):");
			book.setName(input.next());
			System.out.println();
			if (!book.getName().equalsIgnoreCase("Stop"))
				
			{

			System.out.print ("Please Input the ISBN:"); //prompt
			book.setISBN(input.next());
			System.out.println();
				 
			System.out.print ("Enter the book price: ");
			book.setprice(input.nextDouble());
			System.out.println();

			System.out.println ("Please Enter the quantity of books");
			book.setquantity(input.nextDouble());
			System.out.println();
				

	System.out.printf("Book Title: %s", book.getName());
	System.out.println();
	System.out.printf("ISBN: %s", book.getISBN());
	System.out.println();
	System.out.printf("Unit Price: $%.2f\n",book.getprice());
	System.out.printf("Total Inventory: $%.2f\n",  book.getprice()*book.getquantity ());
	System.out.println();
	System.out.println();
			}
			 else
				break;
			}
System.out.println("Program Ended");
	

	}
	   
}


package inventoryprogram;


public class BOOK {

	private String name;
	private String ISBN;
	private double price;
	private double quantity;

	public BOOK()

	{
		// call to constructor
		name = "";
		ISBN = "";
		price = 0.0;
		quantity = 0.0;
	}
	//  initialize constructor
	public BOOK(String booknameIn, String ISBNIn, double priceIn, double quantityIn) {

		//call to constructor
		name = booknameIn;
		ISBN = ISBNIn;
		price = priceIn;
		quantity = quantityIn;
	} // end four argument intialization constructor

	public void setName (String name) {
		this.name = name;
	}

	public String getName () {
		return name;
	}

	public void setISBN (String ISBN) {
		this.ISBN = ISBN;
	}

	public String getISBN (){
		return ISBN;
	}
	public void setprice (double price) {
		this.price = price;
	}

	public double getprice () {
		return price;
	}

	public void setquantity (double quantity) {
		this.quantity = quantity;
	}

	public double getquantity () {
		return quantity;
	}

	public double getunitprice () {
		return price * quantity;
	}

}



Please Help...
Was This Post Helpful? 0
  • +
  • -

#5 Fuzzyness  Icon User is offline

  • Comp Sci Student
  • member icon

Reputation: 669
  • View blog
  • Posts: 2,438
  • Joined: 06-March 09

Re: Inventory Program 2, but with the BOOK twist

Posted 01 April 2009 - 07:11 PM

Lol, didnt take them long to move you back here. Don't double post in HW forum and Java forum ;) What i said is pretty straight forward, give me a list of what you dont know how to do and i can try to help. but 3/4ths of what I said is already in your code and just needs to be modified. toString() method is easy and a sort method is easy. Ask a specific question and I can try my best to help.
Was This Post Helpful? 0
  • +
  • -

#6 jjones884  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 22-March 09

Re: Inventory Program 2, but with the BOOK twist

Posted 01 April 2009 - 07:19 PM

View PostFuzzyness, on 1 Apr, 2009 - 06:11 PM, said:

Lol, didnt take them long to move you back here. Don't double post in HW forum and Java forum ;) What i said is pretty straight forward, give me a list of what you dont know how to do and i can try to help. but 3/4ths of what I said is already in your code and just needs to be modified. toString() method is easy and a sort method is easy. Ask a specific question and I can try my best to help.

It sure didnt... Well I guess my problem is that I am a visual learner. I just read your reply like 3 times to try and follow it. No luck. If you have time, can you give me an example of the for loop.
Also, what needs to be modifed and how... I know it may seem like i am asking alot, and I am, I just have no idea what to do. I am not trying to cheapen your knowledge in any way. I am trying to learn the basics so i can get out if this class... It is just a required class
Was This Post Helpful? 0
  • +
  • -

#7 Fuzzyness  Icon User is offline

  • Comp Sci Student
  • member icon

Reputation: 669
  • View blog
  • Posts: 2,438
  • Joined: 06-March 09

Re: Inventory Program 2, but with the BOOK twist

Posted 01 April 2009 - 07:50 PM

I can post it in like an hour got stuff to do. Its just a casual loop, here something to get you started
Scanner in = new Scanner(System.in);
int numBooks;
String bookName;
ArrayList<Book> setOfBooks = new ArrayList<Book>();
System.out.print("How many books would you like ot enter? ");
numBooks = in.nextInt();
for(int i = 0; i <numBooks; i++)
{
System.out.print("Please enter book name: ");
bookName = in.nextLine();
// other prompts go here
}

Just keep asking (prompting) for each part that you need to make an object. then make an book object
Book theBook = new Book(bookName, isbn, price, quantity);
then add it to the array.
setOfBooks.add(theBook);
then make the sort method which will be very small. and then make a toString method to print it all. Simple right? ;)

This post has been edited by Fuzzyness: 01 April 2009 - 07:51 PM

Was This Post Helpful? 0
  • +
  • -

#8 jjones884  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 22-March 09

Re: Inventory Program 2, but with the BOOK twist

Posted 01 April 2009 - 08:47 PM

View PostFuzzyness, on 1 Apr, 2009 - 06:50 PM, said:

I can post it in like an hour got stuff to do. Its just a casual loop, here something to get you started
Scanner in = new Scanner(System.in);
int numBooks;
String bookName;
ArrayList<Book> setOfBooks = new ArrayList<Book>();
System.out.print("How many books would you like ot enter? ");
numBooks = in.nextInt();
for(int i = 0; i <numBooks; i++)
{
System.out.print("Please enter book name: ");
bookName = in.nextLine();
// other prompts go here
}

Just keep asking (prompting) for each part that you need to make an object. then make an book object
Book theBook = new Book(bookName, isbn, price, quantity);
then add it to the array.
setOfBooks.add(theBook);
then make the sort method which will be very small. and then make a toString method to print it all. Simple right? ;)

This really helps... but where do I add these lines... and how do i create the array
Was This Post Helpful? 0
  • +
  • -

#9 Fuzzyness  Icon User is offline

  • Comp Sci Student
  • member icon

Reputation: 669
  • View blog
  • Posts: 2,438
  • Joined: 06-March 09

Re: Inventory Program 2, but with the BOOK twist

Posted 01 April 2009 - 09:00 PM

I created the ArrayList in the segment of code i posted previously. Compare it to your data, does samething almost but simpler code. I really dont want to just give you the code, want to help you through it and understand it.
In the for loop i gave you, finish asking for the prompts. after you do that and make an Book object, and then add it to an array list, put this segment that i got from YOUR code, INTO the for loop after all the prompts
System.out.printf("Book Title: %s", book.getName());
	System.out.println();
	System.out.printf("ISBN: %s", book.getISBN());
	System.out.println();
	System.out.printf("Unit Price: $%.2f\n",book.getprice());
	System.out.printf("Total Inventory: $%.2f\n",  book.getprice()*book.getquantity ());
	System.out.println();
	System.out.println();


and the entire for loop will replace the while loop.

Do you wish it to be sorted Alphabetically, or by the ISBN #?
Was This Post Helpful? 0
  • +
  • -

#10 jjones884  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 22-March 09

Re: Inventory Program 2, but with the BOOK twist

Posted 01 April 2009 - 09:05 PM

View PostFuzzyness, on 1 Apr, 2009 - 08:00 PM, said:

I created the ArrayList in the segment of code i posted previously. Compare it to your data, does samething almost but simpler code. I really dont want to just give you the code, want to help you through it and understand it.
In the for loop i gave you, finish asking for the prompts. after you do that and make an Book object, and then add it to an array list, put this segment that i got from YOUR code, INTO the for loop after all the prompts
System.out.printf("Book Title: %s", book.getName());
	System.out.println();
	System.out.printf("ISBN: %s", book.getISBN());
	System.out.println();
	System.out.printf("Unit Price: $%.2f\n",book.getprice());
	System.out.printf("Total Inventory: $%.2f\n",  book.getprice()*book.getquantity ());
	System.out.println();
	System.out.println();


and the entire for loop will replace the while loop.

Do you wish it to be sorted Alphabetically, or by the ISBN #?

Does that array code go in the Main class? and How will it effect my BOOK class. Do i need to change anything in the BOOK class? is This Right?
[code]package inventoryprogram;
import java.awt.print.Book;
import java.util.Scanner;
import java.util.Arrays;

public class Main {

public static void main(String[] args)
{
// main begin Java application



BOOK book = new BOOK();


Scanner input = new Scanner(System.in);

int numBooks;
String name;
String ISBN;
double price;
double quantity;

ArrayList<Book> setOfBooks = new ArrayList<Book>();
System.out.print("How many books would you like to enter? ");
numBooks = input.nextInt();
for(int i = 0; i <numBooks; i++)
{



{
System.out.println("Inventory Program");
System.out.println();
System.out.println();
System.out.println("\nPlease input the name of the Book (Enter Stop to Exit):");
book.setName(input.next());
System.out.println();
if (!book.getName().equalsIgnoreCase("Stop"))

{

System.out.print ("Please Input the ISBN:"); //prompt
book.setISBN(input.next());
System.out.println();

System.out.print ("Enter the book price: ");
book.setprice(input.nextDouble());
System.out.println();

System.out.println ("Please Enter the quantity of books");
book.setquantity(input.nextDouble());
System.out.println();


System.out.printf("Book Title: %s", book.getName());
System.out.println();
System.out.printf("ISBN: %s", book.getISBN());
System.out.println();
System.out.printf("Unit Price: $%.2f\n",book.getprice());
System.out.printf("Total Inventory: $%.2f\n", book.getprice()*book.getquantity ());
System.out.println();
System.out.println();
}
else
break;
}
System.out.println("Program Ended");


}

}
Was This Post Helpful? 0
  • +
  • -

#11 Fuzzyness  Icon User is offline

  • Comp Sci Student
  • member icon

Reputation: 669
  • View blog
  • Posts: 2,438
  • Joined: 06-March 09

Re: Inventory Program 2, but with the BOOK twist

Posted 01 April 2009 - 09:09 PM

System.out.print ("Please Input the ISBN:"); //prompt
book.setISBN(input.next());
System.out.println();

System.out.print ("Enter the book price: ");
book.setprice(input.nextDouble());
System.out.println();

System.out.println ("Please Enter the quantity of books");
book.setquantity(input.nextDouble());
System.out.println();


Put all that in the for loop except instead of setQuantity, assign it, do same for all of them.
Assign instead of set.
quantity = input.nextDouble(); like that for the price, quantity and ISBN, and btw, change quantity to an int, cant have half a book ;)

Just go ahead and delete the follow code:
System.out.println("Inventory Program");
System.out.println();
System.out.println();
System.out.println("\nPlease input the name of the Book (Enter Stop to Exit):");
book.setName(input.next());
System.out.println();
if (!book.getName().equalsIgnoreCase("Stop"))


Then make an object with all the variable that you have, and add it to the arraylist
Book aBook = new Book(bookname, isbn, price, quantity); Whatever order has to go in
Then add it to the arraylist! yay!! setOfBooks.add(aBook);

This post has been edited by Fuzzyness: 01 April 2009 - 09:12 PM

Was This Post Helpful? 0
  • +
  • -

#12 jjones884  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 22-March 09

Re: Inventory Program 2, but with the BOOK twist

Posted 01 April 2009 - 09:27 PM

View PostFuzzyness, on 1 Apr, 2009 - 08:09 PM, said:

System.out.print ("Please Input the ISBN:"); //prompt
book.setISBN(input.next());
System.out.println();

System.out.print ("Enter the book price: ");
book.setprice(input.nextDouble());
System.out.println();

System.out.println ("Please Enter the quantity of books");
book.setquantity(input.nextDouble());
System.out.println();


Put all that in the for loop except instead of setQuantity, assign it, do same for all of them.
Assign instead of set.
quantity = input.nextDouble(); like that for the price, quantity and ISBN, and btw, change quantity to an int, cant have half a book ;)

Just go ahead and delete the follow code:
System.out.println("Inventory Program");
System.out.println();
System.out.println();
System.out.println("\nPlease input the name of the Book (Enter Stop to Exit):");
book.setName(input.next());
System.out.println();
if (!book.getName().equalsIgnoreCase("Stop"))


Then make an object with all the variable that you have, and add it to the arraylist
Book aBook = new Book(bookname, isbn, price, quantity); Whatever order has to go in
Then add it to the arraylist! yay!! setOfBooks.add(aBook);

Ok I think i have done what you ask.... check it out please...

package inventoryprogram;
import java.awt.print.Book;
import java.util.Scanner;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) 
		{
	 // main begin Java application

	   

	   BOOK book = new BOOK();


	   Scanner input = new Scanner(System.in);

		int numBooks;
		String bookName;
		String ISBN;
		Double price;
		int quantity;
		
		ArrayList<Book> setOfBooks = new ArrayList<Book>();
		System.out.print("How many books would you like ot enter? ");
		numBooks = input.nextInt();
		for(int i = 0; i <numBooks; i++)
{

			System.out.print("Please enter book name: ");
			bookName = input.nextLine();

			System.out.print ("Please Input the ISBN:"); //prompt
			ISBN = input.next();
			System.out.println();

			System.out.print ("Enter the book price: ");
			price = input.nextDouble();
			System.out.println();

			System.out.println ("Please Enter the quantity of books");
			quantity = input.nextInt();
			System.out.println();
   

	System.out.printf("Book Title: %s", book.getName());
	System.out.println();
	System.out.printf("ISBN: %s", book.getISBN());
	System.out.println();
	System.out.printf("Unit Price: $%.2f\n",book.getprice());
	System.out.printf("Total Inventory: $%.2f\n",  book.getprice()*book.getquantity ());
	System.out.println();
	System.out.println();
		  
		}
		System.out.println("Program Ended");
	

	}
	   
}




I am getting this error though...

Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - cannot find symbol
symbol : class ArrayList
location: class inventoryprogram.Main
at inventoryprogram.Main.main(Main.java:25)
Java Result: 1


View Postjjones884, on 1 Apr, 2009 - 08:23 PM, said:

View PostFuzzyness, on 1 Apr, 2009 - 08:09 PM, said:

System.out.print ("Please Input the ISBN:"); //prompt
book.setISBN(input.next());
System.out.println();

System.out.print ("Enter the book price: ");
book.setprice(input.nextDouble());
System.out.println();

System.out.println ("Please Enter the quantity of books");
book.setquantity(input.nextDouble());
System.out.println();


Put all that in the for loop except instead of setQuantity, assign it, do same for all of them.
Assign instead of set.
quantity = input.nextDouble(); like that for the price, quantity and ISBN, and btw, change quantity to an int, cant have half a book ;)

Just go ahead and delete the follow code:
System.out.println("Inventory Program");
System.out.println();
System.out.println();
System.out.println("\nPlease input the name of the Book (Enter Stop to Exit):");
book.setName(input.next());
System.out.println();
if (!book.getName().equalsIgnoreCase("Stop"))


Then make an object with all the variable that you have, and add it to the arraylist
Book aBook = new Book(bookname, isbn, price, quantity); Whatever order has to go in
Then add it to the arraylist! yay!! setOfBooks.add(aBook);

Ok I think i have done what you ask.... check it out please...

package inventoryprogram;
import java.awt.print.Book;
import java.util.Scanner;
import java.util.Arrays;

public class Main {

	public static void main(String[] args) 
		{
	 // main begin Java application

	   

	   BOOK book = new BOOK();


	   Scanner input = new Scanner(System.in);

		int numBooks;
		String bookName;
		String ISBN;
		Double price;
		int quantity;
		
		ArrayList<Book> setOfBooks = new ArrayList<Book>();
		System.out.print("How many books would you like ot enter? ");
		numBooks = input.nextInt();
		for(int i = 0; i <numBooks; i++)
{

			System.out.print("Please enter book name: ");
			bookName = input.nextLine();

			System.out.print ("Please Input the ISBN:"); //prompt
			ISBN = input.next();
			System.out.println();

			System.out.print ("Enter the book price: ");
			price = input.nextDouble();
			System.out.println();

			System.out.println ("Please Enter the quantity of books");
			quantity = input.nextInt();
			System.out.println();
   

	System.out.printf("Book Title: %s", book.getName());
	System.out.println();
	System.out.printf("ISBN: %s", book.getISBN());
	System.out.println();
	System.out.printf("Unit Price: $%.2f\n",book.getprice());
	System.out.printf("Total Inventory: $%.2f\n",  book.getprice()*book.getquantity ());
	System.out.println();
	System.out.println();
		  
		}
		System.out.println("Program Ended");
	

	}
	   
}




I am getting this error though...

Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - cannot find symbol
symbol : class ArrayList
location: class inventoryprogram.Main
at inventoryprogram.Main.main(Main.java:25)
Java Result: 1


And where was I supposed to put

then make an book object
Book theBook = new Book(bookName, isbn, price, quantity);

then add it to the array.
setOfBooks.add(theBook);


Was This Post Helpful? 0
  • +
  • -

#13 Fuzzyness  Icon User is offline

  • Comp Sci Student
  • member icon

Reputation: 669
  • View blog
  • Posts: 2,438
  • Joined: 06-March 09

Re: Inventory Program 2, but with the BOOK twist

Posted 01 April 2009 - 09:28 PM

ArrayList<Book> change the Book to BOOK
and dont forget to import ArrayList
import java.util.ArrayList;
You just need to make an object and add it to the array. You do that after done getting all the prompts. Dont forget to Capitalize the BOOK when making the object, your class name is all uppercase letters.
BOOK theBook = new BOOK(params)
String ISBN; change that variable name to lowercase. A variable name cannot start with a capital letter. only classes do that.

Do you want to print out each Book as you enter it, or all at once once sorted? and how do you wish to sort it?

This post has been edited by Fuzzyness: 01 April 2009 - 09:31 PM

Was This Post Helpful? 0
  • +
  • -

#14 Locke  Icon User is offline

  • Sarcasm Extraordinaire!
  • member icon

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

Re: Inventory Program 2, but with the BOOK twist

Posted 01 April 2009 - 09:30 PM

View PostFuzzyness, on 1 Apr, 2009 - 10:28 PM, said:

A variable name cannot start with a capital letter. only classes do that.


Not true. You can start a variable name with a capital letter...it's just poor style.
Was This Post Helpful? 0
  • +
  • -

#15 Fuzzyness  Icon User is offline

  • Comp Sci Student
  • member icon

Reputation: 669
  • View blog
  • Posts: 2,438
  • Joined: 06-March 09

Re: Inventory Program 2, but with the BOOK twist

Posted 01 April 2009 - 09:34 PM

Heya Locke :)
My teacher taught us not to do it and was like VERY BAD. said its illgel variable name. btw any idea why all of our personal photos are skyhawks pic?
Was This Post Helpful? 0
  • +
  • -

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »