Results 1 to 6 of 6

Thread: my new project

  1. #1
    mrajan's Avatar
    mrajan is offline Member
    Join Date
    Jun 2010
    Posts
    12
    Rep Power
    0

    Default my new project

    Consider the following Scenario. You are a website selling a variety of novelty items. In particular your site sells a variety of television sets. You have a number of older color televisions that are not high definition sets. You want to try and push these items before they become obsolete. Therefore, you are offering a substantial discount for these items. Your are selling all non HD sets at a 40% discount. Additionally the new 3D televisions are starting to gain popularity. Therefore, you must try and push your current HD television sets before they start to decline in value. The smaller sets are becoming less popular. Therefore these sets are being reduced between 10% and 15%. If a set is 24 inches then the discount is 10%, if the set is 19 inches then the discount is 15%. The 32 thru 41 inch televisions are at a 7% discount. If the HD sets ate 42 inches are higher, the set is at a 5% discount. All 3D televisions do not receive a discount.
    Create a television class. In your class include a property for television type; additionally you should create a coding scheme for television type, discuss this within your groups. Your class should contain additional attributes for a modern television for sale, discuss these within your groups
    Create a customer class for the sale. Hint, you may want to make a copy of your person and make any necessary changes. Create a second class to instantiate your television class, and your customer class. Hint this class should contain your main method
    Your application should input data for a sale of a television and determine the selling price and discount amount of the television based on the criteria provided for discounts. It should then print out a small formatted invoice for the transaction and record the sale to a disk file.
    Hint; This week we begin to discuss modular design and development during lecture. Try to divide this assignment into modules and give each group member a module to do. We will discuss a temporary framework for doing this using the void method until we lecture fully on the topic of methods next week.


    and this is wat i have so far

    Java Code:
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    
    package labassignment1;
    import java.util.*;
    import java.io.*;
    import javax.swing.JOptionPane;
    import javax.swing.JFileChooser;
    //This section imports the package and classes that are used by the
    //application
    /**
     *
     * @author C318W2k
     */
    public class LabAssignment5 {
    static   int num = 0;
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args)
          throws FileNotFoundException , IOException
        {
            char c = ' ';
    	String userMenuInput;
             String menu;
             menu =
    
            "1:   Discounted items one Non HD TV 40% Discount\n " +
            "2:   Discounted items two 19-inch HD TV 15% Discount \n " +
            "3:   Discounted items three 24 -inch HD TV 10% Discount \n " +
            "4:   Discounted items four 32 - 41 -inch HD TV 7% \n " +
            "5:   Discounted items five 42-inch and higher HD TV 5% Discount  \n " +
            "6:   items six 3-D Tv Regular Price \n " +
                    "Select Number and Press Enter to Select items to view";
    
    
    userMenuInput = " ";
    
     do
      {
         userMenuInput = " ";
         userMenuInput = JOptionPane.showInputDialog(null,
                    menu, menu, 1);
    
    
    c = userMenuInput.charAt(0); 
    switch ( c )
    
    {
        case '1':
        itemOne();
    
         break;
    
         case '2':
        Discounted items two ();
    
         break;
    
         case '3':
        Discounted items three ();
    
         break;
    
         case '4':
        Discounted items four ();
    
         break;
    
         case '5':
        Discounted items five ();
    
         break;
         case '6':
        items six ();
    
         break;
         default:
             JOptionPane.showMessageDialog(null, "Unknown Selection \n " +
                                                  "Press Enter and try again" ) ;
          System.out.println("Error, unknown command.");
          break;
       }
    
    
     }  while (userMenuInput.equals(" ") );
        
        }
        static public void itemOne()
                 throws FileNotFoundException , IOException
        {
             char c = ' ';
             String userMenuInput;
             String menu;
              menu =
    
              "1:     1   \n " +
              "2:     2  Read and Display All Records \n ";
    
               userMenuInput = " ";
               userMenuInput = JOptionPane.showInputDialog(null,
                    menu, menu, 1);
              c = userMenuInput.charAt(0);
              if (c == '1')
                  writeDatatFile();
    
              if (c == '2')
                  readDatatFile();

    still in progress
    Last edited by Fubarable; 06-08-2010 at 05:42 AM. Reason: Moderator edit: code tags added

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  3. #3
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default

    Quote Originally Posted by Fubarable View Post
    What's your question?
    Indeed. We are not mind readers, nor do we (or I, at least) particularly want to become mind readers.

    Questions are good. Answers are good. Confusing posts with neither a Question nor an Answer are bad...
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

  4. #4
    mrajan's Avatar
    mrajan is offline Member
    Join Date
    Jun 2010
    Posts
    12
    Rep Power
    0

    Default

    am i going the right path so far?

    how do i do this Create a television class. In your class include a property for television type; additionally you should create a coding scheme for television type, Your class should contain additional attributes for a modern television for sale?

    Create a customer class for the sale. Hint, you may want to make a copy of your person and make any necessary changes. Create a second class to instantiate your television class, and your customer class?

    if you guys know of any link resembling this type of project plz post it... it will be real helpful... thank you

  5. #5
    mrajan's Avatar
    mrajan is offline Member
    Join Date
    Jun 2010
    Posts
    12
    Rep Power
    0

    Default

    if the professor showed some samples of this... it would have been a much easier.

  6. #6
    m00nchile is offline Senior Member
    Join Date
    Feb 2010
    Location
    Ljubljana, Slovenia
    Posts
    470
    Rep Power
    5

    Default

    Creating classes is a basis for programming in Java. You created a class in the code you posted, it's called LabAssignment5. If you're unclear on these subjects, it's best if you google Java beginner tutorial, because really, these are the basics you need to understand to learn more.
    Ever seen a dog chase its tail? Now that's an infinite loop.

Similar Threads

  1. Help With project
    By ineedhelpplease in forum New To Java
    Replies: 1
    Last Post: 01-15-2010, 12:16 AM
  2. project
    By bhadz202 in forum New To Java
    Replies: 13
    Last Post: 03-14-2009, 07:05 AM
  3. open existing project project ..
    By itaipee in forum Eclipse
    Replies: 1
    Last Post: 12-28-2008, 08:12 PM
  4. jsp project help
    By rajibmp in forum New To Java
    Replies: 4
    Last Post: 10-10-2008, 12:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •