What is printed from this program, please? 01

public static Demo05{
public static void main(String[] args){
for(int i=0; i<3; i++){
for(int j=0; j<6; j++)
if(( i - j > 2 ) || (j > i +1)) System.out.print(' - ');
else System.out.print(' + ');
System.out.pritnln();
Can you also please show the steps of how it is working? I will be greatful
Thanks

If you want to know what's printed, run the program and see for yourself.
If there's something in particular you don't understand, ask about that. But if you just say you don't know what any of it means, then the advice is to start on page 1 of a Java textbook or tutorial.

Similar Messages

  • HP 2050 deskjet all in one -- will scan but won't print from this computer

    My deskjet 2050 will scan from both of my macbook computers, but will only print from one.  It gives an "on hold" message whenever I print from this computer.  Then I hit "resume" and it says "nothing is being held."  I have already downloaded and re-installed the driver, and it didn't make any difference.
    It prints fine from the other computer, but it's a pain to have that limitation.
    Thanks in advance for your time.

    Hello @CazzoInMano , and welcome to the HP Forums, I hope you enjoy your experience!
    I see you're running into print issues.  I would like to help with that!
    What version of mac are you using?
    I would suggest deleting the printer from your print system, using this document: Uninstalling the Printer Software.
    Once you have deleted it, I would suggest verifying and repairing the disk permissions: About Disk Utility's Repair Disk Permissions feature.
    I would also suggest running your Apple updates:  OS X: Updating OS X and Mac App Store apps
    After the updates, I would recommend reinstalling the HP Deskjet 2050 All-in-One Printer.
    Good luck and please let me know the results of your troubleshooting steps. Thank you for posting on the HP Forums!
    Please click “Accept as Solution " if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks" for helping!
    Jamieson
    I work on behalf of HP
    "Remember, I'm pulling for you, we're all in this together!" - Red Green.

  • Lines Printing from Adobe Programs

      Ok. This problem is killing me! Anytime I print from an Adobe program, I get lines running accross (left n right) the page. I've done nozzle cleaning and print head alignment. I even replaced my printer. Printer is not the problem (settings maybe). If I print from any (photoshop, Illustrator, InDesign, Acrobat) adobe program.... lines! If I export from anything to PDF, lines print when I print from acrobat. Now, if I export to JPEG and open the file "non-adobe"(just double clicking it to open it), it prints without the lines. Only printing from adobe programs gives me the lines. I don't want to export everything as a JPEG. It's a pain. Anyone know what the problem is?
    ps- the lines are like ink overlap, but are as wide as a piece of hair. Very tiny but annoying. I get the problem mainly when there's a gradient in the file and then try to print. Lines all the way down the page and the gradient is in steps almost. So I guess I get lines when printing anything with a gradient, and print it from an adobe program. Help!

    Also, printing solid black gives me lines, but you can barely see them unlees you catch a shine of light on it. Then you can really see the lines.

  • I need help instantly on this program please

    import java.util.*;
    public class D3
              private static int[] z = new int[100000];
    private static int first=z[0];
              private static int last=z[n-1];
              private static int n=100000;
    public static void main(String args[])
    Scanner input=new Scanner(System.in);
    for(int i=0;i<z.length;i++)
              z=2*i;
    int seqSearch(z;50000;n); //method call 4 key where key=mid
              int binSearch(z;first;last;50000);
              int seqSearch(z;35467;n); //method call 4 key where key in the left half
              int binSearch(z;first;last;35467);
              int seqSearch(z;89703;n); //method call 4 key where key in the right half
              int binSearch(z;first;last;89703);
              public int seqSearch(int z[];int key;int n)
         long start = System.currentTimeMillis();
    int count=0;
    int ans=-1;
    for(int i=0;i<n;i++)
    if z[i]=key
    count++
    {ans=i
    break;}
    return ans;
    long elapsed = System.currentTimeMillis() - start;
    System.out.print("Execution Time:" + elapsed);
    System.out.print("# of Basic Operations:" + count);
         public int binSearch(int z[];int first;int last;int key)
         long start = System.currentTimeMillis();
         int count=0;
         if(last<first){
         count++;
         index=-1;
         else
         count++;
         int mid=(first+last)/2
         if(ket=z[mid]{
         index=mid;
         else
         if(key<z[mid]){
         index = binSearch(z[];first;mid-1;key);
         else
         index=binSearch(z[];mid+1;last;key);
         return index;
         long elapsed = System.currentTimeMillis() - start;
         System.out.print("Execution Time:" + elapsed);
         System.out.print("# of Basic Operations:" + count);
    // if anyone could tell me whats wrong with my code i'd be greatful...the program is supposed to perform binary and sequential search on a sorted array of 100000 numbers.once on an item in the middle of the array once on the right side of it and once on the left side...i also need to count the number of basic operations for the same number in both sequential and binary to see whats better.and i need to check the time...plz i need help now,,,

    "Guide to a first-time poster"
    you need to add exclamation marks to signify how urgent it is
    e.g.
    i need help instantly on this program please!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    capital letters is better
    I NEED HELP INSTANTLY ON THIS PROGRAM PLEASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    starting the italics on line 1, better again
    import java.util.*;
    public class D3
    private static int[] z = new int[100000];
    private static int first=z[0];
    private static int last=z[n-1];
    private static int n=100000;
    public static void main(String args[])
    Scanner input=new Scanner(System.in);
    for(int i=0;i<z.length;i++)
    z=2*i;
    int seqSearch(z;50000;n); //method call 4 key where key=mid
    int binSearch(z;first;last;50000);
    int seqSearch(z;35467;n); //method call 4 key where key in the left half
    int binSearch(z;first;last;35467);
    int seqSearch(z;89703;n); //method call 4 key where key in the right half
    int binSearch(z;first;last;89703);
    public int seqSearch(int z[];int key;int n)
    long start = System.currentTimeMillis();
    int count=0;
    int ans=-1;
    for(int i=0;i<n;i++)
    if z=key
    count++
    {ans=i
    break;}
    return ans;
    long elapsed = System.currentTimeMillis() - start;
    System.out.print("Execution Time:" + elapsed);
    System.out.print("# of Basic Operations:" + count);
    public int binSearch(int z[];int first;int last;int key)
    long start = System.currentTimeMillis();
    int count=0;
    if(last><first){
    count++;
    index=-1;
    else
    count++;
    int mid=(first+last)/2
    if(ket=z[mid]{
    index=mid;
    else
    if(key><z[mid]){
    index = binSearch(z[];first;mid-1;key);
    else
    index=binSearch(z[];mid+1;last;key);
    return index;
    long elapsed = System.currentTimeMillis() - start;
    System.out.print("Execution Time:" + elapsed);
    System.out.print("# of Basic Operations:" + count);
    and what about the dukes, offer 10 (never to be awarded, of course)
    do this, then sit back and watch the replies roll in.

  • How do I get my HP Officejet Pro 8500 won't print from a program called "The Print Shop 12"?

    I can not get my printer to print from this one program I have called "The Print Shop 12." I don't get an error message, it acts like it want to print but then nothing.

    I do not know about the Print Shop program but I know that sometimes quickbooks has this issue. We have two different work around for this, 1st one  Click your start button go to your printer & devices folder and right click the 8500 printer and either RENAME it or go to Properties to Rename is to OJ8500 and then Apply and safe that change and try it.
    2nd step if that does not work, click start, go back to the printers and faxes and "add a printer" when you get to the list of manufactures click HP or Hewlett-Packard and look for the deskjet ICC printer and add it, naming it PrintShop and then you should be able to printer threw that program.
    Although I am an HP employee, I am speaking for myself and not for HP.

  • When I load Illustrator creative suit (5.5) on my new computer, it loads Then I put in the serial number, which is correct, but when i go to click on the program to use it it says ERROR: localized resource file from this program could not be loaded. pleas

    When I load Illustrator creative suit (5.5) on my new computer, it loads Then I put in the serial number, which is correct, but when i go to click on the program to use it it says ERROR: localized resource file from this program could not be loaded. please re install of repair the application and try again. I have done this and it's still not working                  

    anomaly jade,
    You only need to use the serial number during installation.
    Have you, at least seemingly, been able to install, and then you are unable to start up?
    If that is the case, you could try to reinstall using the full three step way:
    Uninstall, run the Cleaner Tool, and reinstall.
    http://www.adobe.com/support/contact/cscleanertool.html

  • I can't print in Adobe 11.0, I can print from other programs?

    I have confirmed that I can print from other programs.
    I have uninstalled Adobe and reinstalled to make sure the programs was the most up todate.
    I have installed a new printer just today and confirmed the drivers are up todate.
    I have confirmed there are no security issues with the document - documents.
    I have tried printing the document as an image and it still will not print.
    I don't get any errors, just nothing happens.  It doesn't even go into the print que
    Help!

    I tried printing a simple PDF.
    We couldn't print PDF's prior to the replacment of the printer, but I thought replacing the printer might help.
    I have pulled some tech people here at the office to see if there is a common denominator between the computers and or the issues arising and nothing is coming up.
    This is just so odd.

  • How do I get my money refunded?  I am not getting what I want from this, cannot email anyone for help, cannot get someone on the phone I can understand, and keep getting disconnected.  I just want my money back.

    How do I get my money refunded?  I am not getting what I want from this, cannot email anyone for help, cannot get someone on the phone I can understand, and keep getting disconnected.  I just want my money back.

    "this" being what?  You posted in the Workspaces.acrobat.com forum, which is a free service.
    If you subscribed to any of the paid services see Cancel your membership or subscription | Acrobat.com online services

  • Hi, I want to format my macbook pro and i don't know what to choose from this list---:  Mac OS Extended (Journaled)  Mac OS Extended  Mac OS Extended (Case-sensitive, Journaled)  Mac OS Extended (Case-sensitive)

    Hi, I want to format my macbook pro and i don't know what to choose from this lis
    Mac OS Extended (Journaled)
    Mac OS Extended
    Mac OS Extended (Case-sensitive, Journaled) 
    Mac OS Extended (Case-sensitive)

    MAC OS Extended (Journaled)

  • Please help me to get a clue from this program

    I'm sorry to bother you with such stupid questions. I have to admit I'm just making my first steps in programming.
    So I have a program like this and don't understand how it works:
    // Masking sign extension.
    class HexByte {
    static public void main(String args[]) {
    char hex[] = {
    '0', '1', '2', '3', '4', '5', '6', '7',
    '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
    byte b = (byte) 0xf1;
    System.out.println("b = 0x" + hex[(b >> 4) & 0x0f] + hex[b & 0x0f]);
    Specifically, how could 0xf1 be represented in binary? As far as I know 11110001 contains negative value. Moreover 0xf1 in 10's base is 241, so how can I convert it to byte? Doin so, I'm gonna lose its value (since the byte range is from -128 to 127). And why do I need it? I even have no idea how the variable would look like in binary after converting to byte, not mentioning last part of this program.
    I would really appreaciate your help.
    Thank you for your time.

    AntShay wrote:
    Thank you so much for your help guys. Now I got just 2 more questions. First of all. I guess sign-extension works only with negative values. Is that correct? When sign-extension takes place and I shift any value to the right by any number of positions, does it fill in all the previous bits with *1s*? If you can, please, tell me how exactly this works.Java primitives are all signed, so sign extension is always at work for right bit shifts. However, if you were to look into the code, it has masked away the 4 most significant bits using bit-wise and operation. Alternatively, you may use the unsigned shift (+>>>+) operator.
    And by the way, is there any method to convert the value of byte to a binary string? I only figured that it might work this way: Integer.toBinaryString(b&0xff), but is there Byte.toBinaryString method or something?It is always okay to up cast, as sign extension will convert correctly. If you don't like the long integer output, you may do a substring() on the output. It is also not hard to roll your own.

  • Print calculation for program - PLEASE HELP

    I have a program that is supposed to take an input from a user for a list size and the program should calculate the number of comparisons required to sort the list. i.e. If the user entered 100 the program should output it takes 4950 comparisons to sort the list. I am having trouble figuring this out and I have been working on this program for far too long. The calculation required I think is n(n-1)/2 although there are no n's in my program it should be replaced with something but what?
    Here is my program
    import java.util.*;         //supplies random class
    import java.awt.*;          //supplies user interface classes
    import java.awt.event.*;    //supplies event cleasses
    import java.applet.Applet;  //supplies applet class
    public class TestingUse2 extends Applet implements ActionListener
    public void actionPerformed(ActionEvent event)    //event handler method
    size = Short.parseShort(inputField.getText());   //gets integer input from user
    values = new int[size];                          //generate the size
    initValues(size);                               //fill the array
    selectionSort();                                //sort the array
    inputField.setText("");                         //resets input field
    printValues();
    outLabel.setText("The comparison is: ");   _//need to put + something to get it to print this out in the applet_
    void initValues(int size)                     //gets number of values and randomly generates values
    Random rand = new Random();
    for (int index = 0; index < size; index++)
    values[index] = Math.abs(rand.nextInt()) % size;
    int minIndex(int startIndex, int endIndex)    //finds the smallest value in the array and swaps it with the first value
    {                                             //in the array position
    int indexOfMin = startIndex;
    for (int index = startIndex + 1; index <=endIndex; index++)
    if (values[index] < values[indexOfMin])
    indexOfMin = index;
    return indexOfMin;
    public void swap(int index1, int index2)  //swaps the integers at location index1 and index2 of array values
    int temp = values[index1];
    values[index1] = values[index2];
    values[index2] = temp;
    void selectionSort()                    //the elements in the array values are sorted
    int endIndex = size - 1;
    for (int current = 0; current < endIndex; current++)
    swap(current, minIndex(current, endIndex));
    _///I NEED SOME CODE TO GET THIS PROGRAM TO PRINT THE NUMBER OF COMPARISON REQUIRED_
    _//TO SORT A LIST AMOUNT GIVEN BY A USER.  I.E. A LIST OF 100 REQUIRES 4950 COMPARISONS TO SORT._
    //declare fields for applet viewer
    private TextField inputField;
    private int[] values;
    private int size;
    private Label outLabel;
    private Button button;
    //init method - to set up fields and buttons on applet
    public void init()
    Label label;
    label = new Label("Enter # for comparison ");
    button = new Button("enter");
    button.addActionListener(this);
    inputField = new TextField("Value");
    outLabel = new Label("The number of comparisons is: ");
    add(label);
    add(inputField);
    add(button);
    add(outLabel);
    setLayout(new GridLayout(5,0));
    }

    I assume you would use the size variable in the actionPerformed method.
    Probably a good idea to cast it as an integer, rather than a short, but...
    int comps = (int) (size * (size-1)) / 2;
    outLabel.setText("The comparison is: " + comps);

  • Problems printing from other programs after printing using Word automation

    I have an application that uses ActiveX to build a Word document. My print VI is attached. The problem that users are reporting is that after printing a report with my application, they can't print from any other programs until they restart their computer.
    After my print VI runs, the only other Word automation is Document.Close and Application.Quit. I close all my references religiously and winword.exe closes just fine. I don't know what would be hanging around causing other programs to have trouble printing. One thing I don't like is the ActivePrinter property in Word. It changes the default printer in Windows. This is why I reset it using the printer LabVIEW reports as the default. I tried reading ActivePrinter and storing it in a wire, then resetting it with this string, but then even weirder things happened - the printout got all messed up. This is why I'm using the printer that LabVIEW says is the default.
    Has anyone ever encountered anything like this?
    Message Edited by Marc A on 01-12-2007 11:03 AM
    Attachments:
    Word_print.PNG ‏18 KB

    goldn:
    Welcome to the Apple Discussions. Just ran a test and I got a perfect card. Here's what I did.
    1 - create the card and type Command-P.
    2 - select Stylus Photo R200 under Printer
    3 - click on the Advanced button
    4 - in the bottom drop down menu select Paper Handling
    5 - select the radio button "Use documents paper size: 7.00 in x 10.00 in
    6 - now select Print Settings in the 3rd drop down menu
    7 - select the type of paper you're using and the print quality you want. I used Photo and High Speed. (also used plain paper for my test)
    9 - put a piece of 7 x 10 paper in the printer (yes, you'll have to trip the paper beforehand or use card stock designed for this)
    10 - click on Print
    11 - when the paper exits the printer quickly put it back in the printer
    That will do it. Now there is a caveat. Putting it back into the printer before drying tended to get my leading edge nipped. If you use heaver card stock I don't think that will happen but just be aware. If you wait a moment to put the page, turned over, back into the printer to let the ink dry a bit, all you'll have to do is press the middle button which will be blinking red and that will feed the other side thru when you're ready.

  • I cannot print from my Ipad - please help

    Hi
    Please can someone help - I have an ipad and an air printer (Canon MX435). I am trying to print from the ipad to the printer but it cannot find any air printers - please could someone help.
    Just to say, I am very very inexperienced in technology, so please could you give me the most simplest answers and I will try and follow them.  I have googled to see how to do this and it appears to easy, but alas mine does not work.
    Sorry if i dont understand what to do, but I really would like some help on this and dont know much about computers/routers/connection/wireless much at all so if anyone can help me set this up, id be very pleased.
    Thanks in advance

    You can see what wifi network your iPad is using as follows:
    * Open the Settings app (looks like one large gear and two small ones).
    * The second entry in the left column should be "Wi-Fi" with one or more words to the right of that.
    * If the part to the right of "Wi-Fi" says "Off", you are not connected to wifi at all.
    * Otherwise, the part to the right is the name of the current network.
    You should have had to select a network when you first brought the printer home and set it up. It should be the same network as above. I have not figured out how you can see if the printer is on the same wifi network after the fact.
    Here's another thing to check:
    * Print the Nozzle Check Pattern as follows:
    -- Make sure there is a sheet of A4 or letter plain paper in the front tray and the output tray support is extended.
    -- Press the "Setup" button.
    -- Use the right or left arrow button to select Maintenance, then press the OK button.
    -- Use the right or left arrow button to select Nozzle check, then press the OK button.
    * Under the test pattern you should find a page count and optionally a firmware version (like "Ver. 2.000").
    * You need to see a version at least equal to 2.000. If not, you need to update the firmware.

  • Unable to print from hotmail program

    I can't print from hotmail on my Macbook. In place of where the document to be printed would show, it says: "Print using system dialog" (don't know that that means but it doesn't work either.)  I click on that, but it still doesn't print. Am able to print from all other programs on this Macbook. What am I missing? Thanks.

    Hi there,
    Currently, only certain printers support printing from iPad using the native print function. Your printer must have AirPrint built in to do so. Not many do at the moment, and I am pretty sure yours does not. You can see the supported printers at a link I have posted below. Of course there are many 3rd party apps, which can print like PrinterShare, but this cannot print mail. Sorry!
    AirPrint Supported Printers
    Hope this helps,
    Regards,
    Nathan
    <Edited by Host>

  • Wireless HP Photosmart eAll-in-On​e will not print from Word program in HP G60-535DX Windows 7

    Wireless connection checks out on both the Pc and the printer.  All options check out correctly.  Until a week ago
     my 2 year wireless connection worked correctly.  I can print from the Internet but not from any Windows
    programs.   I have contected HP 3 times last night; accessed Print and Scan Doctor and all options listed on help menus for PC and printer.    Is there a new driver to correct this problem?

    Hi,
    Here's the link for the latest driver for your printer.
    Printer Driver
    Make sure you save the file when prompted before running it.
    Give Kudos to say "thanks" by clicking on the "thumps Up icon" .
    Click "Accept as Solution" if it solved your problem, so others can find it.
    Although I am an HP employee, I am speaking for myself and not for HP.

Maybe you are looking for

  • How to get the list of organization unit assigned to user

    hello All, i have to get the list of organization unit which is assigned to user. i mean if user ABC is assigned to 10 Org unit then how would i get those 10 sales Org? is there Any function module? Regards.

  • Checks on GL account

    The GL account does not show the actual CK #, nor does the Bank Rec module.  Is there an option so this shows in each of these modules/reporting?

  • WRP1 considering Articles with different Purchase group

    Hi Gurus, We are facing issue in WRP1 program, in production system one STO is created for many articles with different purchase group with same site, But My understanding is that when replenishment happens, different STOs will be created for differe

  • HELP!! I deleted my whole library!!!

    HELP ME!!!! I had a whole bunch of duplicates in my library and I was trying to delete them and inadvertantly erased my entire library!! The songs were all in my recycle bin, I clicked 'restore files' in my recycle bin but they're not back. When I do

  • Material Valuation for Finished Product in Production Scenario

    Dear SAP Gurus, Kindly recommend appropriate Material Valuation Control for Finished Product in manufacturing scenario. SAP recommends pricing control 'S' (Standard), but my client's buying nature is not periodic(varies), they buy material on require