Find Jobs
Hire Freelancers

Die Simulator and five Polygons

$10-30 USD

Terminado
Publicado hace más de 9 años

$10-30 USD

Pagado a la entrega
Project 1. Write a Java program to simulate a die. A die has values of either 1, 2, 3, 4, 5 or 6 on the face. You should use the [login to view URL]() or the [login to view URL]() class to generate the values on the die. The program should prompt the user to enter how many times the die should be rolled. The output should show the results of each roll along with the total number of times 1, 2, 3, 4, 5 or 6 occurred for all rolls and the total sum comprised of the sum of all rolls. Here is a sample run: How many times do you want to roll the die? 10 Thank you! The die roll results for 10 rolls were: 2 3 4 5 3 2 6 2 1 6 The number of occurrences of each face were as follows: 1: 1 2: 3 3: 2 4: 1 5: 1 6: 2 The sum of die rolls was: 34 Project 2. Design a Java class named Polygon that contains: A private int data field named numSides that defines the number of sides of the polygon. The default value should be 4. A private double data field named sideLength that defines the length of each side. The default value should be 10.0. A private double data field named xCoord that defines the x-coordinate of the center of the polygon. The default value should be 0.0. 2 A private double data field named yCoord that defines the y-coordinate of the center of the polygon. The default value should be 0.0. A no argument constructor that creates a Polygon using the default number of sides, default side length and default x- and y-coordinates. A constructor that creates a Polygon using a specified number of sides, side length and x- and y-coordinates. Getter and setter methods for all data fields A getPerimeter() method that returns a double value representing the sum of all sides. A toString() method that displays the number of sides, side length, x-coordinate and y-coordinate values in String format. Be sure your code compiles. (In the next question, you will create a TestPolygon class and test each of the methods) Write a Java test program, named TestPolygon, to create five different polygons. When creating the five polygons, create one using the no argument constructor. For the remaining four, feel free to use any number of sides, side length and x-, and y-coordinates that are not equal to the default values and not equal to each other. For each of the five polygons, call all of the methods and display the results. For example for a Polygon with 3 sides, side length of 2.0 and x-coordinate and y-coordinates of 1.0, the following output may be appropriate. toString() results: (3, 2.0, 1.0,1.0) getNumSides() results: 3 getSideLength() results: 2.0 getXCoord() results: 0.0 getYCoord() results: 0.0 getPerimeter() results: 6.0 setNumSides(4) results: 4 setSideLength(3) results: 3.0 setXCoord(2.0) results: 2.0 setYCoord(2.0) results: 2.0 Keep in mind, for five Polygons, you will have five different output results.
ID del proyecto: 7107202

Información sobre el proyecto

8 propuestas
Proyecto remoto
Activo hace 9 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
A proposal has not yet been provided
$20 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
8 freelancers están ofertando un promedio de $32 USD por este trabajo
Avatar del usuario
Hi, thank you for inviting me to do this project. I have read the requirements and I would like to do this project if given the opportunity. Let me know if you are interested so I can start. Thanks.
$15 USD en 1 día
4,9 (500 comentarios)
6,9
6,9
Avatar del usuario
I am very proficient in java. I have 12 years java developing experience. I have worked for 5 years, my work is online game developing, and mainly focus on server side, the language is java under linux, I am proficint in c++ also. I used java to make many great projects. For example, I made the tools which can convert PWScript(a script language created by our company) to c++ files. I made our own mobile games, and i am mainly responsible for the server side, and it was built using java. I can even show you the mobile game client. Please let expert help you.
$50 USD en 1 día
4,7 (26 comentarios)
5,3
5,3
Avatar del usuario
hi mate this is asad, i have a lot of experience in java programming, would surely help you out,cheers :)
$30 USD en 0 día
4,9 (26 comentarios)
4,7
4,7
Avatar del usuario
hey there.....we can do this DIE simulator in Java...please reply....we can get this done 100% accuracy....thank you....
$38 USD en 1 día
4,9 (31 comentarios)
4,5
4,5
Avatar del usuario
Hi, i will complete this job in a day probably. I just kept time 3 days for some kind of urgent things. I'm completely suitable for your work.
$35 USD en 3 días
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de UNITED STATES
moody, United States
5,0
4
Miembro desde feb 1, 2015

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.