reset password
Author Message
tandluong
Posts: 7
Posted 21:06 Sep 06, 2016 |

For the 2nd bullet point, it states that: "The user must be able to repeat this exercise as many times as he or she wants to, providing a new list of names each time, and the program must not terminate until the user chooses to quit." 

What does it mean by "providing a new list of names each time?" Is it asking us to allow the user to input new names, shuffling the names, or randomizing it?

epascua
Posts: 47
Posted 21:20 Sep 06, 2016 |

Just a wild guess, but I would say since the first question asks you to put the list in the loop (and the do loop always runs, therefore always making a new list), you will always ask the user to input a new length of the list and a new set of names depending on how many children there are. 

There isn't any shuffling or randomizing, the only movement through the indexes is when you're going through in the array list with the Modulo-thing where you go down the list then back up. 

Last edited by epascua at 21:21 Sep 06, 2016.
dcacere4
Posts: 10
Posted 21:24 Sep 06, 2016 |

He wants us to create a new list of names every time it runs heres an example from my program:

Enter the number of children: 2
Enter a name:
bob
Enter a name:
joe
What would you like to do:
1.Easy Problem.
2.Hard Problem.
3.Quit.
1
Copy and enter the whole string that has been printed.
Day 0: bob must do the dishes.
Day 0: bob must do the dishes.
Copy and enter the whole string that has been printed.
Day 1: joe must do the dishes.
joe
You were correct 1 times.
Enter the number of children: 1
Enter a name:
bob
What would you like to do:
1.Easy Problem.
2.Hard Problem.
3.Quit.
3

 

tandluong
Posts: 7
Posted 21:31 Sep 06, 2016 |

Ah... I see. Thank you for your response. I found out that my mistake was that I did not put the name list method inside the loop inside main, therefore, it was not repeating.

epascua
Posts: 47
Posted 21:34 Sep 06, 2016 |
dcacere4 wrote:

He wants us to create a new list of names every time it runs heres an example from my program:

Enter the number of children: 2
Enter a name:
bob
Enter a name:
joe
What would you like to do:
1.Easy Problem.
2.Hard Problem.
3.Quit.
1
Copy and enter the whole string that has been printed.
Day 0: bob must do the dishes.
Day 0: bob must do the dishes.
Copy and enter the whole string that has been printed.
Day 1: joe must do the dishes.
joe
You were correct 1 times.
Enter the number of children: 1
Enter a name:
bob
What would you like to do:
1.Easy Problem.
2.Hard Problem.
3.Quit.
3

 

I believe the menu should be on the jprompt thing. Here's how mine looks:

Welcome to the Dish Duty program!
Please enter the number of Children to begin: 3
What is the name of Child 0: Kylo Ren
What is the name of Child 1: General Hux
What is the name of Child 2: Captain Phasma
Day 0: Kylo Ren must do the dishes. Who has to do the dishes on day 0? Kylo Ren
Day 1: General Hux must do the dishes. Who has to do the dishes on day 1? General Hux
Day 2: Captain Phasma must do the dishes. Who has to do the dishes on day 2? Captain Phasma
Day 3: Kylo Ren must do the dishes. Who has to do the dishes on day 3? Kyle Ron
Wrong!
Welcome to the Dish Duty program!
Please enter the number of Children to begin: 2
What is the name of Child 0: Doge
What is the name of Child 1: egoD
Day 0 Input: Doge
Day 1 Input: egoD
Day 2 Input: Dog?
Wrong!

It makes a popup of how many days you right until you messed up (that's why it's not printing it); but I think you can also print it.

dcacere4
Posts: 10
Posted 21:38 Sep 06, 2016 |

Were we suppose to use jprompt? I thought he said not in this assignment

epascua
Posts: 47
Posted 21:44 Sep 06, 2016 |
dcacere4 wrote:

Were we suppose to use jprompt? I thought he said not in this assignment

Testing you. LOL Just kidding.

I don't know I somehow had it in the back of my mind when working on the lab that we had to use jprompt. Haha.

Well guess we don't (Just read over the lab). xD

dcacere4
Posts: 10
Posted 21:46 Sep 06, 2016 |

haha you scared me there, i had submitted it already