Write a code fragment that reads


1. Write a while loop that verifies that the user enters a negative integer value.
2. Write a code fragment that reads and prints integer values entered by a user until a particular sentinel value (stored in SENTINEL) is entered. Do not print the sentinel value. 
3. Write a method called minOfTwo that accepts two integer parameters and returns the smaller of the two.
4. Write a paint method to draw out an American flag. the flag will have a blue square in the upper left corner and 13 red and white strips, starting with red, and alternating. 6 of the 13 stripes appear to the right of the blue square and the last 7 stripes appear beneath the blue square extending as far right as the other stripes. Use a for-loop to draw the stripes. Do not try to draw any stars in the blue square. (import javax.swing.JApplet; and java.awt.*; ) (public class Flag extends JApplet) 
5. String s1 is said to overlap String s2 if all of the characters in s1 also appear in s2. Write a set of code that will set the Boolean variable overlap to true if s1 and false otherwise. Assume both s1 and s2 have already been input.

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Write a code fragment that reads
Reference No:- TGS082701

Expected delivery within 24 Hours