Loading

[NEW SOLN] CMIS 242 ENTIRE COURSE HELP

CMIS 242 Entire Course includes:

  • CMIS242 Project 1 Minimum Maximum and Average,
  • CMIS242 Project 2 Computes the Sales Tax,
  • CMIS242 Project 3 Draws Two Types of Shapes,
  • CMIS242 Project 4 Manage a Real Estate Database,
[NEW SOLN] CMIS 242 ENTIRE COURSE HELP

CMIS 242 Project 1 Minimum Maximum and Average

The first programming project involves writing a program that computes the minimum, the maximum and the average weight of a collection of weights represented in pounds and ounces that are read from an input file. This program consists of two classes. The first class is the Weight class, which is specified in integer pounds and ounces stored as a double precision floating point number. It should have five public methods and two private methods:

  1. A public constructor that allows the pounds and ounces to be initialized to the values supplied as parameters.
  2. A public instance method named lessThan that accepts one weight as a parameter and returns whether the weight object on which it is invoked is less than the weight supplied as a parameter.
  3. A public instance method named addTo that accepts one weight as a parameter and adds the weight supplied as a parameter to the weight object on which it is invoked. It should normalize the result.
  4. A public instance method named divide that accepts an integer divisor as a parameter. It should divide the weight object on which the method is invoked by the supplied divisor and normalize the result.
  5. A public instance toString method that returns a string that looks as follows: x lbs y oz, where x is the number of pounds and y the number of ounces. The number of ounces should be displayed with three places to the right of the decimal.
  6. A private instance method toOunces that returns the total number of ounces in the weight object on which is was invoked.
  7. A private instance method normalize that normalizes the weight on which it was invoked by ensuring that the number of ounces is less than the number of ounces in a pound.

Both instance variable must be private. In addition the class should contain a private named constant that defines the number of ounces in a pound, which is 16. The must not contain any other public methods.

The second class should be named Project1. It should consist of the following four class (static) methods.

The main method that reads in the file of weights and stores them in an array of type Weight. It should then display the smallest, largest and average weight by calling the remaining three methods. The user should be able to select the input file from the default directory by using the JFileChooser class.

  1. The input file should contain one weight per line. If the number of weights in the file exceeds 25, an error message should be displayed and the program should terminate.
  2. A private class method named findMinimum that accepts the array of weights as a parameter together with the number of valid weights it contains. It should return the smallest weight in that array.
  3. A private class method named findMaximum that accepts the array of weights as a parameter together with the number of valid weights it contains. It should return the largest weight in that array.
  4. A private class method named findAverage that accepts the array of weights as a parameter together with the number of valid weights it contains. It should return the average of all the weights in that array.

Be sure to follow good programming style, which means making all instance variables private, naming all constants and avoiding the duplication of code. Furthermore you must select enough different input files to completely test the program.

[NEW SOLN] CMIS 242 ENTIRE COURSE HELP

CMIS 242 Project 2 Computes the Sales Tax

A constructor that allows the make and purchase price to be initialized.price.

The second programming project involves writing a program that computes the sales tax for a collection of automobiles of different types. This program consists of four classes. The first class is the Automobile class, which contains the automobile’s make and model, and purchase price, which is specified in whole dollars. It should have three methods:

  1. A method named salesTax that returns the base sales tax computed as 5% of the sales
  2. A toString method that returns a string containing the make and model of the
  3. automobile, the sales price, and the sales tax, appropriately labeled.

The Automobile class has two subclasses. The first is Electric. It has an additional instance variable that contains its weight in pounds stored as an integer. It should have the same three methods:

  1. A constructor that allows the automobile’s make and model, purchase price and weight to be initialized.
  2. An overridden method salesTax that returns the total sales tax. The sales tax for an electric automobile consists of the base sales tax of 5% that applies to all automobiles minus a discount. If the weight is less than 3000 pounds the discount is $200. Otherwise it is $150.
  3. An overridden toString method that returns a string containing the make and model of the automobile, the sales price, sales tax and the weight, appropriately labeled.

The second subclass is Hybrid. It has an additional instance variable that contains the number of miles per gallon stored as an integer. It should have the same three methods:

  1. A constructor that allows the automobile’s make and model, purchase price and miles per gallon to be initialized.
  2. An overridden method salesTax that returns the total sales tax The sales tax for a hybrid automobile consists of the base sales tax of 5% minus a discount. If the number of miles per gallon is less than 40, the discount is $100. Otherwise there is an additional discount of $2 for every mile per gallon in excess of 40.
  3. An overridden toString method that returns a string containing the make and model of the automobile, the sales price, sales tax and the number of miles per gallon, appropriately labeled.

No additional public methods should be included in any of the above three classes.

Finally there should be a fourth class named Project2 that contains the main method. It should generate the GUI shown below:

Image transcription textAutomobile Sales Tax Calculator X Make and Model Sales Price Automobile Type Hybrid Miles per Gallon Electric
Weight in Pounds Other Compute Sales Tax Clear Fields Display Report

After entering the information about the make and model, its sales price and the type of the automobile, clicking the Compute Sales Tax button should display the sales tax in the text field to its right. In addition, the object should be stored in an array of type Automobile. That array should allow space for up to the last five automobiles entered.

If non integer values are entering in any of the fields that require integers, an error message should be displayed in a JOptionPane window.

Clicking the Clear Fields button should clear all text fields.

Clicking the Display Report button should produce a report on the console that includes the information about all the automobiles currently stored in the array. An example of the report that should be displayed is shown below:

Make and Model: Toyota Prius Sales Price: 30000

Sales Tax: 1390.00

Hybrid Vehicle

MPG: 45

Make and Model: Ford Fusion Sales Price: 21000

Sales Tax: 1050.00

Be sure to follow good programming style, which means making all instance variables private, naming all constants and avoiding the duplication of code. Furthermore you must select enough different kinds of automobiles to completely test the program

[NEW SOLN] CMIS 242 ENTIRE COURSE HELP

CMIS 242 Project 3 Draws Two Types of Shapes

The third programming project involves writing a program that draws two types of shapes, ovals and rectangles. This program consists of six classes. The first class is the Shape class, which is an abstract class that extends the predefined Java class Rectangle. It should contain two instance variables, the color of the shape and whether the shape is solid or hollow. It should also contain a class (static) variable that keeps track of how many shapes have been created.. It should have three instance methods, one class method and one abstract method: 

1. A constructor that accepts three parameters for the purpose of initializing the characteristics of the shape, a Rectangle object that defines the dimensions and position of the shape, the color of the shape and whether the shape is solid or hollow. It should also update the number of shapes created so far. 

2. An instance method named setColor that accepts the Graphics object as a parameter and sets the color for the next draw operation to the color of the current shape. 

3. An instance method named getSolid that returns whether the shape is solid or hollow. 

4. A class method named getNoOfShapes that returns the number of shapes created so far. 

5. An abstract method named draw that accepts a Graphics object as a parameter. 

The Shape class has two subclasses. The first is Oval. It should have the following two methods: 

1. A constructor that accepts three parameters for the purpose of initializing the characteristics of the shape, a Rectangle object that defines the dimensions and position of the shape, the color of the shape and whether the shape is solid or hollow. 

2. An overridden method draw that draws the Oval object on the Graphics object passed as a parameter. 

The second subclass is Rectangular. It should have the following two methods: 

1. A constructor that accepts three parameters for the purpose of initializing the characteristics of the shape, a Rectangle object that defines the dimensions and position of the shape, the color of the shape and whether the shape is solid or hollow. 

2. An overridden method draw that draws the Rectangular object on the Graphics object passed as a parameter. 

The fourth class is named Drawing, which should extend the predefined Java class JPanel. It has one instance variable that contains the shape that is currently drawn.. It should have three methods: 

