Please answer using Java and using normal public classes residing in individual java files. In this assignment
Fantastic news! We've Found the answer you've been seeking!
Question:
Please answer using Java and using normal public classes residing in individual java files.
Transcribed Image Text:
In this assignment you write a Java program that rolls two dice and displays the results. First, ask the user about the type of dice they want to roll. For example, traditional die that looks like a cube has six sides. Alternatively, there could be many other types of dice -- 4, 6, 8, 12-sided, and so on: 12 20 8 8 6. Have your program ask the user how many sides they want on a die. Make sure to validate the user input. Decide what should be the minimal and maximum number of sides allowed. In a loop, ask the user if they want to roll the dice. If the answer is anything but "Y" or "y", exit the program. In this assignment you write a Java program that rolls two dice and displays the results. First, ask the user about the type of dice they want to roll. For example, traditional die that looks like a cube has six sides. Alternatively, there could be many other types of dice -- 4, 6, 8, 12-sided, and so on: 12 20 8 8 6. Have your program ask the user how many sides they want on a die. Make sure to validate the user input. Decide what should be the minimal and maximum number of sides allowed. In a loop, ask the user if they want to roll the dice. If the answer is anything but "Y" or "y", exit the program.
Expert Answer:
Answer rating: 100% (QA)
Based on the assignment description you will need to create two Java classes one to represent a die and another to represent a pair of dice The Die cl... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Vaughn Furniture factors $913000 of receivables to Cullumber, Inc. Cullumber assesses a 2% service charge on the amount of receivables sold. Vaughn Furniture factors its receivables regularly with...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Explain the difference between impregnation and infiltration. Give some applications for each?
-
What is an advantage that the Du-Pont system of analysis offers over traditional ratio analysis? (Try and identify something original that your classmates have not yet mentioned.) Are there any...
-
A mixed hockey team consists of five men and six women. The heights of individual men are denoted by h m metres and the heights of individual women are denoted by h w metres. It is given that h w =...
-
Present a critical appraisal of the argument that only one international standardsetting institution is needed to establish financial reporting standards relating to environmental issues.
-
Valuing Preferred Stock Ayden, Inc., has an issue of preferred stock outstanding that pays a $6.50 dividend every year in perpetuity If this issue currently sells for SI 13 per share, what is the...
-
2. For each equation, state the quantity (with units) represented by each variable. a) D=mV F b) P== A c) P = Dgh g 3. Write a single sentence answering each question. a) If the mass remains constant...
-
City Bank issued $200 million of one-year CDs in the United States at a rate of 6.50 percent. It invested part of this money, $100 million, in the purchase of a one-year bond issued by a U.S. firm at...
-
On October 1, a company received a contract to supply 6,000 units of a specialized product. The terms of contract require that 1,000 units be shipped in October; 3,000 Units in November and 2,000...
-
You are the director at Dello Inc., which has been appointed as auditors of Diestel ( Pty ) Ltd ( Diestel ) , a cold beverage wholesale supplier servicing the Gauteng area. You were as a designated...
-
Your company organized a team under your leadership to develop a carbon exchange platform for the Sultanate of Oman in align with National Net Zero strategy 2050. How can you contribute to develop a...
-
What would be the price of a stock that pays an annual fleed dividend of $14 for ten years, and then the dividend payment increases by 1% every year and the required rate of resim is 5% annually?
-
A firm has g(x,y) =40xy as its production function, with labor x costing $10 per hour and land y costing $3 per acre per month. If the firm has a total budget of $900 for labor and land, what amounts...
-
Kimberly has $1,000 per year to spend between $50 concert tickets and $200 per night getaways. Her utility maximizing combination is 8 concerts and 3 overnight getaways. She recently received a...
-
Difference between respiration and fermentation
-
Independent random samples of sizes n1 = 30 and n2 = 50 are taken from two normal populations having the means 1 = 78 and 2 = 75 and the variances 21 = 150 and 22 = 200. Use the results of Exercise...
-
In the ice cream cone shown, L = 4 in. and e = 35°. The cone is filled with ice cream such that the portion above the cone is a hemisphere. Determine the volume of the ice cream. L
-
A cross-sectional area has the geometry of half an ellipse, as shown in the figure to the right. The coordinate of the centroid of the area can be calculated by: = My/A where A is the area given by A...
-
A paper cup shaped as a frustum of a cone with R2 = 2R1 is designed to have a volume of 250 cm3. Determine R1, R2, and h such that the least amount of paper will be used for making the cup. The...
-
Using Program14.m(fourth-order Runge-Kutta method), solve Problem 11.18 with \(c=1\). Data From Problem 11.18:- Using the central difference method, find the response of the two-degree-of-freedom...
-
Using Program15.m (central difference method), solve Problem 11.20. Data From Problem 11.20:- The equations of motion of a two-degree-of-freedom system are given by \(2 \ddot{x}_{1}+6 x_{1}-2...
-
Using Program16.m(Houbolt method), solve Problem 11.20. Data From Problem 11.20:- The equations of motion of a two-degree-of-freedom system are given by \(2 \ddot{x}_{1}+6 x_{1}-2 x_{2}=5\) and...
Study smarter with the SolutionInn App