would this work
import cs1.Keyboard;
public class Die2
{
public static void main (String [] args)
{
System.out.prin tln("Enter the number of faces you want a die to have ");
int guess= Keyboard.readIn t();
myDie thisDie=new myDie();
System.out.prin tln("Rolling Die...");
thisDie.roll();...
User Profile
Collapse
-
the program works but what does it mean to have the user pick the number of sides on the dieLeave a comment:
-
-
Die program
The questions asks write an application to roll a die and display the results. It also says let the user pick the number of sides on the die. I wrote a program Die2 which rolls a die and display the results, but i don't how to do the second part. thanks
import java.util.Rando m;
public class myDie
{
private final int MIN_FACES = 4;
private static Random generator = new Random();... -
----jGRASP exec: java Runs
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads
Heads...Leave a comment:
-
Help with runs program
I figured out how to make a coin class. But i can't figure out how to write a program to find the length of the longest run of heads in 100 flips of the coin.
This is what i did so far the runs program. Thanks
// this is the coin class
import java.util.Rando m;
public class Coin
{
private int face;
private final int HEADS=0;
private final int TAILS=1;
... -
-
i can't get the totalNumOfGames to work and also it won't print the summary right.
//coin toss 5 records how many
import cs1.Keyboard;
public class CoinToss5
{
public static void main(String[] args)
{
char play= 'p';
{
while (play == 'p' || play == 'P')
{
System.out.prin tln(" I'm...Leave a comment:
-
-
Help with Coin Program
I have to make a program that would ask a user for their guess (heads or tails) and tells them if its correct or not then it has to ask the user if they want to play again. I figured out how to do this but the part that i am stuck on is how to print a summary at the end of this program tracking how many wins and how many losses.
import cs1.Keyboard;
public class CoinToss6
{
public static void main(String[]... -
Help with Program
I have the following 2 programs Account and Banking. I have to change the Account class so the funds can be moved from 1 account to another (like withdrawing money from one account and putting it in another). I also have to change the main method of Banking to show this new service. How would I do this?
// Account.java
import java.text.Numbe rFormat;
public class Account
{
... -
Help with program
How would I make a java program using for loops to print the following pattern...
*
***
*****
*******
*********
*******
*****
***
*
i started it but dont know what to do...
public class Stars
{
public static void main (String []args)
{
final int MAX_ROWS=10;
for (int row=1; row<=MAX_ROWS; row++)
{... -
Help with Salary Program
Help with following Programs:
Write two programs one where the performance rating here shoud be entered as a int where Excellent =1, Good= 2, Poor=3. an employee who is rated excellent will receive a 6% raise, one rated good will receive a 4% raise, and one rated poor will receive a 1.5% raise. Add the if... else... statements to program Salary to make it run as described above.
// *************** *************** *************** *************** ***...
No activity results to display
Show More
Leave a comment: