Question 1 (Multiple Choice Worth 4 points)
(LC)What is the main purpose of backstory in a narrative?
To create conflict for the protagonist
To explain what has happened before the story<<<
import java.util.Scanner; public class dontPostThisInCompSci { public static void main(String[]args) { Scanner keyboard = new Scanner(System.in); String input = "", input2 = ""; boolean inputBoo = false, check = false; do{ if(inputBoo) { System.out.println("Invalid input."); } System.out.println("is the main purpose of a backstory to explain" + " what happened before the story? yes/no"); input = keyboard.nextLine(); inputBoo = true; }while(!(input.equals("yes")) && !(input.equals("no"))); do{ if(check) { System.out.println("Invalid input."); } System.out.println("Are any of the other 3 answers the main purpose" + " of a backstory in a narrative true? yes/no"); input2 = keyboard.nextLine(); check = true; }while(!(input2.equals("yes")) && !(input2.equals("no"))); if(input.equals("yes") && input2.equals("no")) { System.out.println("The answer is: to explain what " + "happened before the story."); } else if(input.equals("yes") && input2.equals("yes")) { System.out.println("There are multiple answers to this question."); } else if(input.equals("no") && input2.equals("yes")) { System.out.println("The answer is not: to explain what" + " happened before the story."); } else { System.out.println("None of the answers are correct."); } } }
Please don't post this question in the computer science chat.
Join our real-time social learning platform and learn together with your friends!