In the Gui need a file in and out writter. That also takes from in file and out file. Write errors to no file found or wrong file. Clear button and Process buttons need to work.
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
import java.io.*;
import javax.swing.*;
@SuppressWarnings("serial")
public class JFileChooserDemo extends JFrame implements
ActionListener
{
private JTextField txtInFile;
private JTextField txtOutFile;
private JButton btnInFile;
private JButton btnOutFile;
private JButton btnProcess;
private JButton btnClear;
public JFileChooserDemo()
{
Container canvas = this.getContentPane();
canvas.setLayout(new GridLayout (3,1));
canvas.add(createInputFilePanel());
canvas.add(createOutputFilePanel());
canvas.add(createButtonPanel());
this.setVisible(true);
this.setSize(800, 200);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public JPanel createInputFilePanel()
{
JPanel panel = new JPanel(new
FlowLayout(FlowLayout.LEFT));
panel.add(new JLabel("In File"));
txtInFile = new JTextField(60);
panel.add(txtInFile);
btnInFile = new JButton("In File");
panel.add(btnInFile);
btnInFile.addActionListener(this);
return panel;
}
public JPanel createOutputFilePanel()
{
JPanel panel = new JPanel(new
FlowLayout(FlowLayout.LEFT));
panel.add(new JLabel("Out File"));
txtOutFile = new JTextField(58);
panel.add(txtOutFile);
btnOutFile = new JButton("Out File");
panel.add(btnOutFile);
btnOutFile.addActionListener(this);
return panel;
}
public JPanel createButtonPanel()
{
JPanel panel = new JPanel(new
FlowLayout(FlowLayout.CENTER));
btnProcess =new JButton("Process");
btnProcess.addActionListener(this);
panel.add(btnProcess);
btnClear =new JButton("Clear");
btnClear.addActionListener(this);
panel.add(btnClear);
return panel;
}
public static void main(String[] args)
{
new JFileChooserDemo();
Scanner file = null;
PrintWriter fout= null;
try {
file = new Scanner(new
File("numbers.txt"));
fout = new PrintWriter("TotalSums.txt");
while(file.hasNext())
{
@SuppressWarnings("resource")
Scanner line = new
Scanner(file.nextLine());
int totalSum = 0;
while (line.hasNext()) {
int number = line.nextInt();
totalSum += number;
fout.print(number);
if (line.hasNext())
{
fout.print("+");
}
}
fout.println("=" + totalSum);
}
}
catch
(FileNotFoundException e)
{
System.out.println("NOT FOUND");
}
finally
{
if(fout!=null)fout.close();
}
if(file!=null)file.close();
}
public void clearInput()
{
txtInFile.setText(""); txtOutFile.setText("");
}
@Override
public void actionPerformed(ActionEvent e)
{
if(e.getSource() == btnInFile)
{
JFileChooser jfcInFile = new
JFileChooser();
if(jfcInFile.showOpenDialog(this)
!= JFileChooser.CANCEL_OPTION)
{
File inFile =
jfcInFile.getSelectedFile();
txtInFile.setText(inFile.getAbsolutePath());
}
else
{
}
}
if(e.getSource() == btnProcess)
{
File file = new
File(txtInFile.getText());
try
{
Scanner fin =
new Scanner(file);
}
catch (FileNotFoundException
e1)
{
e1.printStackTrace();
}
}
}
}
In: Computer Science
Is groundwater quality affected by PCBs? state reasons
In: Chemistry
The Banana Republic’s stock of capital at the end of 2015 was $200 billions. The Republic’s investment during the year 2016 was $ 40 billions. The depreciation rate in the Republic was 10%.
23- Depreciation of the capital during the year 2016 was _______
a. $20.0 billions c. $13.0 billions
b. $24.0 billions d. $180.0 billions e. $10.0 billions
24- The net investment during the 2016 in the Republic was _______
a. $20.0 billions c. $13.0 billions
b. $8.0 billions d. $10.9 billionse. $16.0 billions
25. The stock of capital at the end of 2016 was _________
a. $100.0 billions c. $13.0 billions
b. $220.0 billions d. $93.0 billions
e. can’t be determined
I know the answers I need to know formulas/ how to get the answers
In: Economics
|
obs freq |
monolingual |
bilingual |
multilingual |
|
USA |
127 |
12 |
10 |
|
Canada |
84 |
25 |
12 |
|
Mexico |
134 |
9 |
8 |
|
England |
133 |
23 |
19 |
|
Spain |
56 |
49 |
17 |
|
France |
108 |
25 |
15 |
|
Germany |
48 |
79 |
14 |
|
a) What statistical test will you use? |
|
b) If needed, does your data have equal variance? Put NA is not needed. |
|
Do you need to transform your data? |
|
If yes, does transformed data have equal variance? |
|
c) Ho: statistical and explanatory |
|
HA: statistical and explanatory |
|
d) p-value? |
|
Accept or reject null hypothesis? |
|
Discuss results of your data (patterns, post-hoc test, etc): |
In: Math
Are relevant revenues and relevant costs the only information needed by managers to select among alternatives? Examples,
In: Accounting
The simple interest rate per year that will accumulate the same amount of money in 2 years as a compound interest rate of 20% per year is closest to:
Question 5 options:
|
44% |
|
|
10% |
|
|
22% |
|
|
12.4% |
In: Economics
What are the economic and political arguments for regional economic integration? Given these arguments, why don't we see more substantial examples of integration in the world economy. What was the effect of the creation of a single market and single currency with the EU on competition within the EU? Why?
In: Economics
Dumping
Business Case Problem 11-4, Page 228
Nuclear power plants use low-enriched uranium (LEU) as a fuel. LEU consists of feed uranium enriched by energy to a certain assay--the percentage of the isotope necessary for a nuclear reaction. The amount of energy required is described by an industry standard as a "separative work unit" (SWU). A nuclear utility may buy LEU from an enricher, or the utility may provide an enricher with feed uranium and pay for the SWU's necessary to produce LEU. Under an SWU contract, the LEU returned to the utility may not be exactly the uranium the utility provided. This is because feed uranium is fungible and trades like a commodity (such as wheat or corn), and profitable enrichment requires the constant processing of undifferentiated stock. Foreign enrichers, including Eurodif, S.A, allegedly exported LEU to the United States and sold it for "less than fair value." Did this constitute dumping? Explain. If so, what could be done to prevent it? [United States v. Eurodif, S.A., 555 U.S. 305, 129 S.Ct. 878, 172 L.Ed.2d 679 (2009)] (Cross & Miller, 2018, p. 228)
In: Economics
In: Computer Science
For this discussion, you are tasked with finding an article or television segment discussing either a US or foreign policy change that is having some type of impact on the manufacturing process, price of goods and employment rates in the US. I am going to ask that you only look at this discussion in terms of policy and not through the often-divisive lens of politics. Please copy and paste your article into the discussion forum or the link if it is a television segment. Additionally, please summarize what the policy is that is being discussed and how it is impacting manufacturing in this country.
In: Economics
|
A. |
beads-on-a-string structure |
|
B. |
pyrimidine |
|
C. |
proof for the semi-conservative model of DNA replication |
|
D. |
number of base pairs per turn of the double helix |
|
E. |
biochemical evidence of complementarity |
|
F. |
number of nanometers between stacked bases |
|
G. |
positive supercoiling |
|
H. |
transduction |
|
I. |
percentage of adenine in a DNA molecule if the percentage of thymine is 18% |
|
J. |
direction of new strand synthesis |
|
K. |
involves two hydrogen bonds |
|
L. |
site of chemical difference between DNA and RNA |
|
M. |
negative supercoiling |
|
N. |
radioisotope for labeling DNA |
|
O. |
revealed by X-ray crystalography |
|
P. |
test for dynamic changes in chromatin structure |
|
Q. |
site of actively transcribed genes |
|
R. |
double-ring base |
|
S. |
'attacks' phosphate group of incoming dNTP |
|
T. |
direction of polymerase movement in terms of the template orientation |
|
U. |
B-form secondary structure |
|
V. |
radioisotope for labeling proteins |
|
W. |
involves three hydrogen bonds |
|
X. |
transformation |
|
Y. |
formed by loops on a protein scaffold |
|
Z. |
site of DNA's acidic property |
|
AA. |
Barr body |
|
AB. |
DNA monomer |
|
AC. |
substrate of DNA polymerase |
|
AD. |
formed by attractive interactions between chromatosomes |
|
AE. |
differential enzymatic digestion of cell lysate |
|
AF. |
differential radioisotope labeling of proteins and DNA |
|
AG. |
percentage of adenine in a DNA molecule if the percentage of guanine is 18% |
Choices-
|
phosphate group |
2'-OH group, deoxyribonucleoside triphosphate, deoxyribonucleotide, adenine, guanine, Chargaff's rules, Avery, McLeod, McCarty experiment, Hershey-Chase experiment, 5'-to-3', 3'-to-5', N-15, S-35, G-C complementarity, change in phenotype due to uptake of foreign DNA, 10, 32, 45 complete helical turns in a 600 bp DNA molecule ,
|
causes compaction of DNA and promotes strand separation |
, 30 nm fiber, 300 nm fiber, euchromatin, heterochromatin ,
|
DNase I sensitivity, cytosine |
In: Biology
Physics 100 – Uniform Motion Page 1 of 6
SAN DIEGO MESA COLLEGE Name_________________________
PHYSICS 100 LAB REPORT Date __________Time___________
Partners ______________________
TITLE: Uniform Motion ______________________________
______________________________
______________________________
Objective: To determine the equation of motion for a toy
tractor.
Theory: The motion of an object is described by the change of it's
position with respect to time,
as measured from a start point for it's position and it's time (
i.e. at x=0 and t=0). The
mathematical relationship for an object's position as a function of
the time it reaches
that position is called the object's equation of motion. The
simplest equation of motion
is for motion without acceleration. This motion is called uniform
motion.
Equipment: motorized cart tape timer mount
tape-timers 1 1/2 meter strips
meter-stick brick
masking tape
Setup:
Paper strip 1.5 meters long
Masking tape
Brick
C(caarbrboonn p saidpe ru dpi s)k
Tapper
M o ctaortiz ed
Physics 100 – Uniform Motion Page 2 of 6
Technique: The tape timer has a circular piece of carbon paper and
a tapping mechanism. The
tapper taps on the carbon paper specific number of times per
second. As the toy tractor
moves, the tape timer puts marks on the paper strip at regular time
intervals. The
amount of time between marks (the Δt) is decided by which direction
the switch on the
timer is moved when it is turned on. There are two settings 10Hz
and 40Hz. We will be
using the 10Hz setting for a Δt = 0.1seconds. The tractor will move
a certain distance
Δx between each mark. These two sets of values will give us the
data we need to get
the equation of motion.
Procedure: Turn the tractor on temporarily to see which direction
it will move.
Face it so it will move away from the tape timer.
Get one of the long paper strips.
Feed one end through the first plastic slot, then in between the
silver metal plate and the
circular piece of carbon paper, and out through the other plastic
slot. If it's not feeding
easily, slightly bend a small portion of the end of the paper
strip. This might help.
Take a small piece of masking tape and tape the end of the paper
strip nearest to the
timer to the top of the tractor.
Place the tractor near the tape timer, but leave enough room to
lift the tractor off the
table a little bit (you'll lift it later).
Pull the rest of the tape out the back of the tape timer so that it
is hanging over the edge
of the table.
Have one partner lift the tractor off the table enough so that they
can turn the tractor on.
Have another partner on the opposite end of the table ready to stop
the tractor.
Have a third partner move the switch on the tape timer to the 10Hz
position. The timer
should start clicking.
Have the person with the tractor turn it on, aim it towards the
brick and set it on the
table.
Once the tractor gets to the other side of the table, move the
timer's switch to the off
position to turn it off.
Remove the paper strip from the tractor and turn it over. Make sure
the marks made by
the timer are dark and visible.
If they are easily visible, then you are ready to start the
analysis. If not, try rotating the
circular piece of carbon paper and run through the procedure again.
If this still doesn't
produce visible marks, ask the instructor for help.
Analysis: Look at the marks (dots) on your strip.
The beginning of your strip is the side that was attached to the
tractor. The first few
marks probably won't look evenly spaced.
Choose and circle the first dot, after skipping several, which
appears sharp and is
evenly spaced with its neighbors. This is dot #1 which occurs at t
= 0 sec. and has a
starting position of x = 0 cm.
Lay the paper strip along a meter stick or ruler and use masking
tape to attach the first
dot you choose for t = 0 and x= 0 to the zero end of your meter
stick or ruler.
Physics 100 – Uniform Motion Page 3 of 6
Record the position of where each dot is along the ruler or meter
stick.
Calculate the distance interval between each dot and the dot before
it. The distance
interval is the position of each dot minus the position of the dot
before it. The distance
interval is also known as Δx.
Dot # Position
(cm)
Time
(Ticks)
Distance
Interval
(cm)
Ave.Velocity
In interval
1 0.0 0 (cm/sec)
2 1
3 2
4 3
5 4
6 5
7 6
8 7
9 8
10 9
The average velocity that the object obtains during an interval of
one tick is the distance
interval traveled during that one tick divided by the time elapsed
(one tick). To
calculate the average velocity, divide the distance interval by one
tick.
This gives you units of cm / tick.
To convert this to a usable number, you will need to multiply this
number by the
Number of ticks per 1 second.
There are 10 ticks per second.
This will give you units of cm / sec.
Fill in your table with each of the average velocities.
Physics 100 – Uniform Motion Page 4 of 6
Because the motion is uniform, the average velocity over all the
intervals can be found
by adding up all the average velocities, and dividing by the total
number of average
velocities intervals.
Record this value below the average velocity column on the data
sheet.
Analysis: The equation of motion is found by plotting the distance
(in cm, on the y-axis) as a
function of time (in ticks, on the x-axis).
Plot this on the linear graph paper provided in your lab
packet.
Calculate the slope of your graph, showing all work including
units, in the space
provided below.
(Dfinal - Dinitial) / (Tfinal - Tinitial) = slope
Where D is distance in cm and T is the time in ticks
Convert this slope to cm / second using the same conversion as you
did for the average
velocity.
SLOPE FROM GRAPH: CONVERSION:
Calculate the percent difference, in the space provided below,
between the average
velocity from the data sheet and the slope of the graph, using the
formula:
% difference = (difference between two experimental values / the
larger of two values)
x 100
What name is given to the constant (the slope of the graph) which
relates the distance
traveled by the tractor and the time it took to get to that
distance?
Physics 100 – Uniform Motion Page 5 of 6
Write the equation of the graph, in the form y = mx + b. in the
space below. Where y is
the variable plotted on the vertical axis and x is the variable
plotted on the
horizontal axis, m is the slope of the graph, and b is the vertical
intercept. The vertical
intercept, b, will be close enough to zero to be neglected.
Don't forget to include units in your equation.
Use this equation to calculate, showing all work including units in
the space provided
below, how far the tractor would travel in 45 seconds.
How many meters is this? Show your work in converting the
units.
How many yards is this? Show your work in converting the
units.
Analysis:
Use this equation of motion to predict how many MINUTES it would
take the tractor to
Travel 11.78m which is the length of the lab room.
Show all your work below including unit conversions.
Physics 100 – Uniform Motion Page 6 of 6
Summary of Results:(What is the equation of motion for the tractor,
in words)?
In: Physics
The mass of a particular eagle is twice that of a hunted pigeon. Suppose the pigeon is flying north at ??,2=18.1vi,2=18.1 m/s when the eagle swoops down, grabs the pigeon and flies off. At the instant right before the attack, the eagle is flying toward the pigeon at an angle ?=40.3θ=40.3° below the horizontal and a speed of ??,1=37.9vi,1=37.9 m/s.
What is the speed of the eagle immediately after it catches its prey?
What is the magnitude of the angle, measured from horizontal, at which the eagle is flying immediately after the strike?
In: Physics
This time Ron is at his wits end. He has sent the accounting team out of his office to rework the numbers. "That simply cannot make sense. If I'm making more than I'm spending, it's a good decision; right?" He walks into your office for your weekly meeting and asks rhetorically "If I'm spending $2,000,000 today on a new plant and that new plant is going to produce $205,000 for each of the next ten years in income how can that possibly be a negative net decision for the company?"
Can you explain to Ron the concept involved and how that could be a "negative net decision"?
Provide constructive feedback to at least two other students' postings.
In: Accounting
suppose an economic boom is driven by very high levels of consumer confidence. compare and contrast the Keynesian and Monetarist approach in preventing the economy from overheating
In: Economics