Total de visualizações de página

sábado, 11 de dezembro de 2010

Display 2 triangles, up side down


End navigation links
Item Assignment1

CS 120 Assignment # 1

Objective

Write, debug and run a Java program using DrJava.

Project Specifications

1.      Your program must be of the form used in lab 2.  Call your program Assignment1.java
2.      At the top of the program use comments to describe it and the authors name (you!).
3.      Write a program that will provide an output as shown below.  DO NOT use spaces to position the stars!
4.      After the triangles, provide a message that displays the product of the first 10 digits.
5.      Display your name as part of the output.
6.   Display the product of the first 10 digits excluding 0.

Final Touches

Make sure your program works correctly and that you have implemented all the required specifications.

Due Date

Upload the source code Assignment1.java through Blackboard Sep 21 by 11:59 pm. 

IMPORTANT SUBMISSION INSTRUCTIONS: 

1.      In blackboard click on AssignmentsAssignment1 – at the bottom of the document click on View/Complete Assignment: A1 to upload your file.
2.      Use the BROWSE button to find the file.   Select it and click on the Submit button.
 
If you have trouble with this assignment PLEASE come to see me!
Item A1

>> View/Complete Assignment: A1
Item Solution
/*
* This program draws triangles and provides the answer to a problem.
* Author: Prof. Steiger-Escobar
*
*/

public class Assignment1
{    public static void main(String[] args)
   {
     System.out.println("\t*\t********");
     System.out.println("\t**\t*******");
     System.out.println("\t***\t*****");
     System.out.println("\t****\t****");
     System.out.println("\t*****\t***");
     System.out.println("\t*******\t**");
     System.out.println("\t********\t*"); ////calculate the product of the first 10 digits//     System.out.println("\n\nThe product of 1*2*3*4*5*6*7*8*9*10 = " + ( 1*2*3*4*5*6*7*8*9*10) );
   }
}

OK

Nenhum comentário:

Postar um comentário