Question

In: Computer Science

Create an applet that will draw a set of ovals. The user can specify the number...

Create an applet that will draw a set of ovals. The user can specify the number of ovals. submit java code

Solutions

Expert Solution

Below is the required code:-

  1. import java.applet.Applet;
  2. import java.awt.Color;
  3. import java.awt.Graphics;
  4. public class ovalshaper extends Applet{
  5. public void paint(Graphics gr){      
  6. setForeground(Color.blue);   
  7. gr.drawOval(20,20,30,50);         
  8. gr.fillOval(70,20,30,50);   
  9. }
  10. }

Thank you.


Related Solutions

Draw Lewis structures for each of the following compounds. In each case, specify the number of...
Draw Lewis structures for each of the following compounds. In each case, specify the number of valence electrons surrounding the central atom. a) bromine dioxide (BrO2) (Assume the central atom does not contain an expanded octet.) There are ___ valence electrons surrounding the central atom. b) beryllium fluoride (BeF2) There are___ valence electrons surrounding the central atom. c) phosphorus pentabromide (PBr5) There are ___ valence electrons surrounding the central atom.
Create an application that makes the user guess a number. The user must be allowed tries....
Create an application that makes the user guess a number. The user must be allowed tries. You must have a loop, user input (Scanner), and a constructor. (JAVA)
Show: Create an application that allows the user to enter the number of calories and fat...
Show: Create an application that allows the user to enter the number of calories and fat grams in a food. The application should display the percentage of the calories that come from fat. If the calories from fat are less than 30% of the total calories of the food, it should also display a message indicating the food is low in fat. One gram of fat has 9 calories, so: Calories from fat = fat grams *9 The percentage of...
Create a C++ program that will prompt the user to input an integer number and output...
Create a C++ program that will prompt the user to input an integer number and output the corresponding number to its numerical words. (From 0-1000000 only) **Please only use #include <iostream>, switch and if-else statements only and do not use string storing for the conversion in words. Thank you.** **Our class is still discussing on the basics of programming. Please focus only on the basics. Thank you.** Example outputs: Enter a number: 68954 Sixty Eight Thousand Nine Hundred Fifty Four...
Java Programming Create a program that prompts the user for an integer number and searches for...
Java Programming Create a program that prompts the user for an integer number and searches for it within an array of 10 elements. What is the average number of comparisons required to find an element in the array? Your program should print the number of comparisons required to find the number or determine that the number does not exist. Try finding the first and last numbers stored in the array. Run your program several times before computing the average.
Create design document for a program that will allow the user: Convert a number to binary....
Create design document for a program that will allow the user: Convert a number to binary. Convert from binary to number. Display the hexadecimal representation of a binary number. Given an hexadecimal display its binary representation. Convert a number to IEEE single precision and vice versa. More to come. PLEASE ADD PSEUDOCODE AND USE C PROGRAMMING USE FUNCTIONS IF POSSIBLE
. Create a Python function that asks the user for a number (integer). The function should...
. Create a Python function that asks the user for a number (integer). The function should then tell the user how many hundreds can go into the number, and how much is left over. Hint: the % operator calculates the remainder of a division. For example, 10 % 3 gives a result 1. Hint2: Deal with the positive and negative values in separate parts of an if-else structure. Get the calculation work for positive values first. For negative values, make...
Create a C++ program that will prompt the user to input an integer number and output...
Create a C++ program that will prompt the user to input an integer number and output the corresponding number to its numerical words. (From 0-1000000 only) **Please only use #include <iostream> and switch and if-else statements only. Thank you. Ex. Enter a number: 68954 Sixty Eight Thousand Nine Hundred Fifty Four Enter a number: 100000 One Hundred Thousand Enter a number: -2 Number should be from 0-1000000 only
Create a C++ program that will prompt the user to input an positive integer number and...
Create a C++ program that will prompt the user to input an positive integer number and output the corresponding number to words. Check all possible invalid input data. (Please use only switch or if-else statements. Thank you.)
Consider the following quantum number sets; determine if they can occur together to specify an orbital....
Consider the following quantum number sets; determine if they can occur together to specify an orbital. If not, indicate which rule has been violated (a) n=2, l=-1, ml = -1 (b) n=3, l=1, ml=0 (c) n=3, l=3, ml=-3 2: (a) Find all possible subshells in n=4 shell and label these subshells. 2(b): How many total orbitals in shell n=4? what is the relationship between the total number of shell and the quantum number n for that shell? Please include step-by-step...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT