The Program is for an investment firm

PLEASE HELP!!!
This program will read in a file, then will do an average for the month or year or will print out a graph for the month or the year.
Here are the errors and the code:
InvestUnlimitedDH.java [67:1] No method found matching setData(int,int)
myUse.setData (21, c);
^
InvestUnlimitedDH.java [71:1] Undefined variable, class, or package name: myUse
myUse.setData (248, c);
^
InvestUnlimitedDH.java [71:1] Undefined variable, class, or package name: c
myUse.setData (248, c);
^
InvestUnlimitedDH.java [71:1] Invalid expression statement.
myUse.setData (248, c);
^
4 errors
import java.text.DecimalFormat;
import javax.swing.*;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import java.lang.*;
public class InvestUnlimitedDH
public static void main (String args [])
InvestGui myInvest = new InvestGui();
myInvest.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
class InvestGui extends JFrame implements ActionListener
JComboBox box;
JButton button1, button2;
JRadioButton rbutton1, rbutton2;
//JTextArea
//ListText
public void Invest()
Container c = getContentPane();
c.setLayout(new FlowLayout());
String []names = {"Disney", "Black and Decker", "OutBack Steakhouse"};
box = new JComboBox (names);
c.add(box);
button1 = new JButton ("Chart");
button2 = new JButton ("Average");
rbutton1 = new JRadioButton ("Month");
rbutton2 = new JRadioButton ("Year");
c.add(button1);
c.add(button2);
c.add(rbutton1);
c.add(rbutton2);
box.addActionListener(this);
button1.addActionListener(this);
button2.addActionListener(this);
setSize (200, 150);
setVisible (true);
public void actionPerformed (ActionEvent event)
if (event.getSource() == button2)
if(rbutton1.isSelected())
int c = box.getSelectedIndex();
UseDataClass myUse = new UseDataClass();
myUse.setData (21, c);
double y = myUse.getAvg();
else
myUse.setData (248, c);
else ;
class GraphicGui extends JFrame
public void paint (Graphics g)
super.paint(g);
//the outer rectangle
g.drawRect(30,30,478,350);
//the y value gridlines
g.drawLine(30,80,508,80);
g.drawString("60",15,85);
g.drawLine(30,130,508,130);
g.drawString("50",15,135);
g.drawLine(30,180,508,180);
g.drawString("40",15,185);
g.drawLine(30,230,508,230);
g.drawString("30",15,235);
g.drawLine(30,280,508,280);
g.drawString("20",15,285);;
g.drawLine(30,330,508,330);
g.drawString("10",15,335);
//the array holds the data in reverse order - most recent data at top
//we want to graph oldest to newest (left to right)
//so array is accessed from the end to zero, i allows us to place data
//left to right, while reading array from bottom up
int i = 0;
for (int count = data.length-1; count >=0; count--)
//x = position from left always starting 30 pixels out(1.9 is used to
//spread the data across window
int x = (int)(30+(i*1.9));
//380 is the location of the bottom line of rectangle, measure up from
//380 to determine location of where price should go (5.0 is used to //spread data correctly)
int y = (int)(380-(data[count]*5.0));
g.fillOval(x,y, 3, 3);
i++;
class DataClass
//dataList has three rows and 248 columns of doubles
private static double[][]dataList = new double [3] [100]
//these are the names of the files that hold the data
private static String[]fileNames = {"Disney", "Black and Decker", "OutBack Steakhouse"};
public static double setData()
try
for(int index = 0; index < fileNames.length; index++)
BufferedReader dat = new BufferedReader(new FileReader("a:\\" + fileNames[index]));
//inner loop will go through 248 times-the length of the file
for (int count = 0; count < 100; count ++)
//reads in a string from file and converts to a double and stores in the array
dataList[index][count] = Double.parseDouble(dat.readLine());
//close file before opening next file
dat.close();
catch(FileNotFoundException e)
System.out.println(e);
catch(IOException x)
System.out.println(x);
//called by method setData in UseDataClass
public static double[][]getData()
return dataList;
class UseDataClass
//t = the timeframe and comp = the company
int t, comp;
//x = the dataList
double[][]x = DataClass.getData();
private double [][]theData;
//gets the array from the DataClass
public void setData ()
theData = DataClass.getData(month, year)
company number t = time; comp = co;
setData (int time, int co);
findMin();
//this method finds out the smallest number in each array
void findMin()
//set minimum = to first value in array
double min = theData[comp][0];
for int count = 0; count < theData[comp].length; count ++)
if (theData[comp][count] < min)
//found new minimum
min = theData[index][count];
public double getAvg()
month = t * 21;
year = t * 248
return result;

