Program that allows a user to input coordinates

Assignment Help JAVA Programming
Reference no: EM13164594

In Java make a program that allows a user to input coordinates as to make a Hexagon via an array, and my professor has set the standards of: Write a class Polygon which draws a hexagon for a set of numbers given by the user. You must only use method drawLine of class Graphics (other fill or draw methods won't be accepted).

And so far I have, but I cannot seem to figure out how to set the Users input in a way that will transfer over to a Drawline Hexagon, any help would be much appreciated!

Note:For some reason whenever I use Chegg.com in Mozilla the questions are submitted many times without ever registering, yet who ever helps me with the question, surely I will reward both sets to points to them, as is possible

Here is the code that I have so far:

package Assignment8;

?

import java.awt.Graphics;

import java.util.Scanner;

import javax.swing.JApplet;

?

public class ggg extends JApplet{

{

int x,i;

Scanner scanner = new Scanner(System.in);

for(i = 0; i < 6; i++)

System.out.print("Please enter");

x = scanner.nextInt();

}

}

?

Reference no: EM13164594

Questions Cloud

Write a c function called values that returns void : Write a C function called values that returns void and takes two double precision arguments (called a and b) and one double precision array argument.
Trojan horse defense : Using your favorite search engine, look up "Trojan Horse Defense". How can it be used to question the conclusions drawn from a forensic investigation? Site a case where it was used.
Write a java program that uses a search tree of strings : Write a Java program that uses a search tree of strings to sort text lines in alphabetic order. You may choose how you de?ne alphabetic order as long as there is some sense in the de?nition. You may also choose what kind of tree you use.
Fragmentation on a storage device : Fragmentation on a storage device could be eliminated by re-compaction of the information. Typical disk devices do not have relocation or base registers (such as are used when memory is to be compacted)
Program that allows a user to input coordinates : In Java make a program that allows a user to input coordinates as to make a Hexagon via an array, and my professor has set the standards of: Write a class Polygon which draws a hexagon for a set of numbers given by the user.
Starting from the current head position : Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests for each of the following algorithms
Die class that can hold an integer : Design a die class that can hold an integer from 1 to 6. use the dice class to create a dice game. in this game, the user chooses a number between 2 and 12 inclusive
Using quicksort with median-of-three : Show the steps in details of sorting {3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5} using quicksort with median-of-three partitioning and a cutoff 3 (if the elements are less than 3, using insertion sort).
Enter the temperature at noon of each of the five days : Write a program that allows each employee to enter the temperature at noon of each of the five days and displays the highest, lowest, and average (mean) temps.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Presell a limited number of cinema tickets

Write an application to presell a limited number of cinema tickets. each buyer can buy as many as 4 tickets. No more than 100 tickets can be sold. Implement a program called TicketSeller that prompts the user for the desired number of tickets and the..

  Build the gui layout of the game

Build the Build the GUI layout of the game in java.

  Create your own date class

You are to write a program that determines the day of the week for New Year's Day in the year 3000. To do this, you must create your own date class (MyDate) and use the following interface and main program:

  Write a java program to perform matrix multiplication

In this project you need to write a java program called to perform matrix multiplication and

  Method to calculate all primes in the range [2..n]

One commonly used method to calculate all primes in the range [2..n] is to start with the number 2, mark it as prime, and mark all its multiples (excluding itself) as not prime. Then, we find the next smallest unmarked number, mark it as prime, and m..

  Application that generates a quiz

Create an application that generates a quiz. Prompt for the user's first and last name, college major, and confidence in test taking (high, medium, or low). The quiz should contain at least five true/false questions about horticulture. When the user ..

  Create java applet to represent grade of gas

Write a java applet (not a java application program) for costco gas station. The applet will first ask you whether you are a costco customer, then the grade of gas you want to use.

  Define private instance variable to hold boolean value

Write a Java Enumeration "LetterGrade" that represents letter grades A through F including plus and minus grades. Define a private instance variable to hold a boolean value.

  Create the class airplane

Your missions is to create the class Airplane. Each Airplane object should store the following information (fields):

  Create and implement class called date to store month

Create and Implement the class called Date which has data members to store month (as a number), day, year, and name of month.

  Programming exercises

Programming Exercises 1. Write an application named BadSubscriptCaught in which you declare an array of 10 first names. Write a try block in which you prompt the user for an integer and display the name in the requested position.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd