Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Java programming help
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


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



Advertisement
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 Tutorials/Questions & Answers:
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
Advertisements
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
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
Urgent java programming question.Pls help
Urgent java programming question.Pls help  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list
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  Hi, What is Java Programming? How I can learn Java Programming in one month? Thanks
hi need help with C++ programming!
hi need help with C++ programming!  how do i : b. Store numbers / characters into the file (output) c. Retrieve numbers / characters from the file (input thanks!   b) #include <iostream> #include <
Programming Help URGENT - JSP-Servlet
Programming Help URGENT  Respected Sir/Madam, I am R.Ragavendran. I am in urgent need of the coding. My requirement is as follows: Beside... TO ROSEINDIA TEAM< IF I GET THIS HELP IN TIME.... Thanks/Regards
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
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 Programming
Java Programming  Write a Java program that prompt user to input a number of students in a class. Then, prompt user to input the student√?¬Ę√Ę‚??¬¨√Ę‚??¬Ęs programming mark. Determine how many student get A+ and A for their grade
Java programming
Java programming  What is the Role of OOP in java
Java programming
Java programming  What is the Role of OOP in java
Learning Java programming for Beginners
Learning Java programming is not a difficult task as it has been hyped... queries will be answered. Now online learning of Java programming is becoming.... Reasons behind it are many. Learning Java programming online is free
java programming
java programming  Write a Java program that prompt user to input a number of students in a class. Then, prompt user to input the student‚??s programming mark. Determine how many student get A+ and A for their grade and how many
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 Beginners
programming for java beginners  How to start programming for java beginners
java programming
java programming  how to write a coding for simple login form in netbeans
JAVA PROGRAMMING
JAVA PROGRAMMING  Write an OVERLOADED FUNCTION in java that swaps(interchanges) 2 user given numbers.(one integer and one float value) and displays the result after swapping. Invoke the function in a class
java programming
java programming  what is taxonomy tree why we use that concept in java   hierarchical taxonomy is a tree structure of classifications for a given set of objects
java programming
java programming  Write a complete Java Program that correctly does the following: prints out first 1000 numbers (not including 1000) with a statement indicating whether it is even or not.. Output: Example Number 0 - Even
java programming
java programming  WAP to calculate the sum of: x + x(square)/2 + x(cube)/3 +.......... x(to the power n)/n
java programming
java programming  Hi friends, if i create one project what are the step i can make...... i need step by step procedure
Advertisements
 

 

 

DMCA.com