Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Java Newbie Exercises

  Asked By: Kelley    Date: Aug 27    Category: Java    Views: 847
  

1. Write a Java program that takes in an integer n as input (use the
Input class) and prints the letter "V" using asterisks whose "height"
is
n. For example, if n is 4, the output should be as follows:

* *
* *
* *
*

2. Write a Java applet (use InputOutputApplet) with inputs (integers)
a
and b and whose output are all pairs (x,y) of positive integers such
that
x < a, y < a, and x + y = b. For example, if a = 8, and b = 10, you
should print all (ordered) pairs of integers (from 1, 2, 3, 4, 5, 6,
7)
whose sum is 10:

3, 7
4, 6
5, 5
6, 4
7, 3

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Java Newbie Exercises Or get search suggestion and latest updates.




Tagged: