Provide a class for authoring a simple letter.

Provide a class for authoring a simple letter. In the constructor, supply the names of the sender and the recipient: public Letter(String from, String to) Supply a method public void addLine(String line) to add a line of text to the body of the letter. Supply a method public String getText() that returns the entire text of the letter. The text has the form:
Dear recipient name :
blank line
first line of the body
second line of the body
last line of the body
blank line
Sincerely,
blank line
sender name
Also supply a program LetterPrinter that prints this letter:
Dear John:
I am sorry we must part.
I wish you all the best.
Sincerely,
Mary
Construct an object of the Letter class and call addLine twice.
Hints: (1) Use the concat method to form a longer string from two shorter strings. (2) The special string "\n" represents a new line. For example, the statement
body = body.concat("Sincerely,").concat("\n");
adds a line containing the string "Sincerely," to the body.
Complete the following class in your solution:
This class models a simple letter.
public class Letter
Constructs a letter with a given sender and recipient.
@param from the sender
@param to the recipient
public Letter(String from, String to)
Adds a line to the body of this letter.
public void addLine(String line)
Gets the text of this letter.
public String getText()
private String sender;
private String recipient;
private String body;
}

I've answered the question and I've gotten the right answer. However, when I uploaded in our online homewok (which calls WileyPlus, "Launch LabRat") it gives me and error because it's a machine not a human to correct my answer. So, I thought people here could help me to come up with some new codes that would actually work in the "Launch LabRat".
Here's how I answered the problem (it works perfectly in the BlueJ, but "LabRat" fails the solution):
This class models a simple letter.
public class Letter
Constructs a letter with a given sender and recipient.
@param from the sender
@param to the recipient
public Letter(String from, String to)
sender = from;
recipient = to;
text = text.concat("Dear ").concat( recipient).concat(":").concat("\n").concat("\n");
Adds a line to the body of this letter.
public void addLine(String line)
text = text.concat(line).concat("\n");
Gets the text of this letter.
public String getText()
text = text.concat("\n").concat("Sincerely, ").concat("\n").concat("\n").concat(sender);
return text;
private String sender;
private String text = "";
private String recipient;
This is the Tester
public class LetterTester
public static void main(String[] args)
Letter departure = new Letter("Mary", "John");
departure.addLine("I am sorry we must part.");
departure.addLine("I wish you all the best.");
String departureLetter = departure.getText();
System.out.println(departureLetter);
}

