Results 1 to 2 of 2
  1. #1
    lord raza is offline Member
    Join Date
    Nov 2011
    Posts
    2
    Rep Power
    0

    Default Need Help With Some Pyramid

    Hello Bro
    First : My Code Is Not Displaying It Displays ? Insted What Is The Soulotion
    Second : I Have Coded The Second Code To Display "Z" in comment but it dose not
    Thired : Soulotion to display that Thirde Code In The Comment
    My Last Question : Soulotion To Take Integer And Double And A String And Store In A File And Then Read It and Must Diplay The Sum Of Integer And Double
    Thanks Lot


    public class PrintAnimalPattern {
    public static void main (String args[]){
    /*
    '__'
    ()
    /========\/
    / || %% ||
    * ||----||

    "" ""
    */

    System.out.print("\t "+"'__'");
    System.out.println();
    System.out.println("\t "+"()");

    System.out.print(" "+"/"+"========"+"\\/");
    System.out.println();
    System.out.print("/"+" || %% || ");
    System.out.println();
    System.out.print("*"+" ||----|| ");
    System.out.println();
    System.out.print(" "+" ");
    System.out.println();
    System.out.print("\u00a5");
    }
    }

    ================================================== ==========

    public class PrintPattern5 {
    public static void main (String args[]){
    /*
    # # # # # # #
    #
    #
    #
    #
    #
    # # # # # # #
    */

    for (int i=1;i<=7;i++) {
    System.out.print(" "+"#");
    }
    System.out.println();

    for (int i=2;i<=6;i++) {
    System.out.println(" "+"#");
    }
    for (int i=1;i<=7;i++) {
    System.out.print(" "+"#");
    }
    }
    }

    ================================================== ============
    public class PrintPattern3 {
    public static void main (String args[]){
    /*
    # # # # # # # #
    # # # # # # #
    # # # # # #
    # # # # #
    # # # #
    # # #
    # #
    #
    */
    for (int i=7; i >= 0; i--) {
    for (int j=3; j <= i; j++) {
    System.out.print(" "+"#");
    }
    System.out.println();
    }
    }
    }
    ================================================== =============
    import java.io.*;
    import java.util.Scanner;
    public class FileIO{
    public static void main(String args[])throws IOException{
    /*
    The integer read is 12 num1
    The floating point number read is 33.44 num2
    The String read is "Peter" name
    Hi! Peter, the sum of 12 and 33.44 is 45.44 sum
    */

    int num_1;
    double sum;
    //double num;
    //String name;
    Scanner keyboard = new Scanner(System.in);

    FileWriter file = new FileWriter("in.txt");
    PrintWriter pr = new PrintWriter(file);

    for(int i=1;i<=2;i++){
    System.out.println("Integer");
    num_1=keyboard.nextInt();
    pr.println(num_1);
    /*
    System.out.println("double");
    num=keyboard.nextdouble();
    pr.println(num);

    System.out.println("string");
    name=keyboard.next();
    pr.println(name);
    }
    */
    pr.close();
    System.out.println("data has been written");
    FileReader out=new FileReader("in.txt");
    BufferedReader rd=new BufferedReader(out);
    String read=rd.readLine();
    while(read!=null){
    System.out.println(read);
    read=rd.readLine();
    System.out.println(read);
    }
    out.close();
    }
    }
    }

  2. #2
    tnrh1 is offline Senior Member
    Join Date
    Aug 2011
    Posts
    251
    Rep Power
    3

    Default Re: Need Help With Some Pyramid

    Quote Originally Posted by lord raza View Post
    My Code Is Not Displaying It Displays ? Insted What Is The Soulotion
    There is nothing wrong in your code, it should display it properly.
    I guess it's your settings somewhere, and I think that it has nothing to do with java.

    About the rest of your code, I'm not going to read it.
    If you want to get help atleast use the code tag so we can read it properly and help you.

Similar Threads

  1. need help with Number Pyramid with Double Digits
    By SmellyFoot in forum New To Java
    Replies: 5
    Last Post: 03-29-2011, 12:04 PM
  2. pyramid
    By Dashinator in forum New To Java
    Replies: 8
    Last Post: 11-15-2010, 09:10 PM
  3. Will make a pyramid of some kind out of a number
    By romina in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 05:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •