C# Programming and Java Programming

profileTopsolutions
 (Not rated)
 (Not rated)
Chat

with C# Programming and Java Programming. See the following information, criteria, provided code (very small parts just adding to provided code), and Due Dates that must be adhered to please. - The Java Programming requires all Netbeans files zipped up to all allow full program to open in my version of Netbeans.

 

 

-Extra bonus for meeting all needed criteria and due dates. $30.00

 

 

 

 

 

C# PROGRAMMING

 

PART 1 (In separate file with comments in code

 

 

 

Demonstration of a Switch/Case in a GUI

 

 

 

Switch/Cases are often used to process menus, especially when some of the data entry may come from keypad. Not all screens are touch screens. We are not going to actually show any new windows. We are going to process the choices by the user in GUI.

 

 

 

Write a GUI program for the main screen of an ATM. It is an older ATM where the user can only enter a number into a textbox for their selection, and another for how much money they wish to withdraw or deposit.

 

 

 

The GUI screen should have labels for the menu as follows:

 

 

 

(1) Balance Inquiry Checking

 

(2) Deposit Checking

 

(3) Withdraw Checking

 

(4) Exit

 

 

 

Have another label to display

 

Balance Information

 

Deposit messages

 

Withdrawal messages

 

 

  • Create a Form level variable for Balance of type decimal and assign it 1000.00

 

  • Make a button on the form. The click event of the button should take the choice the user gives and process it with the switch/case statement.

 

  • If the user enter a 1 the program should display the current balance in the message label for output,

 

  • If the user enters 2 the program should take the amount the user entered into the second textbox and deposit this amount by adding it to the balance, and giving a confirmation message to the user in message label for output

 

  • If the user enters a 3 the program should take the amount the user entered into the second textbox and withdraws this amount by subtracting it from the balance along with a confirmation message. Is there enough money or not enough money to cover it in the account, give a confirmation message ( or denial message ) to the user in the message label for output

 

  • If the user enters a 4 the program should end with Application.Exit();

 

  • If the user enters anything other than 1-4 it should give the user an invalid selection message in the message label for output.

 

 

Note: You must use a switch/case statement on this one. If you do not and use other GUI tools and it performs the same situation without demonstrating one in this language it will be major deduction

 

 

 

 

__________________________________________________

 

 

 

C# Programming

 

 

PART 2 (In separate file with comments in code)

 

 

 

Demonstration of a GUI program with Radio Buttons Checkboxes, and a Numeric Up/Down.

 

 

 

Create a GUI program that a person running a cash register would use to make an order for a Pizza;

 

 

  • The Pizza order screen should have radio buttons to allow the user to choose the size of a Pizza in sizes; Small ($6), Medium ($8.50), and Large ($11.75).

 

  • The Pizza order screen should have a numeric Up/Down for the user to enter the number of toppings ($.75 each).

 

  • The Pizza order screen should have a checkbox for Coupon (and should be $3.00 off the price if it is checked.)

 

  • Place a button on your window that “has the code under its click event” to find the price for the pizza based on the choice of size, number of toppings, and if the coupon checkbox is checked.

 

  • Have it show this price to the user on a label.

 

 

 

 

 

 

 

 

 

 

________ end of C# Programming ________________________

 

 

 

 

 

JAVA PROGRAMMING

 

 

 

 

PART 1 (Place comments in code and please provide COMPLETE NETBEANS FILES (All) whole program with all files zipped separately for Part 1 so that complications getting the file to load in my version of NETBEANS 7.0.1 does not result)

 

 

 

With the economy the way it is, the general manager of your company wants you to write a program that keeps track of the paper being used by every department. For reasons he hasn’t give (maybe to find out who is ordering too much, or who has more because they use less because they replace paper with technology).

 

He wants a program that will print out a list of departments, manager names (of the department), boxes (of paper), and reams (1 pack of paper) Demonstrate what you know about OO Classes, Lists, and Sorting at the same time.

 

 

 

 

  • Create a class in java that stores the following data:

 

 

departmentname(string)

 

managername(string)

 

box(integer)

 

ream(integer)

 

 

 

 

  • Create a class in java that implements the Comparator interface It should compare two objects by box first, and ream second.

 

  • Create a third class to test your class and new comparator above with a main() method that creates 4 objects the class keeping your data and places them in a List.

 

  • Display the List values unsorted for the user.

 

  • Sort the List using the comparator class you created.

 

  • Display the List values again for the user.

 

 

 

 

 

 

______________________________________________

 

 

 

 

 

Small PART 2 (Place comments in code and please provide COMPLETE NETBEANS FILES (All) whole program with all files zipped separately for Part 2 so that complications getting the file to load in my version of NETBEANS 7.0.1 does not result)

 

 

 

Create a program that demonstrates a recursive method to find the power of a number. The recursive method that must be in this program should take two integer parameters: value and raiseToPower.

 

Write some code in main to test your new recursive method.

 

 

(Hints: You can write this the Fibonacci way and do it off the return or do it like the simple version. If you do it the simple way …you will need to have a class level variable outside the method to hold the current total as each recursive call is made....With either strategy, don’t change the value variable. It will cause problems if you try anything with that.)

 

 

_________________________________________

 

 

 

Small PART 3(Place comments in code and please provide COMPLETE NETBEANS FILES (All) whole program with all files zipped separately for Part 3 so that complications getting the file to load in my version of NETBEANS 7.0.1 does not result)

 

 

(Working with audio clips, add to code already provided below)

 

 

Simulate adding audio to a program at your organization. (See attached audio files)

 

 

 

 

  • Modify the applet from the “code already provided” and add these sound files to it.

 

  • Have button controls to play 1 sound

 

  • Have it playing 2nd sound in the background automatically as the program opens

 

 

 

 

 

CODE ALREADY PROVIDED FOR THIS PART OF THE ASSIGNMENT

 

 

 

package billapplet;

 

 

 

import java.awt.Graphics;

 

import java.awt.GridLayout;

 

import javax.swing.*; // Swing GUI classes are defined here.

 

import java.awt.event.*; // Event handling class are defined here.

 

 

 

public class BillApplet extends JApplet

 

{

 

 

 

public void paint(Graphics g)

 

{

 

 

 

String orderNum = JOptionPane.showInputDialog("Enter order number: ");

 

int quantity = 0;

 

double price = 0;

 

 

 

try

 

{

 

quantity = Integer.parseInt(JOptionPane.showInputDialog("Enter quantity: "));

 

price = Double.parseDouble(JOptionPane.showInputDialog("Enter price: "));

 

}

 

catch (Exception e)

 

{

 

g.drawString("Enter correct values", 100, 100);

 

return;

 

}

 

g.drawString("Order Number: "+orderNum, 100, 100);

 

g.drawString("Quantity: "+quantity, 100, 115);

 

g.drawString("Price: $"+price, 100, 130);

 

g.drawString("Total: $"+(quantity*price), 100, 145);

 

}

 

}

 

 

 

____________________________________________

 

 

 

 

 

Small PART 4(Place comments in code and please provide COMPLETE NETBEANS FILES (All) whole program with all files zipped separately for Part 4 so that complications getting the file to load in my version of NETBEANS 7.0.1 does not result)

 

 

 

Demonstrate a timer in a program by adding an image to the program provided.

 

Swap the image by setting its Visible property to false using setVisible(false); and simultaneously making another image you add become visible with setVisible(false); every 5 seconds or so (So they cut on and off opposite of each other) (See two attached Images)

 

 

 

 

import javax.swing.*;

 

import java.awt.*;

 

import java.awt.event.*;

 

 

 

public class Implementation extends Frame

 

{

 

//4 Arrays Initialized

 

public static InventoryItem[] ITEM = new InventoryItem[4];

 

 

//Frame Components

 

public static JFrame f = new JFrame("Inventory GUI");

 

public static JButton B1 = new JButton();

 

public static JButton B2 = new JButton();

 

public static JScrollPane SP = new JScrollPane();

 

public static JTextArea TA = new JTextArea();

 

 

public static void main(String[] args)

 

{

 

//Initialized all 4 Array Members

 

ITEM[0] = new InventoryItem("1234","SteamFast Steamer",62.55);

 

ITEM[1] = new InventoryItem("1220","Tribal Hollywood",20.75);

 

ITEM[2] = new InventoryItem("1245","Laughing Gas Comedy",44.65);

 

ITEM[3] = new InventoryItem("1120","Rockport Shoes",99.25);

 

 

f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

 

B1.setText("LOAD ARRAY");

 

B2.setText("PERFORM BINARY SORT");

 

 

//Action Listener for Both Buttons

 

B1.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent evt){B1ActionPerformed(evt);}});

 

B2.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent evt){B2ActionPerformed(evt);}});

 

 

TA.setColumns(30);

 

TA.setEditable(false);

 

TA.setRows(5);

 

SP.setViewportView(TA);

 

 

f.setLayout(new FlowLayout());

 

f.setSize(500,400);

 

f.add(B1);

 

f.add(B2);

 

f.add(TA);

 

 

f.setVisible(true);

 

}

 

//Button to load Array in Text Area of Action Listner

 

private static void B1ActionPerformed(ActionEvent evt)

 

{

 

//Make TA Blank

 

TA.setText("");

 

String header = String.format("%10.10s\t%25.25s\t%s\n","UPC","Description","Price");

 

TA.append(header);

 

String line = "----------------------------------------------------------------------------------------\n";

 

TA.append(line);

 

for(int i = 0; i < ITEM.length; i++)

 

{

 

TA.append(ITEM.toString()); }

 

}

 

//Button BinarySort Data Action Listner

 

private static void B2ActionPerformed(ActionEvent evt)

 

{

 

BinarySort();

 

JOptionPane.showMessageDialog(null,"Binary Sort Sucessfull, Use LOAD ARRAY Buttom to Refresh the Display"); }

 

 

 

public static void BinarySort()

 

{

 

for(int i = 0; i < ITEM.length; i++)

 

{

 

InventoryItem temp = ITEM;

 

int left = 0;

 

int right = i;

 

while(left < right)

 

{

 

int middle = (left + right) / 2;

 

if(temp.getUPC().compareTo(ITEM[middle].getUPC()) > 0)

 

{

 

left = middle + 1;

 

}

 

else

 

{

 

right = middle;}

 

}

 

for(int j = i; j > left; --j)

 

{

 

InventoryItem swap = ITEM[j];

 

ITEM[j] = ITEM[j-1];

 

ITEM[j-1] = swap;}

 

}

 

}

 

}

 

 

 

_________________________________________________

    • 12 years ago
    Complete solution
    NOT RATED

    Purchase the answer to view it

    blurred-text
    • attachment
      1.wav
    • attachment
      2.wav
    • attachment
      atm_cs.zip
    • attachment
      billapplet.zip
    • attachment
      company.zip
    • attachment
      imagetest.java
    • attachment
      pizzaorderscreen_cs.zip
    • attachment
      powerrecursive.zip
    • attachment
      read_me_for_mp3_file.txt