Not exactly sure what is being accomplished, but your problem lies with the setData method (as stated by the trace).
When calling the method, you are doing myUse.setData(21, c) or myUse.setData(248, c). In both cases, you are passing two arguments (21 and c or 248 and c). However, the method setData() in the UseDataClass is not setup to accept any arguements. You need to do one of the following:
1) if you want to use the two numbers being passed, you need to change the method to be something like:
//up top:
myUse.setData(21,c);
//within the UseDataClass class:
setData(int a, int b)
//then do whatever you want to with the a and b...for instance:
t = a;
co = b;
//now t =21 and co = c
2) if you don't want to use any of the numbers being passed, then don't pass them:
//up top:
myUse.setData();
//you can just leave the setData() method alone since it is already setup to work without arguements
3) If you want to switch between the two methods (ie - sometimes pass arguements and sometimes not), you can create another method like the one in the first example.
here's what I mean:
class UseDataClass
public void setData()
//do what ever you want here without worrying about any values...
public void setData(int a, int b)
//now use the a and b values...
You could then do either:
myUse.setData();
or
myUse.setData(21, c);

Similar Messages

  • I have been unable to download adobe acrobat pro, which I purchased on a month to month basis almost exactly 1 year ago, since I purchased it. I just received a renewal email and it had a link to download the program and for the first time when I clicked

    I have been unable to download adobe acrobat pro, which I purchased on a month to month basis almost exactly 1 year ago, since I purchased it. I just received a renewal email and it had a link to download the program and for the first time when I clicked on the link it actually sent me to a page that had the icon to download now. I clicked on that, but when I went to open the file and start downloading after about 3 minutes into downloading it says an error had occurred. Can anyone help me?

    I am a little worried. If you are an existing subscriber why would Adobe need you to download... I wonder if the message is a fake.
    I'm not clear, if you've had it for a year, whether you need to download, or you are just following the email?
    This page with the icon to download now. Was it a page on adobe.com ?

  • At the very end of creating an email account the program asks for a software security device password, I have no idea what this is or where to find it.

    At the very end of creating an email account the program asks for a software security device password, I have no idea what this is or where to find it. To my knowledge I don't have a "software security device". I am using Windows 7 on an IMac.

    What is the exact prompt or error message you get?

  • Just put my i-tunes library on a 2nd hard drive, how do I easily change the location where the program looks for current songs from the C:/ drive to the new drive without going thru each song individually in the "get info" tab

    I just installed a new hard drive and transfered my i-tunes library to the new drive.  How can I make a bulk change of the location the program looks for the current songs.  I know you can do it song by song from the "get info" tab but I need to do it for all 4500 songs.  I have already changed the location that new files are stored to the new hard drive.

    The pop-up lets you connect to the library file, iTunes Library.itl, on the external drive. This will, in turn, automatically update the preference for the iTunes Media folder to be the iTunes Media or iTunes Music folder inside the iTunes folder on the external drive and it will update the locations of all the content inside the media folder so that it uses the version on the external drive.
    This works seamlessly if all iTunes content was inside the iTunes Media (or iTunes Music) folder (which was itself inside the iTunes library folder) before you moved/copied the iTunes folder. For content outside the iTunes Media folder iTunes should remain connected to the original location. These files should be consolidated (before or after the move/copy) and in addition, if available the library should be upgraded to the newer layout which places iPod Games and Mobile Applications inside the media folder instead of the library folder. (File > Library > Organize Library...)
    For split libraries there are methods to rejoin them before moving (preferred) or repairing after the fact (e.g. my script) which I can go into if needed.
    tt2

  • I have a problem with elements 8. When ever I start a new project, the program searches for the old, latest used filmmaterial, I have used before. That means, if I use a different DVD, it take so much time, until the program starts. So how can I stopp the

    I have a problem with elements 8. When ever I start a new project, the program searches for the old, latest used filmmaterial, I have used before. That means, if I use a different DVD, it take so much time, until the program starts. So how can I stopp the automatically uploading of old material?
    Thanks

    You have 2 unreachable statements in this method.
    public static int eval(String s2, String op, String s3) {
    return lookup(s2);
    return lookup(op);
    return lookup(s3);
    } You're missing a } at the end of this method:
    public static int lookup(String s) {
        for(int k = 0; k < symbols.length; k++){
            String symbol = symbols[k];
            if(s.equals(symbol))
                return k;
        }You have some loose } and ; at the end of the file:
    public static void main(String args[])
    commandline();
    }

  • The adobe flash player shows in the plugins manager that it is installed but when i look in the program files for firefox ther is no adobe flash files

    even tho the flash player says its installed it still wont work i have tried uninstalling the programs and removing all registry values for them (not all at once) i have tried every troubleshooting tip for both programs to resolve this issue
    the flash player works fine on other browsers but not firefox

    See http://kb.mozillazine.org/Issues_related_to_plugins#Identifying_installed_plugins
    You can see the installed plugins on the [http://kb.mozillazine.org/About%3Aplugins about:plugins] page.<br />
    If you set the pref plugin.expose_full_path to true on the about:config page then you see the full path of plugins on the about:plugins page.<br />
    It is best not to leave that pref set to true as it exposes that full path to web servers, so reset that pref to false after you are done with the about:plugins page.<br />
    <br />
    You can open about:plugins and about:config via the location bar, like you open a website (about: is a special protocol to access some build-in pages).<br />
    If you get a warning when opening the about:config page then you can confirm that you want to continue.
    You can also try to delete the file pluginreg.dat and let Firefox rebuild a new version.<br />
    See http://kb.mozillazine.org/Issues_related_to_plugins

  • Hi,i have dificult to acces on itune.the avfoundationCF.dll error 7 (windows error 126) is missing from my computer.how to reinstal the program,thanks for your help

    hi i have adifficult to acess itune. the avfoundationCF.dll is missing on my laptop error 7( windows error 126).how to reinstal it,thanks for your help

    Taken at face value, you're having trouble with an Apple Application Support program file there. (Apple Application Support is where single copies of program files used by multiple different Apple programs are kept.)
    Let's try something relatively simple first. Restart the PC. If you're using Vista or 7, now head into your Uninstall a program control panel, select "Apple Application Support" and then click "Repair". If you're using XP, head into your Add or Remove Programs control panel, select "Apple Application Support", click "Change" and then click "Repair".
    If no joy after that, try the more rigorous uninstall/reinstall procedure from the following post. (If you've got XP, although the procedure is for Vista and 7, just read "Computer" as "My Computer", read "Uninstall a program control panel" as "Add or Remove programs control panel" and assume the system is 32-bit, and you'll be doing the right things.)
    Re: I recently updated to vista service pack 2 and I updated to itunes 10.2.1 and ever

  • Why is the program asking for a password to color a PDF. I changed the end to png and it was working and now quit

    I was using PDF from a nonprofit i work for to color with PS Elements. It worked and then no longer allows me to drop files into PS Elements.
    First I download the PDF's ....then I change the end from PDF TO .png and then drag and drop into PS Elements ....color .....
    Then I put the files into DropBox  and send them to iphoto to use in Doceri
    FIrst the error message was about Parse
    Now the message is that I need a password to use the program.
    Friends all over the country can get this to work but it is NOT WORKING. I emptied and redownloaded dropbox.....not the problem.
    We set up a dummy account and still could nto use.

    PSE asks for a password when the file was password protected by whoever created it. You can't really expect decent results if you just change the extension of a file. A PDF is a very different animal than a png file and contains very different information, so it's not surprising your results are poor. That's the sort of thing you may get away with once in a while, but you can't expect to use it as a regular workflow.
    Your whole procedure sounds extremely complicated for no particular good reason, at least as you describe it. It would be simpler to open the pdf in Preview and save a copy as a png if that's the format you need, but saving a pdf as anything other than a pdf will generally create a lousy looking file. I would just leave PSE out of the equation here, since you don't seem to be doing any editing with it.

  • How to find the program name for LSMW

    hi experts,
                  i have created a LSMW for uploading data in HR.i hope there will be a ABAP progarm automatically generated from it .where i can find the program name .
    i have succesfully completed all the 14 stepas and data is uploading comfortably .
    thanx in adavance

    hi,
    just do liek this to know abt the program name,
    select system at the menu in your lsmw,
    select status ,
    in popup u'll get the proram name and all other related details.
    reward points if useful,
    regards,
    seshu.

  • Find the program which retrive the program name for 2 years.

    Hi Team,
    i have requirement like , i am working on BRITVIC Client , they want to me write a program which has retrive the all development Z program name for last 2 years.
    could you please suggest me the standard program which has retrived all program name for last 2 years.
    Thanks in Advance.
    puneet.

    Hi,
    go to table EUDB - Development Environment Objects
    see the program name NAME as putting Z*
    where DATUM is the creation date
    ZEIT is the creation time
    also you can go for table REPOSRC - Report Source Code
    Arunima
    Edited by: Arunima Rudra on Nov 18, 2008 3:44 PM

  • TS3276 I use Mail for my email and lately, if I get an email coming in while writing one, the program freezes for a few seconds. Frustrating.

    I have a 27" iMac 3.06 GHz Intel Core 2 Duo. I use Mail for my email. Just in the past 2 -3 months, if I'm writing an email while another one is coming in to the inbox, the program freezes, the spinning colour ball appears and I can't continue typing for 5 seconds or more. I get and write a lot of emails so it's frustrating.
    I've also noticed that sending messages is taking longer than it used to. The program spins its wheels for a few seconds before sending. Definitely noticeably longer than prior to this situation. Any ideas anyone?

    Hello,
    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
    Note: ''This will temporarily log you out of all sites you're logged in to.''
    To clear cache and cookies do the following:
    #Go to Firefox > History > Clear recent history or (if no Firefox button is shown) go to Tools > Clear recent history.
    #Under "Time range to clear", select "Everything".
    #Now, click the arrow next to Details to toggle the Details list active.
    #From the details list, check ''Cache'' and ''Cookies'' and uncheck everything else.
    #Now click the ''Clear now'' button.
    Further information can be found in the [[Clear your cache, history and other personal information in Firefox]] article.
    Did this fix your problems? Please report back to us!
    Thank you.

  • Thunderbird automatically upgraded to version 24.6.0. Now, when you start it, the program freezes for about 15 seconds before showing mails, etc.

    Annoying that the default option is to automatically upgrade, and this automatic upgrade then makes the program 10x worse.

    Thanks for everyone's help, btw. Hopefully this will help others who encounter a similar problem.

  • I cannot access any of my downloaded programs. When I click on the icon I just see the program appear for a split of a second. What can I do?

    I just updated my iPad to 4.3.1 and resented with my computer. Now I cannot access any of my applications. When I click on any icon the application appears for a split second and closes down right away. How can I correct this and re-establish access to my applications?

    The latest iOS version is 4.3.3. Did the update seem to go okay? When you connect the iPad up to your computer and run iTunes, does it indicate another OS update is available? Try to continue with the OS upgrades before launching apps.

  • Where can I find the program updates for each updated version of Flash Player?

    Where can I find info on different updated versions of Flash Player?
         This info includes:
              Changes/updates/improvements to the program
              Version number
    Also, how do I view my own program's version number?  I'm sure it's straightforward but I haven't tried looking.
    Thanks.

    Most updates are announced here http://forums.adobe.com/community/flashplayer/announcements
    To find your installed version go to http://helpx.adobe.com/flash-player/kb/find-version-flash-player.html

  • The program selected for NZB files doesn't show in the open with/download dialog box even though it is the default in Options window - Applications panel

    Grabbit is listed as the default program for opening NZB files in the Applications panel. When I try to open an NZB file it is not automatically selected, nor is it on the list of optional programs. Consequently, I have to click through the list of installed programs in Windows and point Firefox to grabbit.exe.
    Although the file is listed as Grabbit NZB in the Applications panel rather than just "NZB", I didn't have a bit of a problem when I had XP installed.

    1) Well, I can set IE as the default program for html/htm files, as well as any other browsers/text editors. There is no issue in setting the default program for html/htm files. This issue is- htm/html files can't be opened when I click on 'open' option
    (like temporary internet files get opened) just to view the files  in IE when I set IE as default program for htm/html files. Please note that this issue is only when I click 'open' just to view the file. If I download and save the file, the file opens
    in IE perfectly when IE is set as default program. 
    2) Regarding clicking 'open' button:- I want that if default program for opening htm/html files is set as IE, when I click the open button, the file should get opened in IE (as temporary internet files open). This is not happening when I set IE as default
    program for htm/html files. 
    3) Files do get opened when I click 'open' button in IE, but ONLY WHEN default program is some other browser/text editor. And yes they get opened in the browser/text editor which is THEN set as default program.
    4)Yes, I've tried turning protected mode off, lower the security level, set custom level to medium/medium-low but no benefit as such.
    5) If I download/save the file, and then open the file, with default program set as IE, the files get opened successfully. I think the issue is that IE is not opening htm/html files as temporary internet files  (when user just tries to view/open the
    attachment rather than download/save it) when default program is set as IE itself. Is this expected behavior?

Maybe you are looking for

  • Can I return my iPad to previous software update

    Having updated to iOS 8 my ipad 2 is very slow and buggy. Can I return it to iOS 7.

  • Error while opening Adapter Monitoring

    Dear All, We have changed the hostname of the server. I have modified all the parameters in the Exchange Profile where host name was given. But when I am opening Adapter Monitoring, it is not taking the new host name rather it is taking the old host

  • I forgot my pass code and disabled my iPad

    I Forgot my pass code and disabled my iPad I have no computers or laptops to connect to as it tells me to connect to iTunes I connected to a freinds computer and it told me to put in my pass code but I don't know what it is ?

  • E-Mail at every changes on a workspace ?

    Hi, is it possible to get an email everytime someone adds or changes something on a workspace where i am a member? Up to now i have to check several times per day if someone has post new files or new information on a workspace. Is there a standard me

  • 5800 Vanishing Gallery.... Help plse

    Hi All, Can anyone help, I was blutoothed some pictures & music from my wifes fone, which i saved onto my memory card but since then I cant acces my photos/videos in the gallery. I try to open the folder to view them & it just dissapears & takes me b