Similar Messages

  • Java Class for Image

    Dear All,
    Hi, I am new to Java. I have to merge some *.gif files onto some *.tiff file on the web. Does java provide any class for manipulating imabe file or provide the above action?
    Any help would be much appreciated.
    Thanks

    There's java.awt.image plus the javax.imageio packages, but they don't have support for TIFF out of the box. I don't know if there's a plug-in for that format. (I thought I found one once, but couldn't get it to work.)
    You may want to try the NetPBM or ImageMagick packages. Not Java, but free.

  • How to programmatically get the source for a class provided the class name?

    Hello,
    As a quick background, I am providing some tools to potential users of an in-house framework. One is the ability to generate quick prototypes from our existing demo applications. Assume a user downloads our jars and uses them in their project (we are using Eclipse, but that detail should not greatly affect my question). Included in the jars is a demos package that contains ready-to-run classes that serve to exhibit certain functionality. Since many users may just need quick extensions of these demos, I am trying to provide a way for them to be able to create a new project that starts with a copy of the demo class.
    So, the user is provided a list of the existing demos (each one uses a single class). When the user makes their selection, with the knowledge of our framework, I can translate that into what demo class they need (returned as a string of format package.subpack1.subpackn.DemoClassName). What I now want to do is to use that complete class name to get the source (look up the file) for the corresponding class, and copy it into to a new file in their project (the copying into the project can be done easily in Eclipse, so what I need help with is the bolded part). Is there a simple way to get the source given a class path for a class as described above? You may assume the source files are included in the jars for the framework.
    Thanks in advance.

    If there's a file named "package.subpack1.subpackn.DemoClassName.java" in a "demos" directory in the jar, then yes. You'd just use
    InputStream code = getResourceAsStream("/demos.package.subpack1.subpackn.DemoClassName.java");Or if those dots in the name actually separate directory names, i.e. you have a "package" directory under "demos" and a "subpack1" director under that and so on, then:
    InputStream code = getResourceAsStream("/demos/package/subpack1/subpackn/DemoClassName.java");

  • Simple java class for SQL like table?

    Dear Experts,
    I'm hoping that the java people here at the Oracle forums will be able to help me.
    I've worked with Oracle and SQL since the 90s.
    Lately, I'm learning java and doing a little project in my spare time. 
    It's stand alone on the desktop.
    The program does not connect to any database 
    (and a database is not an option).
    Currently, I'm working on a module for AI and decision making.
    I like the idea of a table in memory.
    Table/data structure with Row and columns.
    And the functionality of:
    Select, insert, update, delete.
    I've been looking at the AbstractTableModel.
    Some of the best examples I've found online (they actually compile and work) are:
    http://www.java2s.com/Code/Java/Swing-JFC/extendsAbstractTableModeltocreatecustommodel.htm
    http://tutiez.com/simple-jtable-example-using-abstracttablemodel.html
    Although they are rather confusing.
    In all the examples I find, there always seems to be
    at least three layers of objects:
    Data object (full of get/set methods)
    AbstractTableModel
    GUI (JFrame, JTable) (GUI aspect I don't need or want)
    In all the cases I've seen online, I have yet to see an example
    that has the equivalent of Delete or Insert.
    Just like in SQL, I want to define a table with columns.
    Insert some rows. Update. Select. Delete.
    Question:
    Is there a better java class to work with?
    Better, in terms of simpler.
    And, being able to do all the basic SQL like functions.
    Thanks a lot!

    Hi Timo,
    Thanks. yes I had gone thru the java doc already and  they have mentioned to use java.sql.Struct, but the code which got generated calls constructor of oracle.jpub.runtime.MutableStruct where it expects oracle.sql.STRUCT and not the java.sql.STRUCT and no other constructor available to call the new implementation and that is the reason i sought for some clues.
      protected ORAData create(CmnAxnRecT o, Datum d, int sqlType) throws SQLException
        if (d == null) return null;
        if (o == null) o = new CmnAxnRecT();
        o._struct = new MutableStruct((STRUCT) d, _sqlType, _factory);
        return o;
    here CmnAxnRecT is the class name of the generated java class for sqlType.
    Thanks again. Please let me know if you have any more clues.
    Regards,
    Vinothgan AS

  • What are the following:1)Cisco 1600 Series IOS WIRELESS LAN RECOVERY. 2)Service Provider Option 60 for Vendor Class Idenfier

    What are the following:1)Cisco 1600 Series IOS WIRELESS LAN RECOVERY. 2)Service Provider Option 60 for Vendor Class Idenfier
    These items are listed with 1600 series AP but I'm unable to understand what are these things & the use of them

    DHCP Option 60:  Go HERE.

  • Authoring 4 class for Servers that rollup to 1 class

    Hi,
    I am new to authoring the classes, and would like some assistance
    I want to create 4 classes that discover applications, that then everything gets added to 1 class for Reporting, Notifications, and Monitoring Purposes as a Windows Computer Object.
    Is this creating 
    Class types
    1 x Hosting Class, 4 x Abstract classes
    Relationships types
    1x Hosting relationship  4 x Containment Relationships
    All this needs to be on the based on the Windows computer roll,
    Currently my 4 Classes are working 100% so I would like them to be added to 1 class
    One way I did find for this to work is to target all my discoveries to the 1 class I want to roll up, but I loose the flexability the 4 I would like to have as well.
    any assistance will do.

    Hi 
    You can not have a discovery for abstract class, an abstract class is blue print inherited by child class.
    if you application is has 4 modules base of windows computer role create 4 different class of hosted type and write discovery to populate all this class objects, once 4 class object are populated you can create a computer group and add 4 class as membership
    so that you can use this group for notification and reporting.
    refer below link for more information on hoe to author MP class 
    https://channel9.msdn.com/Series/System-Center-2012-R2-Operations-Manager-Management-Packs
    https://channel9.msdn.com/Series/System-Center-2012-R2-Operations-Manager-Management-Packs/-Mod6
    regards
    sridhar v

  • Why JMS if we can use JAVA classes for the same

    if we can communicate using the java classes which are protable and platform independent why do we have to use JMS for that. what is so specific about it and what is the benefit that makes it outstanding

    James/Steve,
    I feel that some of your points are misleading. The original authors point was a comparison against JMS and other means of achieving similar functionality with Java. Regarding your combined points:
    2) Scalability is something that can be achieved regardless of whether JMS is used. Clustering has nothing to do with JMS, each vendors clustering implementation is entirely proprietary.
    4) Aside from the inclusion of JNDI the JMS specification offers nothing for management. You only need to look through this forum at the amount of times a question like �how do I make a topic programmatically?� has been asked. All good JMS vendors offer management API�s and tools but all are vendor specific implementations.
    10) There is no JMS standard for load balancing. The generic round robin features of a JMS queue falls a long way short of true �load balancing�. Any vendor (ourselves included) that offers load balancing does so in an entirely proprietary manner.
    11) Again�JMS provides no standards for clustering of running one or more server. This is entirely down to implementation and functionality is vendor specific.
    12) Dead Message/Letter Queues are not defined in JMS
    14) What does serialization have to do with the original point? How one chooses to serialize their content ( XML, Object Serialization, Externalizable etc..) is equally applicable to both bespoke Java coding and JMS implementations.
    To birs1982:
    JMS is merely a collection of interfaces that define how one might read and write to a topic or queue. Vendors (both open source and commercial) recognize that these interfaces alone are not enough to offer an entire middleware messaging solution and complete the offering with sophisticated management, resilience, clustering, security and other value added features. These value added features require considerable effort to get right as do things like scalability and performance.
    Given JMS like messaging is almost commodity now (just look at the amount of JMS vendors that have leaped into the ESB space) and a common (perhaps essential) infrastructure component why produce it yourself? Surely your time is better spent serving your clients and business lines rather that writing what amounts to plumbing. All the hard work has been done and the price for this hard work (depending on your requirements) is anything from free to many thousands of pounds.
    Regards,
    Paul Brant
    my-Channels - Technologies working together
    http://www.my-channels.com/

  • The operation could not be performed because OLE DB provider "OraOLEDB.Oracle" for linked server ...

    Our setup is that we have two databases; a SQL Server 2008 database and an Oracle database (11g). I've got the oracle MTS stuff installed and the Oracle MTS Recovery Service is running. I have DTC configured to allow distributed transactions. All access to the Oracle tables takes place via views in the SQL Server database that go against Oracle tables in the linked server.
    (With regard to DTC config: Checked-> Network DTC Access, Allow Remote Clients, Allow Inbound, Allow Outbound, Mutual Authentication (tried all 3 options), Enable XA Transactions and Enable SNA LU 6.2 Transactions. DTC logs in as NT AUTHORITY\NetworkService)
    Our app is an ASP.NET MVC 4.0 app that calls into a number of WCF services to perform database work. Currently the web app and the WCF service share the same app pool (not sure if it's relevant, but just in case...)
    Some of our services are transactional, others are not.
    Each WCF service that is transactional has the following attribute on its interface:
    [ServiceContract(SessionMode=SessionMode.Required)]
    and the following attribute on the method signatures in the interface:
    [TransactionFlow(TransactionFlowOption.Allowed)]
    and the following attribute on every method implementations:
    [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)]
    In my data access layer, all the transactional methods are set up as follows:
    using (IDbConnection conn = DbTools.GetConnection(_configStr, _connStr))
    using (IDbCommand cmd = DbTools.GetCommand(conn, "SET XACT_ABORT ON"))
    cmd.ExecuteNonQuery();
    using (IDbCommand cmd = DbTools.GetCommand(conn, sql))
    ... Perform actual database work ...
    Services that are transactional call transactional DAL code. The idea was to keep the stuff that needs to be transactional (a few cases) separate from the stuff that doesn't need to be transactional (~95% of the cases).
    There ought not be cases where transactional and non-transactional WCF methods are called from within a transaction (though I haven't verified this and this may be the cause of my problems. I'm not sure, which is part of why I'm asking here.)
    As I mentioned before, in most cases, this all works fine.
    Periodically, and I cannot identify what initiates it, I start getting errors. And once they start, pretty much everything starts failing for a while. Eventually things start working again. Not sure why... This is all in a test environment with a single user.
    Sometimes the error is:
    Unable to start a nested transaction for OLE DB provider "OraOLEDB.Oracle" for linked server "ORACLSERVERNAME". A nested transaction was required because the XACT_ABORT option was set to OFF.
    This message, I'm guessing is happening when I have non-transactional stuff within transactions, as I'm not setting XACT_ABORT in the non-transactional code (that's totally doable, if that will fix my issue).
    Most often, however, the error is this:
    System.Data.SqlClient.SqlException (0x80131904): The operation could not be performed because OLE DB provider "OraOLEDB.Oracle" for linked server "ORACLSERVERNAME" was unable to begin a distributed transaction.
    Now, originally we only had transactions on SQL Server tables and that all worked fine. It wasn't until we added transaction support for some of the Oracle tables that things started failing. I know the Oracle transactions work. And as I said, most of the time, everything is just hunky dorey and then sometimes it starts failing and keeps failing for a while until it decides to stop failing and then it all works again.
    I noticed that our transactions didn't seem to have a DistributedIdentifier set, so I added the EnsureDistributed() method from this blog post: http://www.make-awesome.com/2010/04/forcibly-creating-a-distributed-net-transaction/
    Instead of a hardcoded Guid (which seemed to cause a lot of problems), I have it generating a new Guid for each transaction and that seems to work, but it has not fixed my problem. I'm wondering if the lack of a DistribuedIdentifier is indicative of some other underlying problem. I've never dealt with an environment quite like this before, so I'm not sure what is "normal".
    I've also noticed that the DistributedIdentifier doesn't get passed to WCF. From the client, I have a DistributedIdentifier and a LocalIdentifier in Transaction.Current.TransactionInformation. In the WCF server, however there is only a LocalIdentifier set and it is a different Guid from the client side (which makes sense, but I would have expected the DistributedIdentifier to go across).
    So I changed the wait the code above works and instead, on the WCF side, I call a method that calls Transaction.Current.EnlistDurable() with the DummyEnlistmentNotification class from the link above (though with a unique Guid for each transaction instead of the hardcoded guid in the link). I now havea  DistributedIdentifier on the server-side, but it still doesn't fix the problem.
    It appears that when I'm in the midst of transactions failing, even after I shut down IIS, I'm unable to get the DTC service to shutdown and restart. If I go into Component Services and change the security settings, for example, and hit Apply or OK, after a bit of a wait I get a dialgo that says, "Failed ot restart the MS DTC serivce. Please examine the eventlog for further details."
    In the eventlog I get a series of events:
    1 (from MSDTC): "The MS DTC service is stopping"
    2 (From MSSQL$SQLEXPRESS): "The connection has been lost with Microsoft Distributed Transaction Coordinator (MS DTC). Recovery of any in-doubt distributed transactions
    involving Microsoft Distributed Transaction Coordinator (MS DTC) will begin once the connection is re-established. This is an informational
    message only. No user action is required."
    -- Folowed by these 3 identical messages
    3 (from MSDTC Client 2): 'MSDTC encountered an error (HR=0x80000171) while attempting to establish a secure connection with system GCOVA38.'
    4 (from MSDTC Client 2): 'MSDTC encountered an error (HR=0x80000171) while attempting to establish a secure connection with system GCOVA38.'
    5 (from MSDTC Client 2): 'MSDTC encountered an error (HR=0x80000171) while attempting to establish a secure connection with system GCOVA38.'
    6 (From MSDTC 2): MSDTC started with the following settings: Security Configuration (OFF = 0 and ON = 1):
    Allow Remote Administrator = 0,
    Network Clients = 1,
    Trasaction Manager Communication:
    Allow Inbound Transactions = 1,
    Allow Outbound Transactions = 1,
    Transaction Internet Protocol (TIP) = 0,
    Enable XA Transactions = 1,
    Enable SNA LU 6.2 Transactions = 1,
    MSDTC Communications Security = Mutual Authentication Required, Account = NT AUTHORITY\NetworkService,
    Firewall Exclusion Detected = 0
    Transaction Bridge Installed = 0
    Filtering Duplicate Events = 1
    This makes me wonder if there's something maybe holding a transaction open somewhere?

    The statement executed from the sql server. (Installed version sql server 2008 64 bit standard edition SP1 and oracle 11g 64 bit client), DTS enabled
    Below is the actual sql statement issued
    SET XACT_ABORT ON
    BEGIN TRAN
    insert into XXX..EUINTGR.UPLOAD_LWP ([ALTID]
              ,[GRANT_FROM],[GRANT_TO],[NO_OF_DAYS],[LEAVENAME],[LEAVEREASON],[FROMHALFTAG]
              ,[TOHALFTAG] ,[UNIT_USER],[UPLOAD_REF_NO],[STATUS],[LOGINID],[AVAILTYPE],[LV_REV_ENTRY])
              values('IS2755','2010-06-01',
    '2010-06-01','.5',     'LWOP'     ,'PERSONAL'     ,'F',     'F',     'EUINTGR',
    '20101',1,1,0,'ENTRY')
    rollback TRAN
    OLE DB provider "ORAOLEDB.ORACLE" for linked server "XXX" returned message "New transaction cannot enlist in the specified transaction coordinator. ".
    Msg 7391, Level 16, State 2, Line 3
    The operation could not be performed because OLE DB provider "ORAOLEDB.ORACLE" for linked server "XXX" was unable to begin a distributed transaction.
    Able to execute the above statement successfully without using transaction.We need to run the statement with transaction.

  • Why can we only use 1 release class for overall Release of Purchase Req?

    Hi,
    After realizing that it would be beneficial to use more than one release class for overall release of Purchase Requisition with classification, in use with release groups for overall release, I now ask if someone knows why SAP has chosen to only allow 1 release class for overall release of Purchase Requisition?
    In my scenario I would like Release group US, used for release strategies for US-plant to be able to use 1 release class with a specific set of characteristics.
    For example class REL_PREQ_CLASS_OVERALL_VALUE_IN_USD including a characteristic PR_TOTVAL_USD looking at CEBAN-GFWRT. The chosen currency for this characteristic would be USD.
    I would then like to allow Release group FR, used for release strategies for FRANCE-plant to use another release class with another set of characteristics.
    For example class REL_PREQ_CLASS_OVERALL_VALUE_IN_EUR including a characteristic PR_TOTVAL_EUR looking at CEBAN-GFWRT. The chosen currency for this characteristic would be EUR.
    In this way the release strategies for the respective release groups US and FR, could maintain their overall limit values in their respective release strategies in their own currencies.
    1. Observe that I do not want to use the same Release class for both release groups for overall release, even though I know that this is currently the only allowed option, as far as I've understood.
    2. Observe that I do not want to specify the two characteristics PR_TOTVAL_USD and PR_TOTVAL_EUR for overall value in the same release class, as this would lead to double maintenance for a large number of release strategies. Also consider the maintenance when new countries with new currencies want release strategies.
    3. Observe that I only want to use overall release.
    What I'm trying to avoid is having to continuously translate local business USD overall value limits to limits in the currency chosen for the overall value characteristic. If this for example is specified in DKK, this would lead to a need to adjust the overall value limits as soon as the exchange rate between USD and DKK changes in the system.
    Please consider this simple example:
    Local requirement is that USD purchase requisitions should be blocked when the USD value is above 1000 USD. However in my release strategy I would have to maintain a value of >5365 DDK, if DKK is chosen as the currency for overall characteristic.(e.g exchange rate 5,365).
    Next month the currency exchange rate in the system between USD and DKK has changed, and therefore I would have to go into CL24N and maintain the value to reflect the new exchange rate between USD and DKK. Lets say it has gone up to 5,435. I would now have to maintain a value of > 5435 DKK in my release strategy to correctly reflect the local business requirement of 1000 USD.
    So if anyone could please explain why SAP has taken the decision to make the Release class for overall release client specific that would be much appreciated and awarded accordingly. Also if you have any suggestion on how I could obtain the above scenario on maintaning overall value limits in different currencies than that would be awarded to.
    BR Jakob F. Skott

    You can give feed back to Apple from the iTunes drop-down menu in the iTunes menu bar..
    You can also contact the iTS Customer Service from the links on this page - http://www.apple.com/support/itunes/store/
    MJ

  • In package /SAPAPO/MAT, what are the /SAPAPO/CL_PR_EEW* classes for?

    General question:
    In package /SAPAPO/MAT, what are the /SAPAPO/CL_PR_EEW* classes for?
    Specific question:
    Assume your client wants to add custom fields to the APO product master and display them on the standard screens displayed by the MATn transactions (e.g. MAT1)
    Will the above EEW "enhancement classes" provide any way to customize the MATn screens (tabs, subscreens or even exits to pop custom screens)?
    If not, then is there anyway to add custom fields to the MAT1 screens without doing a core mod?

    Same question for XMDSER function group, particularly module
    EXIT_SAPMMDUSER_001
    (fires out of screen 100 initial master data maintenance)
    I think this one will probably work, but it maybe a question of "timing", i.e. what customer action fires the PAI routines which ultimately fire the exit.
    If a simple "ENTER" fires the exit, then we're fine.

  • Sample CLASSES for different types of OIM components!!!

    Hi Experts
    Can any one provide me sample classes for different types of OIM components, adapters, scheduled tasks, etc. with your best practices for OIM java development and documentation? It would Help me lot.
    Please let us know Links/Documentations.
    Thanks
    \oim_user

    for schedulers
    1. Create a java class that extends the SchedulerBaseTask (see example below)
    2. Write your business logic
    3. Compile and jar
    4. Place the jar in the ScheduleTask directory in your OIM install
    5. Create a new scheduled task using the OIM developer console
    6. link in the new class into your new scheduled task.
    7. Done!
    Example code for a scheduled task:
    import com.thortech.xl.scheduler.tasks.SchedulerBaseTask;
    public class ScheduledtaskExample extends SchedulerBaseTask {
    public void init()
    //this method is run before execute by the scheduler
    public void execute() {
    //is executed by the scheduler
    runMyBusinessLogic();
    private void runMyBusinessLogic(){
    //place your business logic here
    }

  • Passing argument to, when using one class for multiple assets

    I had a class that I was passing a simple argument to like so:
    var quiz_1_2:CaseStudyQuiz = new CaseStudyQuiz(2);
    addChild(quiz_1_2);
    I now would like to use this class for multiple MCs in my library. I thought I could let Flash create a class for each of them and specifying the CaseStudyQuiz class as the Base class. When I do that, I get the following error:
    1136: Incorrect number of arguments.  Expected 0.
    Obviously this is because the class created by flash does not except an argument. Does that mean, I would have to create a seperate class for each of the movies that use that class? And if so, what would I have to do in that class for it to except the parameter and pass it on to my base class?
    Thank you very much for any help with this!!!

    use the super() function and pass your parameter.  but you still might get a runtime error but i don't think that will cause a problem.

  • MS Word Formatting tool for authors: LINK

    A while ago there was a thread that the sang blues about writers submitting Word files with local formatting and other such woes. There were two links provided with instructions and even tutorials for authors -- they are as follows:
    http://dkingdesigner.com/wpblog/?p=9
    http://www.ideastraining.com/DownloadAndTips/MS_OfficeTips.htm
    The following link, to a free download of "Author Tools Template" was just given to me by an editor. It's absolutely amazing. It imports macros and sets up menu items in Word, for handy formatting of docs. It doesn't get anymore how-to than this. Still I suspect there are some brilliant writers out there who will convince themselves this is too complicated. . . sigh.
    http://www.editorium.com/freebies.htm

    I wouldn't hold your breath. I created a separate styles menu for one project so that authors didn't even have to click on Word's dropdown menu - they just had to click on one of a few named styles that were always visible (and even had simple icons giving a visual clue to what they did). Still, no one used them, and this was even after they had asked for a template to use.

  • Adobe Photoshop CS6 provides no engine for debugging

    Hello,
    I've been trying to diagnose a problem with my wife's copy of CS6 Web and Design premium. Basically it's unable to run any JSX script that requires the Debug engine. I receive the error message 'Adobe Photoshop CS6 provides no engine for debugging' - trying it on Illustrator also gives a similar error. Persisting by clicking the 'play' button brings up a popup error message that says 'Unable to Run Script' or something similar.
    Note that if I hack our JSX script to bypass the debug engine it works fine - except certain PSDs will cause CS6 (and my older copy of CS4) to crash, so this is only a stopgap measure. Disabling OpenGL on CS4 seems to prevent crashing but it's not an option on the wife's copy since she's a full-time artist and I'm not.
    This is what I've had to change -
    $.level = 2;    // debug level: 0-2 (0:disable, 1:break on error, 2:break at beginning)
    debugger;        // launch debugger on next line
    Changing the $.level = 0 lets me continue without issue.
    This problem does NOT exist on my laptop using the same installer downloaded from Adobe.com. (I use trial version for testing, she uses her serial no.)
    Is it possible this problem persists because I uninstalled an old copy of Photoshop CS5 (standalone installation) AFTER installing CS6 Web & Design (multiple programs)?
    I've tried uninstalling and reinstalling CS6, but the problem persists.
    Please help, our jobs rely on this. >.<
    Worst case scenario I'll copy the entire install folder over from my laptop to try and fix the problem but I'd rather not have to since we're currently working in different countries and I can only use Remote Assistance to help.

    The problem is the SCRIPTS work - the debugging engine is what's missing for some reason. Even if there's a way to just cleanly uninstall everything so I can start from scratch without formatting the hard disk would be a good solution. (since apparently I think I missed some files somewhere on the last uninstall)

  • Need to create a driver class for a program i have made...

    hey guys im new to these forums and someone told me that i could get help on here if i get in a bind...my problem is that i need help creating a driver class for a program that i have created and i dont know what to do. i need to know how to do this is because my professor told us after i was 2/3 done my project that we need at least 2 class files for our project, so i need at least 2 class files for it to run... my program is as follows:
    p.s might be kinda messy, might need to put it into a text editor
    Cipher.java
    This program encodes and decodes text strings using a cipher that
    can be specified by the user.
    import java.io.*;
    public class Cipher
    public static void printID()
    // output program ID
    System.out.println ("*********************");
    System.out.println ("* Cipher *");
    System.out.println ("* *");
    System.out.println ("* *");
    System.out.println ("* *");
    System.out.println ("* CS 181-03 *");
    System.out.println ("*********************");
    public static void printMenu()
    // output menu
    System.out.println("\n\n****************************" +
    "\n* 1. Set cipher code. *" +
    "\n* 2. Encode text. *" +
    "\n* 3. Decode coded text. *" +
    "\n* 4. Exit the program *" +
    "\n****************************");
    public static String getText(BufferedReader input, String prompt)
    throws IOException
    // prompt the user and get their response
    System.out.print(prompt);
    return input.readLine();
    public static int getInteger(BufferedReader input, String prompt)
    throws IOException
    // prompt and get response from user
    String text = getText(input, prompt);
    // convert it to an integer
    return (new Integer(text).intValue());
    public static String encode(String original, int offset)
    // declare constants
    final int ALPHABET_SIZE = 26; // used to wrap around A-Z
    String encoded = ""; // base for string to return
    char letter; // letter being processed
    // convert message to upper case
    original = original.toUpperCase();
    // process each character of the message
    for (int index = 0; index < original.length(); index++)
    // get the letter and determine whether or not to
    // add the cipher value
    letter = original.charAt(index);
    if (letter >='A' && letter <= 'Z')
    // is A-Z, so add offset
    // determine whether result will be out of A-Z range
    if ((letter + offset) > 'Z') // need to wrap around to 'A'
    letter = (char)(letter - ALPHABET_SIZE + offset);
    else
    if ((letter + offset) < 'A') // need to wrap around to 'Z'
    letter = (char)(letter + ALPHABET_SIZE + offset);
    else
    letter = (char) (letter + offset);
    // build encoded message string
    encoded = encoded + letter;
    return encoded;
    public static String decode(String original, int offset)
    // declare constants
    final int ALPHABET_SIZE = 26; // used to wrap around A-Z
    String decoded = ""; // base for string to return
    char letter; // letter being processed
    // make original message upper case
    original = original.toUpperCase();
    // process each letter of message
    for (int index = 0; index < original.length(); index++)
    // get letter and determine whether to subtract cipher value
    letter = original.charAt(index);
    if (letter >= 'A' && letter <= 'Z')
    // is A-Z, so subtract cipher value
    // determine whether result will be out of A-Z range
    if ((letter - offset) < 'A') // wrap around to 'Z'
    letter = (char)(letter + ALPHABET_SIZE - offset);
    else
    if ((letter - offset) > 'Z') // wrap around to 'A'
    letter = (char)(letter - ALPHABET_SIZE - offset);
    else
    letter = (char) (letter - offset);
    // build decoded message
    decoded = decoded + letter;
    return decoded;
    // main controls flow throughout the program, presenting a
    // menu of options the user.
    public static void main (String[] args) throws IOException
    // declare constants
    final String PROMPT_CHOICE = "Enter your choice: ";
    final String PROMPT_VALID = "\nYou must enter a number between 1" +
    " and 4 to indicate your selection.\n";
    final String PROMPT_CIPHER = "\nEnter the offset value for a caesar " +
    "cipher: ";
    final String PROMPT_ENCODE = "\nEnter the text to encode: ";
    final String PROMPT_DECODE = "\nEnter the text to decode: ";
    final String SET_STR = "1"; // selection of 1 at main menu
    final String ENCODE_STR = "2"; // selection of 2 at main menu
    final String DECODE_STR = "3"; // selection of 3 at main menu
    final String EXIT_STR = "4"; // selection of 4 at main menu
    final int SET = 1; // menu choice 1
    final int ENCODE = 2; // menu choice 2
    final int DECODE =3; // menu choice 4
    final int EXIT = 4; // menu choice 3
    final int ALPHABET_SIZE = 26; // number of elements in alphabet
    // declare variables
    boolean finished = false; // whether or not to exit program
    String text; // input string read from keyboard
    int choice; // menu choice selected
    int offset = 0; // caesar cipher offset
    // declare and instantiate input objects
    InputStreamReader reader = new InputStreamReader(System.in);
    BufferedReader input = new BufferedReader(reader);
    // Display program identification
    printID();
    // until the user selects the exit option, display the menu
    // and respond to the choice
    do
    // Display menu of options
    printMenu();
    // Prompt user for an option and read input
    text = getText(input, PROMPT_CHOICE);
    // While selection is not valid, prompt for correct info
    while (!text.equals(SET_STR) && !text.equals(ENCODE_STR) &&
    !text.equals(EXIT_STR) && !text.equals(DECODE_STR))
    text = getText(input, PROMPT_VALID + PROMPT_CHOICE);
    // convert choice to an integer
    choice = new Integer(text).intValue();
    // respond to the choice selected
    switch(choice)
    case SET:
         // get the cipher value from the user and constrain to
    // -25..0..25
    offset = getInteger(input, PROMPT_CIPHER);
    offset %= ALPHABET_SIZE;
    break;
    case ENCODE:
    // get message to encode from user, and encode it using
    // the current cipher value
    text = getText(input, PROMPT_ENCODE);
    text = encode(text, offset);
    System.out.println("Encoded text is: " + text);
    break;
    case DECODE:
    // get message to decode from user, and decode it using
    // the current cipher value
    text = getText(input, PROMPT_DECODE);
    text = decode(text, offset);
    System.out.println("Decoded text is: " + text);
    break;
    case EXIT:
    // set exit flag to true
    finished = true ;
    break;
    } // end of switch on choice
    } while (!finished); // end of outer do loop
    // Thank user
    System.out.println("Thank you for using Cipher for all your" +
    " code breaking and code making needs.");
    }

    My source in code format...sorry guys :)
       Cipher.java
       This program encodes and decodes text strings using a cipher that
       can be specified by the user.
    import java.io.*;
    public class Cipher
       public static void printID()
          // output program ID
          System.out.println ("*********************");
          System.out.println ("*       Cipher      *");
          System.out.println ("*                   *");
          System.out.println ("*                          *");
          System.out.println ("*                   *");
          System.out.println ("*     CS 181-03     *");
          System.out.println ("*********************");
       public static void printMenu()
          // output menu
          System.out.println("\n\n****************************" +
                               "\n*   1. Set cipher code.    *" +
                               "\n*   2. Encode text.        *" +
                               "\n*   3. Decode coded text.  *" +
                               "\n*   4. Exit the program    *" +
                               "\n****************************");
       public static String getText(BufferedReader input, String prompt)
                                           throws IOException
          // prompt the user and get their response
          System.out.print(prompt);
          return input.readLine();
       public static int getInteger(BufferedReader input, String prompt)
                                           throws IOException
          // prompt and get response from user
          String text = getText(input, prompt);
          // convert it to an integer
          return (new Integer(text).intValue());
       public static String encode(String original, int offset)
          // declare constants
          final int ALPHABET_SIZE = 26;  // used to wrap around A-Z
          String encoded = "";           // base for string to return
          char letter;                   // letter being processed
          // convert message to upper case
          original = original.toUpperCase();
          // process each character of the message
          for (int index = 0; index < original.length(); index++)
             // get the letter and determine whether or not to
             // add the cipher value
             letter = original.charAt(index);
             if (letter >='A' && letter <= 'Z')          
                // is A-Z, so add offset
                // determine whether result will be out of A-Z range
                if ((letter + offset) > 'Z') // need to wrap around to 'A'
                   letter = (char)(letter - ALPHABET_SIZE + offset);
                else
                   if ((letter + offset) < 'A') // need to wrap around to 'Z'
                      letter = (char)(letter + ALPHABET_SIZE + offset);
                   else
                      letter = (char) (letter + offset);
             // build encoded message string
             encoded = encoded + letter;
          return encoded;
       public static String decode(String original, int offset)
          // declare constants
          final int ALPHABET_SIZE = 26;  // used to wrap around A-Z
          String decoded = "";           // base for string to return
          char letter;                   // letter being processed
          // make original message upper case
          original = original.toUpperCase();
          // process each letter of message
          for (int index = 0; index < original.length(); index++)
             // get letter and determine whether to subtract cipher value
             letter = original.charAt(index);
             if (letter >= 'A' && letter <= 'Z')          
                // is A-Z, so subtract cipher value
                // determine whether result will be out of A-Z range
                if ((letter - offset) < 'A')  // wrap around to 'Z'
                   letter = (char)(letter + ALPHABET_SIZE - offset);
                else
                   if ((letter - offset) > 'Z') // wrap around to 'A'
                      letter = (char)(letter - ALPHABET_SIZE - offset);
                   else
                      letter = (char) (letter - offset);
             // build decoded message
             decoded = decoded + letter;
          return decoded;
       // main controls flow throughout the program, presenting a
       // menu of options the user.
       public static void main (String[] args) throws IOException
         // declare constants
          final String PROMPT_CHOICE = "Enter your choice:  ";
          final String PROMPT_VALID = "\nYou must enter a number between 1" +
                                      " and 4 to indicate your selection.\n";
          final String PROMPT_CIPHER = "\nEnter the offset value for a caesar " +
                                       "cipher: ";
          final String PROMPT_ENCODE = "\nEnter the text to encode: ";
          final String PROMPT_DECODE = "\nEnter the text to decode: ";
          final String SET_STR = "1";  // selection of 1 at main menu
          final String ENCODE_STR = "2"; // selection of 2 at main menu
          final String DECODE_STR = "3"; // selection of 3 at main menu
          final String EXIT_STR = "4";  // selection of 4 at main menu
          final int SET = 1;            // menu choice 1
          final int ENCODE = 2;         // menu choice 2
          final int DECODE =3;          // menu choice 4
          final int EXIT = 4;           // menu choice 3
          final int ALPHABET_SIZE = 26; // number of elements in alphabet
          // declare variables
          boolean finished = false; // whether or not to exit program
          String text;              // input string read from keyboard
          int choice;               // menu choice selected
          int offset = 0;           // caesar cipher offset
          // declare and instantiate input objects
          InputStreamReader reader = new InputStreamReader(System.in);
          BufferedReader input = new BufferedReader(reader);
          // Display program identification
          printID();
          // until the user selects the exit option, display the menu
          // and respond to the choice
          do
             // Display menu of options
             printMenu(); 
             // Prompt user for an option and read input
             text = getText(input, PROMPT_CHOICE);
             // While selection is not valid, prompt for correct info
             while (!text.equals(SET_STR) && !text.equals(ENCODE_STR) &&
                     !text.equals(EXIT_STR) && !text.equals(DECODE_STR))       
                text = getText(input, PROMPT_VALID + PROMPT_CHOICE);
             // convert choice to an integer
             choice = new Integer(text).intValue();
             // respond to the choice selected
             switch(choice)
                case SET:
                // get the cipher value from the user and constrain to
                   // -25..0..25
                   offset = getInteger(input, PROMPT_CIPHER);
                   offset %= ALPHABET_SIZE;
                   break;
                case ENCODE:
                   // get message to encode from user, and encode it using
                   // the current cipher value
                   text = getText(input, PROMPT_ENCODE);
                   text = encode(text, offset);
                   System.out.println("Encoded text is: " + text);
                   break;
                case DECODE:
                   // get message to decode from user, and decode it using
                   // the current cipher value
                   text = getText(input, PROMPT_DECODE);
                   text = decode(text, offset);
                   System.out.println("Decoded text is: " + text);
                   break;
                case EXIT:
                   // set exit flag to true
                   finished = true ;
                   break;
             } // end of switch on choice
          } while (!finished); // end of outer do loop
          // Thank user
          System.out.println("Thank you for using Cipher for all your" +
                             " code breaking and code making needs.");
    }

Maybe you are looking for

  • Problem: JSP does not restore after downloading Excel.

    I have a "search.jsp" with a commandButton to generate excel. "Report.jsp" opens up in a new window when i click on this button by running below mentioned javascript. I can download Excel successfully by clicking on Download Excel link in report,jsp.

  • Starting All Over With OS X and Safari After Update And Crashes

    I had posted my troubles in the Safari Section under the same title and got fabulous advice. I was just starting the process of following this advice so that I could get my mac back up from 10.4.7 to 10.4.11 since the genius' at the bar at Apple had

  • ERP 6 NW 7.0 upgrade to NW 7.01(NW EHP1) + ERP EHP4

    is here anyone who has successfully upgraded/updated ERP 6 NW 7.0 with NW EH1 + ERP EHP4 (as sap suggests in guide. I really need only NW EHP1)? There are a lot of questions about this process and sap-EHPI and how to do it, and I need this info from

  • Color change when transferring image from Photoshop to After Effects

    Hi everyone, I am trying to import a logo from photoshop CS6 to After Effects CS6, however the black color within the image changes to a dark grey when it gets into AE. I noticed on the color picker in PS that it changes to the same grey color that i

  • ACS5 and MS NAP

    All, Can I just check my thinking? In the old ACS 4 world you could use HCAP to offload posture checking to Microsoft NAP as in: http://www.cisco.com/en/US/solutions/collateral/ns340/ns394/ns171/ns466/ns812/guide_c07-491729.html I don't see anything