1. An overridden paintComponent method that draws the current shape on the Graphics object that is passed to it as a parameter. It should also draw the number of shapes that have been created thus far in the upper left corner. 

2. An overridden getPreferredSize method that specifies the dimensions of the drawing panel as 200 pixels wide and 200 pixels high. 

3. An instance method named drawShape that is passed the current shape to be drawn. It first checks whether the shape provided will completely fit within the panel. If not, it throws an OutsideBounds exception. Otherwise, it saves the shape in the corresponding instance variable. It then calls repaint to cause that shape to be drawn. 

No additional public methods should be included in any of the above classes. 

The fifth class named OutsideBounds should define a checked exception. 

The sixth class named Project3 should contain the main method. It should generate the GUI shown below: 

Image transcription textGeometric Drawing – X Shape Type Oval Shape Drawing Fill Type Solid Color Red Width 100 Height 125 x
coordinate 40 y coordinate 30 Draw

The combo-box for the shape type should allow two choices, either Rectangleor Oval. The combo-box for the fill type should also allow two choices, either Hollowor Solid. The combo-box for the color should allow seven choices, Black, Red, Orange, Yellow, Green, Blueor Magenta

Clicking the Drawbutton should first check whether any non integer values have been entered in any of the fields that require integers. If so, an error message should be displayed in a JOptionPane window. Otherwise an appropriate Shape object should be created and passed to the drawShape method of the Drawing class. If that call results in an OutsideBounds exception being thrown, an appropriate error message should be displayed in a JOptionPane window. 

Be sure to follow good programming style, which means making all instance variables private, naming all constants and avoiding the duplication of code. Furthermore you must select enough different kinds of shapes to completely test the program.�

[NEW SOLN] CMIS 242 ENTIRE COURSE HELP

CMIS 242 Project 4 Manage a Real Estate Database

The fourth programming project involves writing a program to manage a real estate database. This program should be comprised of an enumerated type, an interface and two classes. The enumerated type should be named Status and should contain three enumeration literals, FOR_SALE, UNDER_CONTRACT and SOLD.

The interface should be a generic interface named StateChangeable and it should have a bounded generic type parameter whose type must be an enumerated type. It should contain one abstract method changeState that has a parameter whose type of the generic type parameter.

The first of the two classes should be named Property. It should implement the StateChangeable interface. It should contain five instance variables, the property address stored as a string, the number of bedrooms, the square footage and the price, all stored as integers, and the status of the property whose type should be the enumerated type Status. In addition, it should have the following three methods:

  1. A constructor that accepts four parameters for the purpose of initializing the characteristics of the property, the address, the number of bedrooms, the square footage and the price. The status of the property should be set to FOR_SALE.
  2. A method named changeState that allows the status of the property to be changed.
  3. An overridden toString method that returns a string containing the property address, the
  4. number of bedrooms, the square footage, the price and the current status, appropriately labeled.

The second class named Project4 should contain the main method. In addition, it should contain an instance variable that defines the database of property records, which is implemented as a TreeMap, with the transaction number field as the key and a Property object as the value. It should generate the GUI shown below:

Clicking the Processbutton should cause the selected choice of the three database actions in the combo box to its right to be executed. It should first check whether any non integer values have been entered in any of the fields that require integers. If so, an error message should be displayed in a JOptionPane window. The operation should be performed when the user clicks the Processbutton. If the user attempts to insert a key that is already in the database an error message should be displayed using a JOptionPane message dialog box. If the user attempts to delete or find a record that is not in the database, a message should also be displayed. After each successful operation is completed a JOptionPane window should be displayed confirming the success. In the case of a successful Findrequest, a window should pop up containing all the information in the associated Property object.

Clicking the Change Statusbutton should cause status of the property association with the designated transaction number to be changed to status selected in the combo box to its right.

Be sure to follow good programming style, which means making all instance variables private, naming all constants and avoiding the duplication of code. Furthermore you must select enough different kinds of transactions to completely test the program.

Support