Question: Today, you'll be working on Jgrasp with either scanner or java.io (both for input and output). You be adapting a fairie tale to create your
Today, you'll be working on Jgrasp with either scanner or java.io (both for input and output). You be adapting a fairie tale to create your code.
The story, like The 3 Little Pigs, has 3 decisions to make (houses of straw, wood and brick etc). Your job is to create a console application with decisions based on user input.
Below is an example of code:
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner myObj = new Scanner(System.in); // <----This is what the compiler will be looking for (input)
System.out.println("Enter name, age and salary:");
// String input
String name = myObj.nextLine(); // Here's the input.
.....
}
Naturally, yours will look different. It will have boolean (Y/N), input, output - and you can even try skipping the scanner and importing java.io (but your code may be different than what's posted above).
Rubric:
Console App
IF Else conditional statement(s)
Input
Output
Boolean
Class (and an instance)
system.out.print & println
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
