Home Answers Viewqa Java-Beginners Java programming help

 
 


tay smith
Java programming help
1 Answer(s)      4 years and 7 months ago
Posted in : Java Beginners

View Answers

October 29, 2008 at 2:37 PM


Hi friend,

import java.io.*;

public class TrianglesTest{
final static int WIDTH = 10;
public static void main(String[] param) throws IOException{
InputStreamReader m = new InputStreamReader(System.in);
BufferedReader n = new BufferedReader(m);
System.out.print("Give me the size of each triangle : ");
int size = Integer.parseInt(n.readLine());
System.out.print("The number of triangles you want to output in each row : ");
int noOfTriangles = Integer.parseInt(n.readLine());
System.out.print("The number of rows of triangles you want to output : ");
int noOfRows = Integer.parseInt(n.readLine());
raster(size, noOfTriangles, noOfRows);
}

public static void raster(int a, int b, int c){
String result = "";

for(int Rows=1; Rows<=c; Rows++){
for(int triangles=1; triangles<=b; triangles++){

for (int i = 1; i < 6; i++) {
for (int j = 1; j < i+1; j++) {
System.out.print("*");
}
System.out.println(" ");
}

}
}
}
}

-------------------------------------------------

Visit for more information.

http://www.roseindia.net/java/

Thanks.









Related Pages:
Java Programming Help
Java Programming Help  Hello ! I m the student of last year and i need your help to complete my java project. I going to make a site like youtube... with controls .. I Just want to use jsp and applet in my project . Please help me
Need Help in Java programming
Need Help in Java programming  Hello. Can someone please help me with writing the following program Java program that gives assignment details such as:assignment number,assignment name,due date,submission date,percentage marks
Java Programming Code HELP
Java Programming Code HELP  Hi, sir/madam. I am new here and currently developing a program whereby it can read the Java source file... the expert can help me to solve this problem and pull out the attribute name. Can sir
Need help in java programming
Need help in java programming  Hello. Can someone please help me with writig the following programm. Assignment 20% Presentation 10% Mini Test 10% Exam 60% Java program that accepts the following details: student
Java programming using ArrayList Help?
Java programming using ArrayList Help?  Hi,can anybody help and guide me on doing this java program? (Largest rows and columns)Write a program... row index : 2 The largest column index : 2,3 Any help would be greatly
Java programming using ArrayList Help?
Java programming using ArrayList Help?  Hi,can anybody help and guide me on doing this java program? (Largest rows and columns)Write a program... The largest row index : 2 The largest column index : 2,3 Any help would be greatly
Java programming help - Java Beginners
Java programming help  Write a program that asks the user for an integer, and if the input is positive, puts stars on the screen - one star on line... for more information. http://www.roseindia.net/java/ Thanks
help
(); } } SFDV2103 â?? Java Programming Fall, 2012 Term Project... on the percentage of cheating. SFDV2103 â?? Java Programming Fall, 2012 Term... based on the percentage of cheating. please help me
Java Programming Need Help ASAP
Java Programming Need Help ASAP  You are required to develop a student menu system that is similar to the bank system covered in class..., their year (you can assume they all start in year 1), their programming mark
Craps Game Java Programming Help
Craps Game Java Programming Help  Craps is a casino game that involves the throwing of a pair of dice. Based on the throw, the thrower either gets... roll. You may wish to print the roll sequence to help you debug. Output
Java programming help with files - Java Beginners
Java programming help with files  I want a code or the following program .thanks Write a program that reads employee data into a vector. The data is composed of : - id# - name - nationality - job title the program
java programming
java programming  how to count the no. of constants in a user given string?? plzz help
Java Programming
Java Programming  Using Java Frame form, help me develop a GPA calculating device, able to show Grade and points together, and using MySQL database
Java Programming
Java Programming  Using Java Frame form, help me develop a GPA calculating device, able to show Grade and points together, and using MySQL database
Java File Programming
Java File Programming articles and example code In this section we will teach you about file programming in your Java applications. Java File Programming... program. Java programming language provides many API for easy file management. Java
Programming problem - Java Beginners
Programming problem  Good afternoon Ma'am/Sir, Can you help me... it difficult to learn java programming? Based on my survey it seems that java programming is the hardest part of their studies.. I also want to know
programming
Java Constructor programming for single and double constructor  write a program which have no argument constructor ,single parameter constructor constructor,double parameter constor,and the now when we create a object
help
help   how i can send a pitcture on url in java
java Programming - Java Beginners
java Programming  hi all i want to devlop a gui for compiling java program. so please help me how could i do this. means to say that how can i compile java program on clicking of a button. please reply me
java programming - Java Beginners
java programming  i'm asking for the java code for adding , viewing... a code..help me plzz  Hi Friend, Please go through the following links: http://www.roseindia.net/java/example/java/swing/add_edit_and_delete
help
help  pls help me to get the code of a java program a program to perform different shapes in a menu using javaapplet
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 4.2 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook... of cases. A little creative cut-and-paste can help. The switch statement has
java programming - Java Beginners
java programming  Hi Buddies, i want java Array ,looping... is write a program in java to print * * * * * * * * * * the o/p will come like that structure   Hi friend, Code to help
java programming - Java Beginners
java programming  hi!!! we have been allocated a project "remote admin"? but we dont knw how to proceed further?? what should we do first? plz help me out? r there any user manuals to help us out, from this conditions
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 10.4 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook... the DirectoryList example in Section 10.2 for help with the problem of getting
java programming - Java Beginners
java programming  hi sir, i hav send u a code jus now regarding that program but it tends to be having error. Can u help me check? And still not sure whether some place got error
help
help  i need help with this code. write a java code for a method named addSevenToKthElement that takes an integer array, and an integer k as its arguments and returns the kth element plus 7. any help would be greatly
Java Programming, Solution to Programming Exercise
Solution for Programming Exercise 12.5 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook... some help with using files and command-line arguments, you can find an example
programming
Java no argument constructor programming  write a program which have no argument constructor ,single parameter constructor constructor,double parameter constor,and the now when we create a object of in this constructor he we
programming
Java single parameter constructor  write a program which have no argument constructor ,single parameter constructor constructor,double parameter constor,and the now when we create a object of in this constructor he we tell
programming
Java parameter constructor  write a program which have no argument constructor ,single parameter constructor constructor,double parameter constor,and the now when we create a object of in this constructor he we tell the how much
programming
Constructor in java application  write a program which have no argument constructor ,single parameter constructor constructor,double parameter constor,and the now when we create a object of in this constructor he we tell the how
programming
Constructing a constructor in java application  write a program which have no argument constructor ,single parameter constructor constructor,double parameter constor,and the now when we create a object of in this constructor he
programming
constructor object in java application programming  write a program which have no argument constructor ,single parameter constructor constructor,double parameter constor,and the now when we create a object of in this constructor
programming
Construct a constructor of object in Java programming  write a program which have no argument constructor ,single parameter constructor constructor,double parameter constor,and the now when we create a object
Java programming
support examples related to each Java programming technology that will help... Java programming       Java programming language is useful for development of enterprise grade
help - Java Beginners
, Java : Java is great programming language for the development of enterprise..., and this is very similar to C++. Java Programming Language is simplified to eliminate language features that cause common programming errors. Java source code
Programming
Programming  how to save output of java file in .txt format?   Hi, If you are running the example from dos prompt you can use the > bracket to direct the output to a text file. Here is the example: C:>java
ajax programming
is based on the HTML, Java Script, CSS, and XML. Why Ajax Programming? When you...Ajax Programming What is Ajax Programming? Asynchronous JavaScript and XML.... Easy to learn and easy to write technology. Where to Start Ajax Programming
java programming - Java Beginners
java programming  asking for java code .. counting for how many times the character is being entered in phrase like for instance.. input: learning... -- 1 help me plz... thank u ahead   Hi Friend, Try the following
java programming - Java Beginners
java programming   this is my preoccupation: i design an 2-tier application, the program has the *login window* and *main windows*. I want to get..., I am sending you a link. This link will help you. Please visit for more
help
help  Hii.. I have to design one registration page in java that looks like REGISTER USERNAME (here i have to check whether username already exists... to the user) please tell me how could i design that. Please help me asap Thanks a lot
Java help - Java Beginners
Java help  I didnot get the code ,therefore I am posting my question again.. Thanks in advance ...:) Programming Assignment: A) Consider the outpatient pharamacy at University Hospital. At the entrance of the pharmacy
Programming - JDBC
Programming  Thank you for the reply , but i want it using MS-ACCESS as data storage only. and what JAVA version is to be used in compiling. paki... VERY MUCH ! TRULY YOU SERVE A BIG HELP FOR ME
socket programming in java - WebSevices
socket programming in java  hello i hv made a socket program using which a server and a client can communicate.can both the server side and client... it shows unknown host.please help me
help
help  how can i query for a minimum value of of one of the column in my database through java   Use min to retrieve the minimum value from one column of database table. Suppose you have a table named emp where
java programming please - Spring
java programming please  please i want your help :-( using JCreator program Your local bank has contracted you to design a Java application that will process saving account data for a given customer in a given year
help
this in java then try this: import java.util.*; class SquareNumber { public
help
Java application  public int remainder(int a, int b) { int answer = a % b; System.out.printf("%d % %d = ", a , b); return (answer); } and in my main, int answerRemain
help
. Based on the above scenario, write a complete Java program. Your program should

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.