Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hello! For my assignment we are to make our own little project that performs 3 t

ID: 3846574 • Letter: H

Question

Hello! For my assignment we are to make our own little project that performs 3 tasks. We need use cases for 3 of the componts OR a requirements document about this. How would I go about creating this Choose your own adventure text based java program?

Choose your own adventure

LOTR

Text output beginning of game:

I)             Introduce Smeagol. Choice is offered: do you?

Let Frodo and sam keep the ring > you die from agony without the ring

You stick with sam and Frodo

You sneak behind sam and Frodo > You die, sam found you sneaking around one night and killed you

B. Stick with Sam and Frodo. Sam accuses you of wanting to keep the ring yourself! What do?

                d. Get in a fist fight with sam > You die. Sam is much stronger and much more fed than you.

                e. Accuse sam of going against Frodo

                f. admit you want the ring and apologize, it’s not your fault > You die. Sam and Frodo leave you all alone and you go crazy from wanting the ring.

E. Accuse Sam of going against Frodo

                g. Frodo is on your side. You may have had your ups and downs (like that time you tried to feed Frodo to a spider) but you eventually meet up with Sam and Frodo inside of Mount Doom. Unfortunately, you die here because you throw yourself into the volcano to save the ring. What a sad life you’ve had. Hope it was worth it.

Explanation / Answer

import java.util.Scanner;
import java.io.*;
class adventure
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int ch;
String ch1; //accepting the choices from user
String s="Let Frodo and sam keep the ring > you die from agony without the ring";
String s1="You stick with sam and Frodo";
String s2="You sneak behind sam and Frodo > You die, sam found you sneaking around one night and killed you";
System.out.println ("Lets begin an amazing adventure game");
System.out.println ("Introduce Smeagol. Choice is offered: do you?");
System.out.println ("1.Let Frodo and sam keep the ring > you die from agony without the ring");
System.out.println ("2.You stick with sam and Frodo");
System.out.println ("3.You sneak behind sam and Frodo > You die, sam found you sneaking around one night and killed you");
System.out.println ("Choose your adventure");
ch=sc.nextInt();
if(ch==1) //if choice 1 game ends
{
System.out.println ("Let Frodo and sam keep the ring > you die from agony without the ring");
System.out.println("End of Adventure");
}
else if(ch==3) //if choice 3 game ends
{
System.out.println ("You sneak behind sam and Frodo > You die, sam found you sneaking around one night and killed you");
System.out.println("End of Adventure");
}
else //if choice 2 the game continues
{
System.out.println ("You stick with sam and Frodo");
System.out.println ("Adventure Continues");
System.out.println("Sam accuses you of wanting to keep the ring yourself! What do?");
System.out.println("d.Get in a fist fight with sam > You die. Sam is much stronger and much more fed than you.");
System.out.println("e.Accuse sam of going against Frodo");
System.out.println("f.Admit you want the ring and apologize, it’s not your fault > You die. Sam and Frodo leave you all alone and you go crazy from wanting the ring.");
System.out.println ("Choose your adventure");
ch1=sc.next();
if(ch1=="d" || ch1=="D") //if chocie d or D game ends
{
System.out.println("Get in a fist fight with sam > You die. Sam is much stronger and much more fed than you.");
System.out.println("End of Adventure");
}
else if(ch1=="f" || ch1=="F") //if choice f or F game ends
{
System.out.println("Admit you want the ring and apologize, it’s not your fault > You die. Sam and Frodo leave you all alone and you go crazy from wanting the ring.");
System.out.println("End of Adventure");
}
else //if choice e or E the game continues
{
System.out.println("Accuse sam of going against Frodo");
System.out.println("Frodo is on your side. You may have had your ups and downs (like that time you tried to feed Frodo to a spider) but you eventually meet up with Sam and Frodo inside of Mount Doom. Unfortunately, you die here because you throw yourself into the volcano to save the ring. What a sad life you’ve had. Hope it was worth it.");
}
}
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote