SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 211 Weeks Ago, 4 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 12 Oct 2017 My Price 10.00

Writing a program to calculate the terms of the following sequence of numbers: 0 1 3 8 21 55 144 377 ...

*** Created by bigh2 on 9/28/2017.*/import javax.sound.midi.Sequence;import javax.swing.*;import java.awt.*;import java.awt.event.*;import java.io.*;public class P3GUI extends JFrame implements ActionListener{private final String fileName = "output.txt";private PrintWriter pOutput;private FileWriter fWriter;private BufferedWriter buffWriter;// Font settings and creates a new JFrameprivate final Font guiFont = new Font ("Times New Roman", Font.BOLD, 16);private final JFrame guiFrame = new JFrame();// Radiobutton for Iterative or Recursiveprivate final JRadioButton iBtn = new JRadioButton("Iterative");private final JRadioButton rBtn = new JRadioButton("Recursive");// Buttons for User Inputprivate final ButtonGroup userInput = new ButtonGroup();private final JLabel inputLabel = new JLabel("Input a number: ");private final JLabel outputLabel = new JLabel("Output: ");private final JLabel eLabel = new JLabel("Efficiency: ");// Textfield for input and outputprivate final JTextField inputField = new JTextField(20);private final JTextField outputField = new JTextField();private final JTextField eField = new JTextField();// Button to calculateprivate final JButton calculateBtn = new JButton("Calculate");// Panels for input, buttons, choice, answer and mainprivate final JPanel panelMain = new JPanel();private final JPanel buttonPanel = new JPanel();private final JPanel choicePanel = new JPanel();private final JPanel panelInput = new JPanel();private final JPanel panelOutput = new JPanel();// Constructorpublic P3GUI() {setFrame();setAttributes();setPanels();addWindowListener(new AppClose());}// Method to set the settings of the Frameprivate void setFrame() {setVisible(true);setSize(600, 300);setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);setTitle("Project 3: Iterative vs. Recursive");add(panelMain);
Background image of page 1
}// Method to set Attributesprivate void setAttributes() {// Using GridLayout to set format of panelspanelMain.setLayout(new GridLayout(4,1));panelOutput.setLayout(new GridLayout(2,2));// Adding buttons to the user selection paneluserInput.add(iBtn);userInput.add(rBtn);// Setting fontsiBtn.setFont(guiFont);rBtn.setFont(guiFont);inputLabel.setFont(guiFont);outputLabel.setFont(guiFont);eLabel.setFont(guiFont);calculateBtn.setFont(guiFont);// Defaults on the fields and buttons.outputField.setEditable(false);eField.setEditable(false);iBtn.setSelected(true);calculateBtn.addActionListener(new guiClickButton());}public void setPanels() {// Add iterative and recursive buttons to choicePanelchoicePanel.add(iBtn);choicePanel.add(rBtn);// Add user inputs to Input PanelpanelInput.add(inputLabel);panelInput.add(inputField);// Add Calculate to button panelbuttonPanel.add(calculateBtn);// Add efficiency and output to Output PanelpanelOutput.add(outputLabel);panelOutput.add(outputField);panelOutput.add(eLabel);panelOutput.add(eField);// Adds the four above panels to the main panelpanelMain.add(choicePanel);panelMain.add(panelInput);panelMain.add(buttonPanel);panelMain.add(panelOutput);}// Calls the sequence.java class based on user input and calculatesinformation// based on if recursive of iterative is selected.private void callSequence(int a) {if(iBtn.isSelected()) {int iValue = Sequence.iterativeCalc(a);long iEff = (Sequence.counter + 1);outputField.setText(Integer.toString(iValue));eField.setText(Long.toString(iEff));
Background image of page 2

Answers

(5)
Status NEW Posted 12 Oct 2017 08:10 AM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)