Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java question Scanner input = new Scanner(a1.dat); int mission = input.nextInt(); boolean onMission = input.nextBoolean(); String name = input.nextLine(); System.out.println(name + has done +

java question

Scanner input = new Scanner(a1.dat);

int mission = input.nextInt();

boolean onMission = input.nextBoolean();

String name = input.nextLine();

System.out.println(name + "has done " + mission + " missions and on Mission states is " + onMission);

a1.dat file contain:

B

false

Crew 41

what is the output? And when i run it i get error "Exception in thread "main" java.util.InputMismatchException", can you fix this issue like create file a1.dat and the code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Project Management A Systems Approach to Planning Scheduling and Controlling

Authors: Harold Kerzner

10th Edition

978-047027870, 978-0-470-5038, 470278706, 978-0470278703

Students also viewed these Databases questions