In JAVA, please
With the mathematics you have studied so far in your education you have worked with polynomials. Polynomials are used to describe curves of various types; people use them in the real world to graph curves. For example, roller coaster designers may use polynomials to describe the curves in their rides. Polynomials appear in many areas of mathematics and science. Write a program which finds an approximate solution to an equation f(x) = 0 for some function f. Use the bisection method. To solve the problem using this method first find two values of x, A and B, such that when evaluated in the function f(x) they give opposites signs for the y value. If f(x) is continuous between these two values then we know that there is at least one x which evaluates to a 0 y value, which is between these two values A and B. Treat the positive value as an upper bound and the negative value as a lower bound. Divide the space between A and B in half and evaluate the function at that new point. If the value is positive than it replaces the existing upper-bound and if it is negative it replaces the existing lower-bound. Continue dividing the space between the upper-bound and lower-bound in half and evaluating this new value and generating new upper and lower bounds as the case may be. Continue the evaluation process until the x value that you are plugging into the function evaluates to a y value that is zero plus or minus .0000001.
Consider the possibility of finding all the real roots of any given function up to and including x raised to the fifth power. Input should consist of reading the coefficients one at a time to the powers of x up to 5 and some constant. Do a desk check with calculator on y = X2 -2 and identify the variables associated with that problem. Write the code that follows your algorithm. Then test your program on other polynomials such as 2x5 -15x4 + 35x3 -15x2-37x + 30 (roots are -1, 1, 2, 2.5, 3) and 3x5 -17x4 + 25x3 + 5x2 -28x + 12 (roots are -1,1, 2/3, 2, 3). Use at lest 3 methods. One to read the 5 coefficients, one to calculate the value of the polynomial and one to do the binary bisection search. Use the following for loop to work through the X values:for(double x = -5.0000001; x < 5.0000001; x = x + .1)
After it runs as a console program, using the GUI example from my website as a guide, convert this program to a graphics program. Keep the example GUI always working. Create multiple versions as you add code that will implement the polynomial problem. Always be able to go back to a previous working version if you get stuck. When you get the polynomial program working then delete the example code. To debug your compiled program, use System.out.println() to follow intermediate values of your variables to see where your code does not follow the algorithm.
----------------------- example
/**
* demonstrating a GUI program
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;
public class ExampleGUI extends JPanel
{
// ***Variables are created ***
//*** GUIs are made up of JPanels. Panels are created
//*** here and named appropriately to describe what will
//*** be placed in each of them.
JPanel titlePanel = new JPanel();
JPanel questionPanel = new JPanel();
JPanel inputNumberPanel = new JPanel();
JPanel addAndSubtractButtonPanel = new JPanel();
JPanel answerPanel = new JPanel();
JPanel nextNumberPanel = new JPanel();
//*** a JLabel is a text string that is given a String value
//*** and is placed in its corresponding JPanel or JButton
JLabel titleLabel = new JLabel();
JLabel questionLabel = new JLabel();
JLabel inputNumberLabel = new JLabel();
JLabel add5Label = new JLabel();
JLabel subtract5Label = new JLabel();
JLabel answerLabel = new JLabel();
JLabel nextNumberLabel = new JLabel();
//*** three JButtons are created. When pushed, each button calls
//*** its corresponding actionPerformed() method from the class created
//*** for each button. This method executes the method code, performing
//*** what the button is to do.
JButton add5Button = new JButton();
JButton subtract5Button = new JButton();
JButton nextNumberButton = new JButton();
//*** a JTextField creates a location where the client can place
//*** text
JTextField inputTextField = new JTextField(15);
//*** constructor
//*** Variables are given initial values
public ExampleGUI()
{
//*** set panel layouts
//*** panels could be LEFT, or RIGHT justified.
titlePanel.setLayout(new FlowLayout(FlowLayout.CENTER));
questionPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
inputNumberPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
addAndSubtractButtonPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
answerPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
nextNumberPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
//*** set Label fonts. You can use other numbers besides 30,20
//*** or 15 for the font size. There are other fonts.
Font quizBigFont = new Font("Helvetica Bold", Font.BOLD, 30);
Font quizMidFont = new Font("Helvetica Bold", Font.BOLD, 20);
Font quizSmallFont = new Font("Helvetica Bold", Font.BOLD, 15);
titleLabel.setFont(quizBigFont);
questionLabel.setFont(quizMidFont);
inputNumberLabel.setFont(quizMidFont);
add5Label.setFont(quizSmallFont);
subtract5Label.setFont(quizSmallFont);
answerLabel.setFont(quizBigFont);
nextNumberLabel.setFont(quizSmallFont);
inputTextField.setFont(quizMidFont);
//*** labels are given string values
titleLabel.setText("Add or Subtract Five");
questionLabel.setText("Please enter an integer number.");
inputNumberLabel.setText("Number:");
add5Button.setText(" Add 5 ");
subtract5Button.setText("Subtract 5");
answerLabel.setText("");
nextNumberButton.setText(" New Number ");
//*** the 3 buttons are connected to their classes
add5Button.addActionListener(new add5Button());
subtract5Button.addActionListener(new subtract5Button());
nextNumberButton.addActionListener(new nextNumberButton());
//*** Labels, buttons and textFields are added to their
//*** panels
titlePanel.add(titleLabel);
questionPanel.add(questionLabel);
//*** inputNumberPanel has 2 items added
inputNumberPanel.add(inputNumberLabel);
inputNumberPanel.add(inputTextField);
//*** submitPanel has two items added
addAndSubtractButtonPanel.add(add5Button);
addAndSubtractButtonPanel.add(subtract5Button);
answerPanel.add(answerLabel);
nextNumberPanel.add(nextNumberButton);
//*** The panels are added in the order that they should appear.
//*** Throughout the declarations and initializations variables were
//*** kept in this order to aid in keeping them straight
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
add(titlePanel);
add(questionPanel);
add(inputNumberPanel);
add(addAndSubtractButtonPanel);
add(answerPanel);
add(nextNumberPanel);
//*** The method writeToFile() is called from the constructor.
//*** One could call a read method from the constructor.
// writeToFile();
}// constructor
//*** This method writes 4 lines to a file. Eclipse puts the file in
//*** the folder of the project but not in the src folder. Put any
//*** file that you want read in the same place so that Eclipse can
//*** find it.
/*
private void writeToFile()
{
String fileName = "textFile.txt";
String line = null;
int count;
Scanner scan = new Scanner(System.in);
PrintWriter textStream = TextFileIO.createTextWrite(fileName);
System.out.println("Enter 4 lines of text:");
for (count = 1; count <= 4; count++)
{
line = scan.nextLine();
textStream.println(count + " " + line);
}
textStream.close( ); //*** did not require error handling
System.out.println("Four lines were written to " + fileName);
}
*/
//*** display() is called from main to get things going
public void display()
{ //*** A JFrame is where the components of the screen
//*** will be put.
JFrame theFrame = new JFrame("GUI Example");
//*** When the frame is closed it will exit to the
//*** previous window that called it.
theFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//*** puts the panels in the JFrame
theFrame.setContentPane(this);
//*** sets the dimensions in pixels
theFrame.setPreferredSize(new Dimension(600, 380));
theFrame.pack();
//*** make the window visible
theFrame.setVisible(true);
}
//*** method doSomething is called from an actionPerformend method
//*** demonstrating calling methods that can do work for you.
private void doSomething()
{
for(int x = 1; x <= 10; x++)
System.out.println(" in doSomething method x is " + x);
}
//*** This class has one method that is called when the add5Button
//*** is pushed. It retrieves the string from the JTextField
//*** inputTextField, converts it to an integer and manipulates the
//*** number.
//*** NOTE: a string of integers can be formed by creating a string
//*** with one of the numbers and then concatenating the other integers
//*** to form the string.
class add5Button implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
System.out.println(" in add5Button class");
doSomething();//*** other methods can be called
int number = Integer.parseInt(inputTextField.getText());
number = number + 5;
String stringNumber = "" + number;
answerLabel.setText(stringNumber);//*** answerLabel gets a new value
inputTextField.setText(stringNumber);
}
}
class subtract5Button implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
System.out.println(" in subtract5Botton class");
int number = Integer.parseInt(inputTextField.getText());
number = number - 5;
String stringNumber = "" + number;
answerLabel.setText(stringNumber);
inputTextField.setText(stringNumber);
}
}
//*** this method resets the values of inputTextField and answerLable
class nextNumberButton implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
inputTextField.setText("");//*** erases the values of this JTextField
answerLabel.setText("");//*** erases the value of this JLabel
}
}
public static void main(String[] args) throws IOException
{
ExampleGUI gameGUI = new ExampleGUI();
System.out.println("we can print to the console");
gameGUI.display();
}
}In: Computer Science
[The following information applies to the questions
displayed below.]
Morning Sky, Inc. (MSI), manufactures and sells computer games. The
company has several product lines based on the age range of the
target market. MSI sells both individual games as well as packaged
sets. All games are in CD format, and some utilize accessories such
as steering wheels, electronic tablets, and hand controls. To date,
MSI has developed and manufactured all the CDs itself as well as
the accessories and packaging for all of its products.
The gaming market has traditionally been targeted at teenagers and young adults; however, the increasing affordability of computers and the incorporation of computer activities into junior high and elementary school curriculums has led to a significant increase in sales to younger children. MSI has always included games for younger children but now wants to expand its business to capitalize on changes in the industry. The company currently has excess capacity and is investigating several possible ways to improve profitability.
MSI is considering outsourcing the production of the handheld
control module used with some of its products. The company has
received a bid from Monte Legend Co. (MLC) to produce 24,000 units
of the module per year for $27.00 each. The following information
pertains to MSI’s production of the control modules:
| Direct materials | $ | 13 |
| Direct labor | 6 | |
| Variable manufacturing overhead | 7 | |
| Fixed manufacturing overhead | 7 | |
| Total cost per unit | $ | 33 |
MSI has determined that it could eliminate all variable costs if
the control modules were produced externally, but none of the fixed
overhead is avoidable. At this time, MSI has no specific use in
mind for the space that is currently dedicated to the control
module production.
Required:
1. Compute the difference in cost between making and
buying the control module.
2. Should MSI buy the modules from MLC or continue to make them?
3-a. Suppose that the MSI space currently used for the modules could be utilized by a new product line that would generate $30,000 in annual profit. Recompute the difference in cost between making and buying under this scenario.
3-b. Does this change your recommendation to MSI?
In: Accounting
1. For each of the following scenarios, determine if there is an increase or decrease in supply for the good in italics. Explain your reasoning using economic principles.
a. Tomato growers have an unusually good season
b. New medical evidence reports that consumption of organic products reduces the incidence of cancer.
c. Wages of clothing producers increase.
d. The price of silver increases.
2.
For each of the
following scenarios, determine if there is an increase or decrease
in demand for the good in italics. Explain
your reasoning using economic principles.
a. The price of oranges increases
b. You love air travel, but get fired from your job.
c. A wet spring results in an unusually bad mosquito season, which can be mitigated with citronella
d. Idaho starts to require motorcycle helmets for adults.
3. Consider the market S&D schedules for ice cream – draw the curves & determine the equilibrium price & quantity. Calculate the S&D functions and solve for equilibrium mathematically.
|
Price (per quart) |
QD |
QS |
|
2 |
100 |
20 |
|
3 |
80 |
40 |
|
4 |
60 |
60 |
|
5 |
40 |
80 |
|
6 |
20 |
100 |
4. Suppose the market for wooden #2 pencils is in equilibrium. Determine how the following changes will affect the market and the equilibrium price and quantity. Explain your reasoning. Draw a graph to illustrate each of your answers.
b. The price of graphite (pencil lead) increases
c. School attendance falls
d. Legislation restricts lumber harvests
e. Pencil makers unionize and receive a large wage increase
f. The price of ballpoint pens falls
5. Suppose the market for laptops is in equilibrium. Determine how the following changes will affect the market and the equilibrium price and quantity. Explain your reasoning. Draw a graph to illustrate each of your answers.
b. The price of memory chips falls
c. Software prices fall
d. College students are required to own a laptop
e. The price of electricity increases
f. Doctors warn of health risks from radiation from video terminals
In: Economics
C++
For a job, you need to schedule everything in life. There is personal life, hobbies and lots of other things, and work. You have to manage your time well. For your job, you have to work on projects early and probably every day. How much time would you need to spend to keep up with your work when you have other things in your life?
To solve this problem, write a C++ program to help you figure out how many hours a day you should work on the project to reach your goal of finishing a project by the on-time due date. This program should have two parts:
Display the results from both of these calculations.
Then, compare them to find out if you have enough time each day to meet your goals. The program needs to show messages to alert the user of what’s going on.
After showing the results, allow the user to compute a new set of values until they want to end the program.
In: Computer Science
Fact Pattern –
South Florida CPAs, LLP is a boutique accounting firm in FL. You are currently employed as a tax consultant at South Florida CPAs and have many intriguing clients with interesting (and sometimes strange) circumstances. Because the 2019 tax filing deadline is rapidly approaching, you receive several phone calls from clients inquiring about the tax consequences of recent transactions and events. The second and third pages of this document contain a summary of these phone calls. Note: you will be expected to complete this project using current, post?Tax Cuts and Jobs Act (H.R.1) law. In other words, apply the “new” law to the fact patterns below. To the extent your conclusion is contingent on an unknown fact, you should discuss possible outcomes for different assumptions.
1) Ally is a graduate accounting student at the local university. She is the recipient of a $1,000 scholarship from the university. In addition, Ally works as a part-time teaching assistant in the school of accountancy. She is paid $7,000 per the calendar year and receives a tuition waiver covering 100 percent of her tuition. If not for the waiver, Ally would have paid $8,000 for tuition. Further, she paid $400 for books and supplies related to her coursework and incurred living expenses of $6,200. How much must gross income Ally report?
2) Candace found nearly $10,000 in cash inside the spare tire compartment of a used car she purchased at an auction in December of last year. She did not discover the money until February of the following year. The auctioneer has not asked about the vehicle, nor has anyone else stepped forward to claim the money. Must the cash be included in the discoverer’s gross income? If so, in what year must the income be recognized?
3) Irene contributes $275 towards a cause on a crowdfunding site to support victims of a recent hurricane. When the time comes to file her taxes, she wonders whether the contribution is deductible. Irene also contemplates whether the victims of the hurricane (i.e., the ultimate recipients of the contributions) will have to pay tax on the distribution of the funds from the crowdfunding effort. Is the contribution deductible for Irene, and are the proceeds included in gross income for the beneficiaries?
In: Accounting
Week 8 Assignment 4 Submission
If you are using the Blackboard Mobile Learn iOS App, please
click "View in Browser”.
Click the link above to submit your assignment.
Students, please view the "Submit a Clickable Rubric Assignment" in
the Student Center.
Instructors, training on how to grade is within the Instructor
Center.
Assignment 4: Win the Contract
Due Week 8 and worth 120 points
Imagine your small business produces tiny remote control aircraft
capable of long sustained flights. You are ready to expand your
business by competing for Department of Defense (DoD) contracts.
You wish to bid on a deal that will be worth over $600,000 to your
expanding company.
Write a two to three (2-3) page paper in which you:
Select the simplified acquisition method that fits your company the most, and then provide a rationale for your selection. Note: Remember you are a small business that will have a massive expansion if you win this contract.
Analyze all parts and sections of the uniform contract format that could present a problem in this scenario. Suggest how you will adjust your approach to turn the problems you have identified into strengths for your small company.
Use at least three (3) quality resources in this assignment. Note: Wikipedia and similar Websites do not qualify as quality resources.
Your assignment must follow these formatting requirements:
Be typed, double-spaced, using Times New Roman font (size 12), with one-inch margins on all sides; citations and references must follow APA or school-specific format. Check with your professor for any additional instructions.
Include a cover page containing the title of the assignment, the student’s name, the professor’s name, the course title, and the date. The cover page and the reference page are not included in the required assignment page length.
The specific course learning outcomes associated with this
assignment are:
Assess the simplified acquisition methods.
Differentiate between the parts and sections of the Uniform Contract Format.
Use technology and information resources to research issues in contract administration and management.
Write clearly and concisely about contract administration and management using proper writing mechanics.
In: Finance
Morning Sky, Inc. (MSI), manufactures and sells computer games.
The company has several product lines based on the age range of the
target market. MSI sells both individual games as well as packaged
sets. All games are in CD format, and some utilize accessories such
as steering wheels, electronic tablets, and hand controls. To date,
MSI has developed and manufactured all the CDs itself as well as
the accessories and packaging for all of its products.
The gaming market has traditionally been targeted at teenagers and young adults; however, the increasing affordability of computers and the incorporation of computer activities into junior high and elementary school curriculums has led to a significant increase in sales to younger children. MSI has always included games for younger children but now wants to expand its business to capitalize on changes in the industry. The company currently has excess capacity and is investigating several possible ways to improve profitability.
MSI is considering outsourcing the production of the handheld
control module used with some of its products. The company has
received a bid from Monte Legend Co. (MLC) to produce 25,000 units
of the module per year for $22.00 each. The following information
pertains to MSI’s production of the control
modules:
| Direct materials | $ | 13 |
| Direct labor | 6 | |
| Variable manufacturing overhead | 2 | |
| Fixed manufacturing overhead | 8 | |
| Total cost per unit | $ | 29 |
MSI has determined that it could eliminate all variable costs if
the control modules were produced externally, but none of the fixed
overhead is avoidable. At this time, MSI has no specific use in
mind for the space that is currently dedicated to the control
module production.
Required:
1. Compute the difference in cost between making and
buying the control module.
Difference in Cost:
2. Should MSI buy the modules from MLC or continue
to make them?
| Buy | |
| Make |
3-a. Suppose that the MSI space currently used for
the modules could be utilized by a new product line that would
generate $41,000 in annual profit. Recompute the difference in cost
between making and buying under this scenario.
Difference in Cost:
3-b. Does this change your recommendation to
MSI?
| Yes | |
| No |
In: Accounting
Account for the lack of success of a new product with reference to the following stages of new product development.
Concept Development
marketing strategy
test marketing
In: Accounting
Explain how corporations have adopted the Ecommerce as part of the strategy to expand its operations over new customers or new geographic areas.
In: Computer Science
In: Operations Management