Write program that will simulate rolling a die

Assignment Help JAVA Programming
Reference no: EM131840168

1. Write program that will simulate rolling a die. Name your program RollingDie.java. Run this program several times to show different results. Remember, Math.random() generates a double value with a positive sign, greater than or equal to 0 and less than 1.

2. Ask the user to enter a number between 1-5. Based on what number user entered, show a random quote. For instance, you have the following 5 quotes defined in your program:

Quote 1: Many people despise wealth, but few know how to give it away.

Quote 2: We are never deceived; we deceive ourselves.

Quote 3: Sometimes the questions are complicated and the answers are simple.

Quote 4: Whenever you find that you are on the side of the majority, it is time to reform.

Quote 5: Frequency of a tragedy does not diminish the wound when it is your own.

If user enters 2, you will display: We are never deceived; we deceive ourselves.

Use if/else if/else statements to write the program. Name your program RandomQuote.java.

3. Rewrite RandomQuotes program by using switch/case statements. Name your program RandomQuoteSwitch.java.

4. Create zip file that contains your Java programs. Include a screenshot of each program execution. You can either paste the screenshot into a Word document or simply paste it into the Comments field when submitting your homework. A sample screenshot of running my programs is attached below:

Reference no: EM131840168

Questions Cloud

Discuss about the culture areas of north america : In which of the major culture areas of north america did the inhabitants rely upon hunting deer for meat, gathered edible plants, seeds, and nuts and acorns.
Prepare the journal entry dated october : Prepare the journal entry dated October 31 to transfer the cost of the completed units to finished goods inventory
Iness reviews you read on the internet : How much of your purchasing decision is influenced by product/business reviews you read on the Internet? Do you or would you pay for professional
Discuss the origins of the cold war in europe : Discuss the origins of the Cold War in Europe. Was it inevitable? What factors brought it about? What were the major aspects of the Cold War?
Write program that will simulate rolling a die : Run this program several times to show different results. Remember, Math.random() generates a double value with a positive sign, greater than or equal to 0
Find the present value : Find the present value of $7,000 to be received one year from now assuming a 3 percent annual discount interest rate
Prepare a ppt about people of korean heritage : Prepare a PPT about People of Korean Heritage. People of Mexican Heritage. Preparation for the presentation will include synthesizing the information.
How cash flow statement different from income statement : How is the cash flow statement different from the income statement and what is its purpose? You need to write 150 words and reference a minimum of 3 scholarly.
What would be the future value : Find the future value of $10,000 invested now after five years if annual interest rate is 8 percent. What would be the future value

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  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.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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