Autopia Car Detailing Forum Home
Autopia Car Detailing How-To Articles Autopia Car Detailing Product Reviews Autopia Car Detailing Products & Supplies Catalog
Go Back   Autopia.org > THE CLUB HOUSE > Hot Tub


Welcome to the Autopia.org. You are viewing as a guest.  By joining our FREE community you will be able to interact with others.  Plus, when you join you will receive instant coupon codes for special discounts with our sponsors.  Registration is fast, simple and absolutely free so please, join our community today!

Autopia Marketplace

Reply
 
Submit Tools LinkBack Thread Tools Rate Thread Display Modes

Old 10-05-06, 11:47   #1 (permalink)
Autopia Master Trooper
 
PrinzII's Avatar
 
PrinzII is offline
Join Date: Jul 2001
Location: Gilbert, AZ
Posts: 5,787
PrinzII is on a distinguished road
Send a message via ICQ to PrinzII Send a message via AIM to PrinzII Send a message via Yahoo to PrinzII
Anyone know Java?

I need help with programming for an assignment in my class. If you are interested, PM me so we can get rolling.
__________________
Shift_Cactus!
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Old 10-06-06, 08:27   #2 (permalink)
Autopia Master Trooper
 
PrinzII's Avatar
 
PrinzII is offline
Join Date: Jul 2001
Location: Gilbert, AZ
Posts: 5,787
PrinzII is on a distinguished road
Send a message via ICQ to PrinzII Send a message via AIM to PrinzII Send a message via Yahoo to PrinzII
This is the code I have so far:

import java.io.*;
import java.text.*;

class inventory
{
//initialize variables
String TextInput = ""
String Performer = ""
String RecordLabel = ""
String Genre = ""
String Studio = ""
String ParentalAdvisory = ""
String Price = ""

//initialize array
int array []; //declare array

inventory array = new int[ 10 ]; //create the space for array

System.out.printf( "%s%8s\n" , "Performer" , "RecordLabel" , "Genre", "Studio" , "ParentalAdvisory" ); // column headings


Errors:

Inventory.java:10: ';' expected
String Performer = ""
^
Inventory.java:22: <identifier> expected
System.out.printf( "%s%8s\n" , "Performer" , "RecordLabel" , "Genre", "Studio" , "ParentalAdvisory" ); // column headings

Instructions:

Choose a product that lends itself to an inventory (for example, products at your workplace, office supplies, music CDs, DVD movies, or software).
• Create a product class that holds the item number, the name of the product, the number of units in stock, and the price of each unit.
• Create a Java application that displays the product number, the name of the product, the number of units in stock, the price of each unit, and the value of the inventory (the number of units in stock multiplied by the price of each unit). Pay attention to the good programming practices in the text to ensure your source code is readable and well documented.

I am really stuck!!
__________________
Shift_Cactus!
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Old 10-06-06, 09:16   #3 (permalink)
Registered User
 
Black240SX's Avatar
 
Black240SX is offline
Join Date: Oct 2004
Location: Victoria, Canada
Posts: 576
Black240SX is on a distinguished road
Quote:
Originally Posted by PrinzII
This is the code I have so far:

import java.io.*;
import java.text.*;

class inventory
{
//initialize variables
String TextInput = ""
String Performer = ""
String RecordLabel = ""
String Genre = ""
String Studio = ""
String ParentalAdvisory = ""
String Price = ""

//initialize array
int array []; //declare array

inventory array = new int[ 10 ]; //create the space for array

System.out.printf( "%s%8s\n" , "Performer" , "RecordLabel" , "Genre", "Studio" , "ParentalAdvisory" ); // column headings


Errors:

Inventory.java:10: ';' expected
String Performer = ""
^
Inventory.java:22: <identifier> expected
System.out.printf( "%s%8s\n" , "Performer" , "RecordLabel" , "Genre", "Studio" , "ParentalAdvisory" ); // column headings

Instructions:

Choose a product that lends itself to an inventory (for example, products at your workplace, office supplies, music CDs, DVD movies, or software).
• Create a product class that holds the item number, the name of the product, the number of units in stock, and the price of each unit.
• Create a Java application that displays the product number, the name of the product, the number of units in stock, the price of each unit, and the value of the inventory (the number of units in stock multiplied by the price of each unit). Pay attention to the good programming practices in the text to ensure your source code is readable and well documented.

I am really stuck!!
lol, ok, I'll help a bit.

You need a semicolon at the end of each statement. So the field declarations in your class should look like:
String performer;
NB: the convention is to start the field name with a lower case letter.

The price could be represented as a String, though an "int" with the price in cents would make math easier.

I'm not sure what you intend to use TextInput for.

You'll need to define a constructor for your class. This is a function that gets called to initialize the fields when you create an instance of your class.

You need to end the definition of your Inventory class with a "}". NB: The convention is to start class names with an upper case letter. Also, "Product" might be a more meaningful name for the class.

An array declaration looks like this:
Product[] inventory = new Product[10];
__________________
A well-prepared surface will make any wax look good.
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Old 10-08-06, 03:59   #4 (permalink)
Autopia Master Trooper
 
PrinzII's Avatar
 
PrinzII is offline
Join Date: Jul 2001
Location: Gilbert, AZ
Posts: 5,787
PrinzII is on a distinguished road
Send a message via ICQ to PrinzII Send a message via AIM to PrinzII Send a message via Yahoo to PrinzII
Black240: : for the help
__________________
Shift_Cactus!
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 09:15.


Copyright (c), 1999-2008, Autopia.org - All Rights Reserved

Content Relevant URLs by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79