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



Home Answers Viewqa Java-Beginners Java programming help

Have Programming Question? Ask it here!
 
 
 


tay smith
Java programming help
1 Answer(s)      5 years and 6 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
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
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 Programming
Java Programming  Hi, What is Java Programming? How I can learn Java Programming in one month? Thanks
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
Help With Java...
Help With Java...  Write a java program that can take a positive integer greater than 2 as input and write out the number of times one must repeatedly divide this number by 2 before getting a value less than 2
java help!
java help!   I need help starting off a program I am trying to write for class. The class should contain a private instance variable to represent temperature in Degrees Celsius and it should have the following methods
help in java
help in java   Rational Numbers Rational numbers are numbers that can be represented as a fraction p / q where p is an integer number and q is a positive integer (q != 0). Design and implement a Java class RationalNumber
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
Programming help Very Urgent - JSP-Servlet
Programming help Very Urgent  Respected Sir/Madam, Actually my code shows the following output: There is a combo box which contains all the ID's present in the database.. When I click or select any of the ID,it automatically
help in java
help in java  Write an application that prompt the user to enter a number to use as an array size, and then attempt to declare an array using the entered size. Java generates a NegativeArraySizeException if wou attempt to create
java help?
java help?  Write a program, where you first ask values to an array with 6 integer values and then count the sum and average of the values in methods (send in the array & return the counted value to the main program). Print
Java programming
Java programming  What is the Role of OOP in java
Java programming
Java programming  What is the Role of OOP in java
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 help
java help   Write a Java program that does the following: 1.Creates a grading program based on the Baker College grading standard. You will need to look up the current grade standard. You may use only the letter grades without
java help
java help  How to Open CSV Files in a Microsoft Excel Application Using Java Code with example pgm
help for java
help for java  1.convert the following Pseudo code to java if/else structure if student?s grade is greater than or equal to 90 Print ?A? else if student?s grade is greater than or equal to 80 Print ?B? else
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
help in java
help in java  3.Flights Design and implement a class called Flight that represents an airline flight. It should contain instance data that represents the airline name, flight number, and the flight's origin and destination cities
help in java
help in java  Write a program that will evaluate simple expressions such as 17 + 3 and 3.14159 * 4.7. The expressions are to be typed in by the user. The input always consist of a number, followed by an operator, followed
java programming
java programming  how to write a coding for simple login form in netbeans
help in java
help in java  Design and implement a class called Sphere that contains instance data that represents the sphere's diameter. Define the Sphere constructor to accept and initialize the diameter, and include getter and setter
help in java
help in java  The factorial of a nonnegative integer n is written n! (pronounced √Ę‚?¨Ň? n factorial√Ę‚?¨¬?) and is defined as follows: n!=n . (n-1) . (n-2) . .... . 1 (for values of n greater than or equal to 1) and n!=1 (for n
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 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
help in java
help in java  Gross And Dozens Design and implement a class called GrossAndDozens to convert a given number of eggs into the number of gross, the number of dozens, and to the number of left over eggs. If you have N eggs, then you
help in java
help in java  Shopping cart Create 3 shopping carts from a Cart class. Each class should have four items in it, a title, a price for the 4 items and the number of each. Your shopping cart should use private variables, so use
help in java
help in java   Team Roster Create a program called TeamRoster that uses a class called Roster. Roster should contain a team name and the names of all... or help me on this pleas.. 7. Gross And Dozens Design and implement a class
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
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  Hi friends, if i create one project what are the step i can make...... i need step by step procedure
java programming
java programming  WAP to calculate the sum of: x + x(square)/2 + x(cube)/3 +.......... x(to the power n)/n
java help
java help  1) build class(es) for the dresses, choose (dress ID, color, price, designer)( link lists) 2) construct the driver class by establishing two separate objects for each sister 3) let them both to enter the dresses
java programming
java programming  supose i have a text field in java (like in gmail home page u have username field ) so i want to fill that field automatically by taking record from the database so is there any mechanism in java to handle
help in java
help in java  Write a Temperature class that has two instance variables: a temperature value (a floating-point number) and a character for the scale, either C for Celsius or F for Fahrenheit. The class should have a number
help in java
help in java  Temperature Write a Temperature class that has two instance variables: a temperature value (a floating-point number) and a character for the scale, either C for Celsius or F for Fahrenheit. The class should have
help in java
help in java  Define a class named Money whose objects represent amounts of U.S. money. The class will have two instance variables of type int for the dollars and cents in the amount of money. Include a constructor with two
 

 

 

DMCA.com