Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. //promptbank/object/Method
  2. public class PromptBank {
  3. //constructor initiallizing variables
  4. private String [] questions;
  5. private String [] statements;
  6. //le
  7. public PromptBank(){
  8. questions = new String[3]; //initialize your array to the correct length to match your number of questions you populate it with
  9. statements = new String[3];//initialize your array to the correct length to match your number of questions you populate it with
  10.  
  11. }
  12. //concadinate first and last, change blank1 and blank2 into first and last
  13. public void populateStatementsArray(String First, String Last){
  14. statements[0] = "Tell me more about " + First + " and " + Last;
  15. statements[1] = First + " seems important to you, so does " + Last + ". Please tell me more.";
  16. statements[2] = First + " and " + Last + " seem to be on your mind. Let's talk about it.";
  17. /*complete this method with your other statements using BLANK1 for word1
  18. * and BLANK2 for word2 place holder
  19. */
  20. }
  21. public void populateQuestionsArray(String First, String Last){
  22. questions[0] = "Is there anything else about " + First + " and " + Last + "?";
  23. questions[1] = "Does " + First + " bother you? How about " + Last + "?";
  24. questions[2] = "Are " + First + " and " + Last + " things you think about often?";
  25.  
  26. /*complete this method with your other questions using BLANK1 for word1
  27. * and BLANK2 for word2 place holder
  28. */
  29.  
  30. }public static int num() {
  31. //Create a method for the random integer number to change double to integer
  32. double icrs = 2;
  33. double dr = 0;
  34. double random = Math.random()*((2-0) + 1) + 0;
  35. int num = (int) random;
  36. return num;
  37. }
  38. //change numbers into integer.
  39. // declare an integer that converts double into an integer
  40.  
  41.  
  42. //Get Statement and Question and Return them
  43. public String getRandomStatementTrunk(int Num1){
  44. return statements[Num1];
  45. }
  46.  
  47. //fill in the method so it randomly selects the statement template
  48. //from the questions array ... hint use Math.random() to get the random index
  49. //so you can replace BLANK1 and BLANK2 with the appropriate words
  50.  
  51.  
  52.  
  53. public String getRandomQuestionTrunk(int Num2) {
  54. return questions[Num2];
  55. }
  56. //fill in the method so it randomly selects the question template
  57. //from the questions array ... hint use Math.random() to get the random index
  58. //so you can replace BLANK1 and BLANK2 with the appropriate words
  59. }
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement